コード例 #1
0
 public HttpResponseBase DeleteFunction()
 {
     string json = string.Empty;
     try
     {
         if (!string.IsNullOrEmpty(Request.Form["rowID"]))
         {
             string rowIDs = Request.Form["rowID"];
             if (rowIDs.IndexOf("|") != -1)
             {
                 functionMgr = new FunctionMgr(connectionString);
                 foreach (string id in rowIDs.Split('|'))
                 {
                     if (!string.IsNullOrEmpty(id))
                     {
                         functionMgr.Delete(Convert.ToInt32(id));
                     }
                 }
             }
         }
         json = "{success:true}";
     }
     catch (Exception ex)
     {
         json = "{success:false}";
         Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
         logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
         logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
         log.Error(logMessage);
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }