Example #1
0
 protected DataTable get_branch_list(int top, string strwhere, string strorder)
 {
     BLL.branch bll = new BLL.branch();
     return(bll.GetBranchList(top, strwhere, strorder).Tables[0]);
 }
Example #2
0
 protected DataTable get_branch_list(int pageSize, int pageIndex, string strWhere, string strorder, out int totalcount)
 {
     BLL.branch bll = new BLL.branch();
     return(bll.GetBranchList(pageSize, pageIndex, strWhere, strorder, out totalcount).Tables[0]);
 }
Example #3
0
        private void add_branch(HttpContext context)
        {
            string title = DTRequest.GetFormString("title");
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,请重新登录!\"}");
                return;
            }
            BLL.branch bll = new BLL.branch();
            Model.branch branch_model = new Model.branch();
            branch_model.user_id = model.id;
            branch_model.add_time = DateTime.Now;
            branch_model.title = title;

            if (bll.Add(branch_model) > 0)
            {
                context.Response.Write("{\"status\":\"1\", \"msg\":\"新增部门成功!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"新增部门失败!\"}");
                return;

            }
        }
Example #4
0
 protected DataTable get_branch_title_list(int user_id)
 {
     BLL.branch bll = new BLL.branch();
     return(bll.Get_title_list(" user_id=" + user_id));
 }
Example #5
0
        private void save_branch(HttpContext context)
        {
            string title = DTRequest.GetFormString("title");
            int id = DTRequest.GetFormInt("hd_id");
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,请重新登录!\"}");
                return;
            }
            BLL.branch bll = new BLL.branch();
            Model.branch branch_model = bll.GetModel(id);
            if (branch_model == null)
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"当前内容不存在或已删除!\"}");
                return;
            }
            branch_model.title = title;

            if (bll.Update(branch_model))
            {
                context.Response.Write("{\"status\":\"1\", \"msg\":\"修改部门成功!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":\"0\", \"msg\":\"修改部门失败!\"}");
                return;

            }
        }
Example #6
0
 private void del_branch(HttpContext context)
 {
     int id = DTRequest.GetQueryInt("id");
     Model.users model = new BasePage().GetUserInfo();
     if (model == null)
     {
         context.Response.Write("{\"status\":\"0\", \"msg\":\"对不起,请重新登录!\"}");
         return;
     }
     BLL.branch bll = new BLL.branch();
     if (bll.Delete(id))
     {
         context.Response.Write("{\"status\":\"1\", \"msg\":\"删除部门成功!\"}");
         return;
     }
     else
     {
         context.Response.Write("{\"status\":\"0\", \"msg\":\"删除部门失败!\"}");
         return;
     }
 }
Example #7
0
 protected DataTable get_branch_title_list(int user_id)
 {
     BLL.branch bll = new BLL.branch();
     return bll.Get_title_list(" user_id="+user_id);
 }
Example #8
0
 protected DataTable get_branch_list(int pageSize, int pageIndex, string strWhere, string strorder, out int totalcount)
 {
     BLL.branch bll = new BLL.branch();
     return bll.GetBranchList(pageSize, pageIndex, strWhere, strorder, out totalcount).Tables[0];
 }
Example #9
0
 protected DataTable get_branch_list(int top,string strwhere,string strorder)
 {
     BLL.branch bll = new BLL.branch();
     return bll.GetBranchList(top, strwhere, strorder).Tables[0];
 }