コード例 #1
0
        //可以多行刪除數據_master
        public HttpResponseBase ScheduleMasterDelete()
        {
            string json = string.Empty;
            ScheduleMasterQuery query = new ScheduleMasterQuery();
            _secheduleServiceMgr = new ScheduleServiceMgr(mySqlConnectionString);
            try
            {
                string id = Request.Params["id"];
                string[] ids = id.Split(',');
                for (int i = 0; i < ids.Length - 1; i++)
                {
                    query.rowid = int.Parse(ids[i].ToString());
                    _secheduleServiceMgr.ScheduleMasterDelete(query.rowid.ToString());

                }
                json = "{success:true}";
            }
            #region 只刪除一行數據時的代碼段
            //if (!string.IsNullOrEmpty(Request.Params["id"]))
            //{
            //    query.id = Convert.ToUInt32(Request.Params["id"]);
            //}

            //  int _dt = informationMgr.PersonInfromationDelete(query);

            //if (_dt > 0)
            //{
            //    json = "{success:true}";
            //}
            //else
            //{
            //    json = "{success:false}";
            //}  
            #endregion
            catch (Exception ex)
            {
                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);
                json = "{success:false}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }