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


C# OpenEnvironmentEntities.ExecuteStoreCommand方法代碼示例

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


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

示例1: DeleteT_WQX_MONLOC

        public static int DeleteT_WQX_MONLOC(int monLocIDX, string UserID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_WQX_MONLOC m = db_WQX.GetWQX_MONLOC_ByID(monLocIDX);
                    if (m != null)
                    {
                        if (m.WQX_SUBMIT_STATUS == "Y" && m.ACT_IND == false)
                        {
                            //only actually delete record from database if it has already been set to inactive and WQX status is passed ("Y")
                            string sql = "DELETE FROM T_WQX_MONLOC WHERE MONLOC_IDX = " + monLocIDX;
                            ctx.ExecuteStoreCommand(sql);
                            return 1;
                        }

                        //if there are any activities for this monitoring location, don't delete becuase this would cause WQX to delete all activities for this mon loc.
                        int iActCount = db_WQX.GetWQX_ACTIVITYByMonLocID(monLocIDX);
                        if (iActCount > 0)
                        {
                            return -1;
                        }
                        else
                        {
                            //mark as inactive (deleted), which will send the delete request to EPA-WQX
                            db_WQX.InsertOrUpdateWQX_MONLOC(monLocIDX, null, null, null, null, null, null, null, null, null, null, null, null, null,
                                null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "U", null, false, null, UserID);
                            return 1;
                        }

                    }
                    else
                        return 0;

                }
                catch
                {
                    return 0;
                }
            }
        }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:42,代碼來源:db_WQX.cs

示例2: DeleteT_WQX_PROJECT

        public static int DeleteT_WQX_PROJECT(int ProjectIDX, string UserID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_WQX_PROJECT p = db_WQX.GetWQX_PROJECT_ByID(ProjectIDX);
                    if (p != null)
                    {
                        if (p.WQX_SUBMIT_STATUS == "Y" && p.ACT_IND == false)
                        {
                            //only actually delete record from database if it has already been set to inactive and WQX status is passed ("Y")
                            string sql = "DELETE FROM T_WQX_PROJECT WHERE PROJECT_IDX = " + ProjectIDX;
                            ctx.ExecuteStoreCommand(sql);
                            return 1;
                        }

                        //if there are any active activities for this project, don't delete becuase this would cause WQX to delete all activities for this project.
                        int iActCount = db_WQX.GetWQX_ACTIVITYByProjectID(ProjectIDX);
                        if (iActCount > 0)
                            return -1;
                        else
                        {
                            //mark as inactive (deleted), which will send the delete request to EPA-WQX
                            InsertOrUpdateWQX_PROJECT(ProjectIDX, null, null, null, null, null, null, null, "U", null, false, null, UserID);
                            return 1;
                        }

                    }
                    else
                        return 0;

                }
                catch
                {
                    return 0;
                }
            }
        }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:39,代碼來源:db_WQX.cs

示例3: DeleteT_WQX_IMPORT_TRANSLATE

 public static int DeleteT_WQX_IMPORT_TRANSLATE(int TranslateID)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             string sql = "DELETE FROM T_WQX_IMPORT_TRANSLATE WHERE TRANSLATE_IDX = " + TranslateID;
             ctx.ExecuteStoreCommand(sql);
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:16,代碼來源:db_WQX.cs

示例4: DeleteT_WQX_IMPORT_TEMP_SAMPLE

 public static int DeleteT_WQX_IMPORT_TEMP_SAMPLE(global::System.String uSER_ID)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             string sql = "DELETE FROM T_WQX_IMPORT_TEMP_SAMPLE WHERE USER_ID = '" + uSER_ID + "'";
             ctx.ExecuteStoreCommand(sql);
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:16,代碼來源:db_WQX.cs

示例5: DeleteT_WQX_IMPORT_TEMPLATE_DTL

 public static int DeleteT_WQX_IMPORT_TEMPLATE_DTL(int TemplateDtlID)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             string sql = "DELETE FROM T_WQX_IMPORT_TEMPLATE_DTL WHERE TEMPLATE_DTL_ID = " + TemplateDtlID;
             ctx.ExecuteStoreCommand(sql);
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:16,代碼來源:db_WQX.cs

示例6: DeleteT_WQX_ACTIVITY

        public static int DeleteT_WQX_ACTIVITY(int ActivityIDX, string UserID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_WQX_ACTIVITY a = db_WQX.GetWQX_ACTIVITY_ByID(ActivityIDX);
                    if (a != null)
                    {
                        if (a.ACT_IND == false && (a.WQX_IND == false || a.WQX_SUBMIT_STATUS != "U"))
                        {
                            //only actually delete record from database if it has already been set to inactive and WQX status is not pending ("U")
                            string sql = "DELETE FROM T_WQX_ACTIVITY WHERE ACTIVITY_IDX = " + ActivityIDX;
                            ctx.ExecuteStoreCommand(sql);
                            return 1;
                        }
                        else
                        {
                            //mark as inactive (deleted), which will send the delete request to EPA-WQX
                            UpdateWQX_ACTIVITY_WQXStatus(ActivityIDX, "U", false, null, UserID);
                            return 1;
                        }

                    }
                    else
                        return 0;

                }
                catch
                {
                    return 0;
                }
            }
        }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:34,代碼來源:db_WQX.cs

示例7: DeleteT_EPA_ORGS

 // ***************************** T_EPA_ORGS ******************************
 // *********************************************************************
 public static int DeleteT_EPA_ORGS()
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             string sql = "DELETE FROM T_EPA_ORGS";
             ctx.ExecuteStoreCommand(sql);
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
開發者ID:open-environment,項目名稱:open-waters,代碼行數:18,代碼來源:db_WQX.cs


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