예제 #1
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public string DelInfo(string id)
 {
     if (id.Length > 0)
     {
         Common_BLL  pg      = new Common_BLL();
         Sys_MenuBLL bllMenu = new Sys_MenuBLL();
         if (pg.Delete(TableName, TableKey, "'" + id + "'", ""))
         {
             //删除待办事项
             new RoleConfig().DeleteMatterTasks(id.Replace("'", ""));
             string   rtnUrl    = Request.RawUrl;
             Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl);
             if (MenuModel != null)
             {
                 if (!string.IsNullOrEmpty(MenuModel.Menu_Name))
                 {
                     pg.AddLog(MenuModel.Menu_Name, id, "删除", "ID=" + id + "", bg.CurrUserInfo().UserID, bg.CurrUserInfo().DepartmentCode);
                 }
             }
             return("1");
         }
         else
         {
             return("0");
         }
     }
     else
     {
         return("0");
     }
 }
예제 #2
0
 /// <summary>
 /// 批量删除数据
 /// </summary>
 public string BatchDelInfo(string id)
 {
     if (id.Length > 0)
     {
         Common_BLL    pg      = new Common_BLL();
         Sys_MenuBLL   bllMenu = new Sys_MenuBLL();
         StringBuilder sqlstr  = new StringBuilder();
         List <string> listId  = new List <string>();
         listId = id.Split(',').ToList();
         foreach (var item in listId)
         {
             sqlstr.Append("'" + item + "',");
         }
         string sql = sqlstr.ToString().Remove(sqlstr.Length - 1);
         if (pg.Delete(TableName, TableKey, sql, ""))
         {
             //删除待办事项
             new RoleConfig().DeleteBatchMatterTasks(sql);
             string   rtnUrl    = Request.RawUrl;
             Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl);
             if (MenuModel != null)
             {
                 if (!string.IsNullOrEmpty(MenuModel.Menu_Name))
                 {
                     pg.AddLog(MenuModel.Menu_Name, "", "批量删除成功", "批量删除通过:" + listId, bg.CurrUserInfo().UserID, bg.CurrUserInfo().DepartmentCode);
                 }
             }
             return("1");
         }
         else
         {
             return("0");
         }
     }
     else
     {
         return("0");
     }
 }
예제 #3
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        protected string DelInfo(string id)
        {
            if (id.Length > 0)
            {
                Common_BLL       pg       = new Common_BLL();
                Sys_MenuBLL      bllMenu  = new Sys_MenuBLL();
                BasePage         page     = new BasePage();
                SessionUserModel userInfo = page.CurrUserInfo();
                if (pg.Delete(UCEasyUIDataGrid.TableName, UCEasyUIDataGrid.TableKey, "'" + id + "'", ""))
                {
                    //删除日志
                    //DeleteLog();


                    //删除待办事项
                    new RoleConfig().DeleteMatterTasks(id.Replace("'", ""));

                    string rtnUrl = Request.RawUrl;

                    Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl);
                    if (MenuModel != null)
                    {
                        if (!string.IsNullOrEmpty(MenuModel.Menu_Name))
                        {
                            pg.AddLog(MenuModel.Menu_Name, id, "删除", "ID=" + id + "", userInfo.UserID, userInfo.DepartmentCode);
                        }
                    }
                    return("1");
                }
                else
                {
                    return("0");
                }
            }
            else
            {
                return("0");
            }
        }