Example #1
0
 public void DelDepartment()
 {
     string idlist = Parameters["pparm"];
     SysDepartmentBiz biz = new SysDepartmentBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     biz.Delete(idlist, out ErrInfo);
     Response.Write(ErrInfo.ToJson());
 }
Example #2
0
 public void GetGridData()
 {
     string _searchcontent = "";
     string _sortname = "";
     string _sortdirection = "";
     string _pagenumber = "";
     string _pagesize = "";
     _searchcontent = Parameters["psearchcontent"];
     _sortname = Parameters["psortname"];
     if (!string.IsNullOrEmpty(_sortname))
     {
         sSortName = _sortname;
     }
     _sortdirection = Parameters["psortdirection"];
     if (!string.IsNullOrEmpty(_sortdirection))
     {
         sSortDirection = _sortdirection;
     }
     _pagenumber = Parameters["ppagenumber"];
     if (!string.IsNullOrEmpty(_pagenumber))
     {
         sPageIndex = Convert.ToInt32(_pagenumber);
     }
     _pagesize = Parameters["ppagesize"];
     if (!string.IsNullOrEmpty(_pagesize))
     {
         sPageSize = Convert.ToInt32(_pagesize);
     }
     List<SysDepartment> lists = new List<SysDepartment>();
     SysDepartmentBiz biz = new SysDepartmentBiz();
     string _searchtext = _searchcontent;
     string wheresql = "";
     if (!string.IsNullOrEmpty(_searchtext))
     {
         wheresql = " (FDepartmentName like '%" + _searchtext + "%') or (FDepartmentCode like '%" + _searchtext + "%')";
     }
     else
     {
         wheresql = "1=1";
     }
     NameValueCollection where = new NameValueCollection();
     where.Add("condition", wheresql);
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add(_sortname, _sortdirection);
     Int32 totalcount = 0;
     lists = biz.Select(where, orderby, Convert.ToInt32(sPageIndex), Convert.ToInt32(sPageSize), out totalcount);
     string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount);
     Response.Write(datasource);
 }
Example #3
0
 public void GetDeptItem()
 {
     string _id = Parameters["pid"];
     SysDepartment item = new SysDepartment();
     SysDepartmentBiz biz = new SysDepartmentBiz();
     item = biz.Select(_id);
     if (item == null)
     {
         Response.Write("");
     }
     else
     {
         Response.Write(item.ToJson());
     }
 }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         List<SysDepartment> deptlist = new List<SysDepartment>();
         SysDepartmentBiz deptbiz = new SysDepartmentBiz();
         deptlist = deptbiz.SelectDeptByUser(userid);
         AddDatasource("deptlist", deptlist);
     }
 }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                List<SysDepartment> deptlist = new List<SysDepartment>();
                SysDepartmentBiz deptbiz = new SysDepartmentBiz();
                deptlist = deptbiz.SelectDeptByUser(userid);
                AddDatasource("deptlist", deptlist);

                List<SysNation> nationlist = new List<SysNation>();
                SysNationBiz nationbiz = new SysNationBiz();
                nationlist = nationbiz.Select();
                AddDatasource("nationlist", nationlist);

                List<SysEducation> educationlist = new List<SysEducation>();
                SysEducationBiz edbiz = new SysEducationBiz();
                educationlist = edbiz.Select();
                AddDatasource("educationlist", educationlist);
            }
        }
Example #6
0
 public void SaveItem()
 {
     string _deptid = Parameters["pdeptid"];
     string _deptcode = Parameters["pdeptcode"];
     string _depttype = Parameters["pdepttype"];
     string _deptname = Parameters["pdeptname"];
     string _deptcharge = Parameters["pdeptcharge"];
     string _depttel = Parameters["pdepttel"];
     string _deptnum = Parameters["pdeptnum"];
     string _content = Parameters["pcontent"];
     SysDepartment item = new SysDepartment();
     item.FDepartmentID = string.IsNullOrEmpty(_deptid) ? 0 : Convert.ToInt64(_deptid);
     item.FDepartmentCode = _deptcode;
     item.FDepartmentName = _deptname;
     item.FDepartmentCharge = _deptcharge;
     item.FDepartmentTypeId = string.IsNullOrEmpty(_depttype) ? 0 : Convert.ToInt64(_depttype);
     item.FDepartmentContent = _content;
     item.FDepartmentTel = _depttel;
     item.FDepartmentNum = string.IsNullOrEmpty(_deptnum) ? 0 : Convert.ToInt32(_deptnum);
     SysDepartmentBiz biz = new SysDepartmentBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     if (item.FDepartmentID == 0)
     {
         biz.Insert(item, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List<SysRole> rolelist = new List<SysRole>();
            SysRoleBiz rolebiz = new SysRoleBiz();
            rolelist = rolebiz.Select();
            AddDatasource("rolelist", rolelist);

            List<SysDepartment> deptlist = new List<SysDepartment>();
            SysDepartmentBiz deptbiz = new SysDepartmentBiz();
            deptlist = deptbiz.Select();
            AddDatasource("deptlist", deptlist);
        }