當前位置: 首頁>>代碼示例>>C#>>正文


C# OpenEnvironmentEntities.AddToT_WQX_PROJECT方法代碼示例

本文整理匯總了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_PROJECT方法的典型用法代碼示例。如果您正苦於以下問題:C# OpenEnvironmentEntities.AddToT_WQX_PROJECT方法的具體用法?C# OpenEnvironmentEntities.AddToT_WQX_PROJECT怎麽用?C# OpenEnvironmentEntities.AddToT_WQX_PROJECT使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities的用法示例。


在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_PROJECT方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InsertOrUpdateWQX_PROJECT

        public static int InsertOrUpdateWQX_PROJECT(global::System.Int32? pROJECT_IDX, global::System.String oRG_ID, global::System.String pROJECT_ID,
            global::System.String pROJECT_NAME, global::System.String pROJECT_DESC, global::System.String sAMP_DESIGN_TYPE_CD, global::System.Boolean? qAPP_APPROVAL_IND,
            global::System.String qAPP_APPROVAL_AGENCY, global::System.String wQX_SUBMIT_STATUS, DateTime? wQX_SUBMIT_DT, Boolean? aCT_IND, Boolean? wQX_IND, String cREATE_USER = "system")
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                Boolean insInd = false;
                try
                {
                    T_WQX_PROJECT a = new T_WQX_PROJECT();

                    if (pROJECT_IDX != null)
                        a = (from c in ctx.T_WQX_PROJECT
                             where c.PROJECT_IDX == pROJECT_IDX
                             select c).FirstOrDefault();

                    if (pROJECT_IDX == null) //insert case
                    {
                        a = new T_WQX_PROJECT();
                        insInd = true;
                    }

                    if (oRG_ID != null) a.ORG_ID = oRG_ID;
                    if (pROJECT_ID != null) a.PROJECT_ID = pROJECT_ID;
                    if (pROJECT_NAME != null) a.PROJECT_NAME = pROJECT_NAME;
                    if (pROJECT_DESC != null) a.PROJECT_DESC = pROJECT_DESC;
                    if (sAMP_DESIGN_TYPE_CD != null) a.SAMP_DESIGN_TYPE_CD = sAMP_DESIGN_TYPE_CD;
                    if (qAPP_APPROVAL_IND != null) a.QAPP_APPROVAL_IND = qAPP_APPROVAL_IND;
                    if (qAPP_APPROVAL_AGENCY != null) a.QAPP_APPROVAL_AGENCY = qAPP_APPROVAL_AGENCY;
                    if (wQX_SUBMIT_STATUS != null) a.WQX_SUBMIT_STATUS = wQX_SUBMIT_STATUS;
                    if (wQX_SUBMIT_DT != null) a.WQX_UPDATE_DT = wQX_SUBMIT_DT;
                    if (aCT_IND != null) a.ACT_IND = aCT_IND;
                    if (wQX_IND != null) a.WQX_IND = wQX_IND;

                    if (insInd) //insert case
                    {
                        a.CREATE_USERID = cREATE_USER.ToUpper();
                        a.CREATE_DT = System.DateTime.Now;
                        ctx.AddToT_WQX_PROJECT(a);
                    }
                    else
                    {
                        a.UPDATE_USERID = cREATE_USER.ToUpper();
                        a.UPDATE_DT = System.DateTime.Now;
                    }

                    ctx.SaveChanges();

                    return a.PROJECT_IDX;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }
        }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:56,代碼來源:db_WQX.cs


注:本文中的OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_PROJECT方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。