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


C# OpenEnvironmentEntities.AddToT_WQX_ACTIVITY_METRIC方法代碼示例

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


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

示例1: InsertOrUpdateWQX_ACTIVITY_METRIC

        // *************************** ACTIVITY METRICS*************************
        // *********************************************************************
        public static int InsertOrUpdateWQX_ACTIVITY_METRIC(global::System.Int32? aCTIVITY_METRIC_IDX, global::System.Int32 aCTIVITY_IDX, global::System.String mETRIC_TYPE_ID,
            global::System.String mETRIC_TYPE_ID_CONTEXT, global::System.String mETRIC_TYPE_NAME, global::System.String cITATION_TITLE, global::System.String cITATION_CREATOR,
            global::System.String cITATION_SUBJECT, global::System.String cITATION_PUBLISHER, global::System.DateTime? cITATION_DATE, global::System.String cITATION_ID,
            global::System.String mETRIC_SCALE, global::System.String mETRIC_FORMULA_DESC, global::System.String mETRIC_VALUE_MSR, global::System.String mETRIC_VALUE_MSR_UNIT,
            global::System.String mETRIC_SCORE, global::System.String mETRIC_COMMENT, Boolean? wQX_IND, global::System.String wQX_SUBMIT_STATUS, DateTime? WQX_UPDATE_DT, Boolean? aCT_IND, String cREATE_USER = "system")
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                Boolean insInd = false;
                try
                {
                    T_WQX_ACTIVITY_METRIC a = new T_WQX_ACTIVITY_METRIC();

                    if (aCTIVITY_METRIC_IDX != null)
                        a = (from c in ctx.T_WQX_ACTIVITY_METRIC
                             where c.ACTIVITY_METRIC_IDX == aCTIVITY_METRIC_IDX
                             select c).FirstOrDefault();
                    if (aCTIVITY_METRIC_IDX == null) //insert case
                    {
                        a = new T_WQX_ACTIVITY_METRIC();
                        insInd = true;
                    }

                    a.ACTIVITY_IDX = aCTIVITY_IDX;
                    if (mETRIC_TYPE_ID != null) a.METRIC_TYPE_ID= mETRIC_TYPE_ID;
                    if (mETRIC_TYPE_ID_CONTEXT != null) a.METRIC_TYPE_ID_CONTEXT = mETRIC_TYPE_ID_CONTEXT;
                    if (mETRIC_TYPE_NAME != null) a.METRIC_TYPE_NAME = mETRIC_TYPE_NAME;
                    if (cITATION_TITLE != null) a.CITATION_TITLE = cITATION_TITLE;
                    if (cITATION_CREATOR != null) a.CITATION_CREATOR = cITATION_CREATOR;
                    if (cITATION_SUBJECT != null) a.CITATION_SUBJECT = cITATION_SUBJECT;
                    if (cITATION_PUBLISHER != null) a.CITATION_PUBLISHER= cITATION_PUBLISHER;
                    if (cITATION_DATE != null) a.CITATION_DATE = (DateTime)cITATION_DATE;
                    if (cITATION_ID != null) a.CITATION_ID = cITATION_ID;
                    if (mETRIC_SCALE != null) a.METRIC_SCALE = mETRIC_SCALE;
                    if (mETRIC_FORMULA_DESC != null) a.METRIC_FORMULA_DESC = mETRIC_FORMULA_DESC;
                    if (mETRIC_VALUE_MSR != null) a.METRIC_VALUE_MSR = mETRIC_VALUE_MSR;
                    if (mETRIC_VALUE_MSR_UNIT != null) a.METRIC_VALUE_MSR_UNIT = mETRIC_VALUE_MSR_UNIT;
                    if (mETRIC_SCORE != null) a.METRIC_SCORE = mETRIC_SCORE;
                    if (mETRIC_COMMENT != null) a.METRIC_COMMENT = mETRIC_COMMENT;
                    if (wQX_IND != null) a.WQX_IND = wQX_IND;
                    if (wQX_SUBMIT_STATUS != null) a.WQX_SUBMIT_STATUS = wQX_SUBMIT_STATUS;
                    if (WQX_UPDATE_DT != null) a.WQX_UPDATE_DT = WQX_UPDATE_DT;
                    if (aCT_IND != null) a.ACT_IND = aCT_IND;

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

                    ctx.SaveChanges();

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


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