protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 17, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.冻结, NFMT.Common.OperateEnum.解除冻结 }); this.navigation1.Routes.Add("部门管理", string.Format("{0}User/DepartmentList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("部门明细", string.Empty); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out id)) { if (id == 0) Response.Redirect("DepartmentList.aspx"); NFMT.User.BLL.DepartmentBLL deptBLL = new NFMT.User.BLL.DepartmentBLL(); var result = deptBLL.Get(user, id); if (result.ResultStatus != 0) Response.Redirect("DepartmentList.aspx"); NFMT.User.Model.Department dept = result.ReturnValue as NFMT.User.Model.Department; if (dept != null) { this.ddlCorpId.InnerText = dept.CorpName; this.txbDeptCode.InnerText = dept.DeptCode; this.txbDeptName.InnerText = dept.DeptName; this.txbDeptFullName.InnerText = dept.DeptFullName; this.txbDeptShort.InnerText = dept.DeptShort; NFMT.Data.Model.BDStyleDetail bd = NFMT.Data.DetailProvider.Details(NFMT.Data.StyleEnum.DeptType)[dept.DeptType]; if (bd != null) this.ddlDeptType.InnerText = bd.DetailName; this.ddlParentDeptName.InnerText = dept.ParentDeptName; //this.ddlDeptLevel.InnerText = dept.DeptLevel.ToString(); this.hidId.Value = dept.DeptId.ToString(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string json = serializer.Serialize(dept); this.hidModel.Value = json; } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 80, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 }); this.navigation1.Routes.Add("员工部门分配-部门列表", string.Format("{0}User/DeptList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("员工分配", string.Empty); int deptId = 0; if (string.IsNullOrEmpty(Request.QueryString["deptId"])) Response.Redirect("DeptList.aspx"); if(!int.TryParse(Request.QueryString["deptId"],out deptId)) Response.Redirect("DeptList.aspx"); NFMT.User.BLL.DepartmentBLL bll = new NFMT.User.BLL.DepartmentBLL(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = bll.Get(user,deptId); if(result.ResultStatus!=0) Response.Redirect("DeptList.aspx"); NFMT.User.Model.Department dept = result.ReturnValue as NFMT.User.Model.Department; if(dept == null || dept.DeptId ==0) Response.Redirect("DeptList.aspx"); NFMT.User.BLL.CorporationBLL corpBll = new NFMT.User.BLL.CorporationBLL(); result = corpBll.Get(user, dept.CorpId); if(result.ResultStatus !=0) Response.Redirect("DeptList.aspx"); NFMT.User.Model.Corporation corp = result.ReturnValue as NFMT.User.Model.Corporation; if (corp == null || corp.CorpId == 0 || !corp.IsSelf) Response.Redirect("DeptList.aspx"); //设置部门信息 this.spnDeptCode.InnerHtml = dept.DeptCode; this.spnDeptName.InnerHtml = dept.DeptName; this.spnCorpName.InnerHtml = corp.CorpName; NFMT.Data.StyleEnum style = NFMT.Data.StyleEnum.部门类型; NFMT.Data.Model.BDStyleDetail detail = NFMT.Data.DetailProvider.Details(style)[dept.DeptType]; this.spnDeptType.InnerHtml = detail.DetailName; this.hidDeptId.Value = dept.DeptId.ToString(); } }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; int id = 0; int operateId = 0; if (!int.TryParse(context.Request.Form["id"], out id) || id <= 0) { context.Response.Write("序号错误"); context.Response.End(); } if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0) { context.Response.Write("操作错误"); context.Response.End(); } NFMT.User.BLL.DepartmentBLL bll = new NFMT.User.BLL.DepartmentBLL(); NFMT.User.Model.Department dept = new NFMT.User.Model.Department() { DeptId = id, LastModifyId = user.EmpId }; NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); switch (operateEnum) { case NFMT.Common.OperateEnum.作废: result = bll.Invalid(user, dept); break; case NFMT.Common.OperateEnum.撤返: result = bll.GoBack(user, dept); break; case NFMT.Common.OperateEnum.冻结: result = bll.Freeze(user, dept); break; case NFMT.Common.OperateEnum.解除冻结: result = bll.UnFreeze(user, dept); break; } context.Response.Write(result.Message); }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 17, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("部门管理", string.Format("{0}User/DepartmentList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("部门修改", string.Empty); int id = 0; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out id)) { if (id == 0) Response.Redirect("DepartmentList.aspx"); NFMT.User.BLL.DepartmentBLL deptBLL = new NFMT.User.BLL.DepartmentBLL(); var result = deptBLL.Get(user, id); if (result.ResultStatus != 0) Response.Redirect("DepartmentList.aspx"); NFMT.User.Model.Department dept = result.ReturnValue as NFMT.User.Model.Department; if (dept != null) { this.hidCorpId.Value = dept.CorpId.ToString(); this.hidDeptType.Value = dept.DeptType.ToString(); //this.hidDeptLevel.Value = dept.DeptLevel.ToString(); this.hidParentDeptId.Value = dept.ParentLeve.ToString(); this.txbDeptCode.Value = dept.DeptCode; this.txbDeptName.Value = dept.DeptName; this.txbDeptFullName.Value = dept.DeptFullName; this.txbDeptShort.Value = dept.DeptShort; } } this.hidStyleId.Value = ((int)NFMT.Data.StyleEnum.部门类型).ToString(); } } }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int corpId = 0; if (!string.IsNullOrEmpty(context.Request["corpId"])) int.TryParse(context.Request["corpId"], out corpId); NFMT.User.BLL.DepartmentBLL deptBLL = new NFMT.User.BLL.DepartmentBLL(); var result = deptBLL.GetDeptList(user, corpId); context.Response.ContentType = "application/json; charset=utf-8"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt); context.Response.Write(jsonStr); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; int corpId = 0; string deptCode = context.Request.Form["DeptCode"]; string deptName = context.Request.Form["DeptName"]; string deptFullName = context.Request.Form["DeptFullName"]; string deptShort = context.Request.Form["DeptShort"]; int deptType = 0; int parentLeve = 0; int deptLevel = 0; string resultStr = "添加失败"; if (string.IsNullOrEmpty(deptName)) { resultStr = "部门名称不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (!string.IsNullOrEmpty(context.Request.Form["CorpId"])) { if (!int.TryParse(context.Request.Form["CorpId"], out corpId)) { resultStr = "所属公司转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["DeptType"])) { if (!int.TryParse(context.Request.Form["DeptType"], out deptType)) { resultStr = "部门类型转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["ParentLeve"])) { if (!int.TryParse(context.Request.Form["ParentLeve"], out parentLeve)) { resultStr = "上级部门转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["DeptLevel"])) { if (!int.TryParse(context.Request.Form["DeptLevel"], out deptLevel)) { resultStr = "部门级别转换错误"; context.Response.Write(resultStr); context.Response.End(); } } NFMT.User.Model.Department dept = new NFMT.User.Model.Department() { CorpId = corpId, DeptCode = deptCode, DeptName = deptName, DeptFullName = deptFullName, DeptShort = deptShort, DeptType = deptType, ParentLeve = parentLeve, DeptLevel = deptLevel }; NFMT.User.BLL.DepartmentBLL deptBLL = new NFMT.User.BLL.DepartmentBLL(); var result = deptBLL.Insert(user, dept); resultStr = result.Message; context.Response.Write(resultStr); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; int corpId = 0; string deptCode = context.Request.Form["DeptCode"]; string deptName = context.Request.Form["DeptName"]; string deptFullName = context.Request.Form["DeptFullName"]; string deptShort = context.Request.Form["DeptShort"]; int deptType = 0; int parentLeve = 0; int deptLevel = 0; int id = 0; string resultStr = "修改失败"; if (string.IsNullOrEmpty(context.Request.Form["id"])) { resultStr = "id未知"; context.Response.Write(resultStr); context.Response.End(); } if (!int.TryParse(context.Request.Form["id"], out id)) { resultStr = "id未知"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(deptName)) { resultStr = "部门名称不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (!string.IsNullOrEmpty(context.Request.Form["CorpId"])) { if (!int.TryParse(context.Request.Form["CorpId"], out corpId)) { resultStr = "所属公司转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["DeptType"])) { if (!int.TryParse(context.Request.Form["DeptType"], out deptType)) { resultStr = "部门类型转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["ParentLeve"].Trim())) { if (!int.TryParse(context.Request.Form["ParentLeve"], out parentLeve)) { resultStr = "上级部门转换错误"; context.Response.Write(resultStr); context.Response.End(); } } if (!string.IsNullOrEmpty(context.Request.Form["DeptLevel"])) { if (!int.TryParse(context.Request.Form["DeptLevel"], out deptLevel)) { resultStr = "部门级别转换错误"; context.Response.Write(resultStr); context.Response.End(); } } NFMT.User.BLL.DepartmentBLL deptBLL = new NFMT.User.BLL.DepartmentBLL(); NFMT.Common.ResultModel result = deptBLL.Get(user, id); if (result.ResultStatus != 0) { resultStr = "获取数据错误"; context.Response.Write(resultStr); context.Response.End(); } NFMT.User.Model.Department dept = result.ReturnValue as NFMT.User.Model.Department; if (dept != null) { dept.CorpId = corpId; dept.DeptCode = deptCode; dept.DeptName = deptName; dept.DeptFullName = deptFullName; dept.DeptShort = deptShort; dept.DeptType = deptType; dept.ParentLeve = parentLeve; dept.DeptLevel = deptLevel; result = deptBLL.Update(user, dept); resultStr = result.Message; } context.Response.Write(resultStr); context.Response.End(); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int status = -1, corpId = -1; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; string deptName = context.Request["k"];//deptName模糊搜索 if (!string.IsNullOrEmpty(context.Request["s"])) int.TryParse(context.Request["s"], out status);//状态查询条件 if (!string.IsNullOrEmpty(context.Request["corpId"])) int.TryParse(context.Request["corpId"], out corpId);//状态查询条件 //jqwidgets jqxGrid if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) { string sortDataField = context.Request.QueryString["sortdatafield"].Trim(); string sortOrder = context.Request.QueryString["sortorder"].Trim(); switch (sortDataField) { case "DeptName": sortDataField = string.Format("D.{0}", sortDataField); break; case "DeptFullName": sortDataField = string.Format("D.{0}", sortDataField); break; case "DeptShort": sortDataField = string.Format("D.{0}", sortDataField); break; case "DeptType": sortDataField = string.Format("D.{0}", sortDataField); break; case "ParentDeptName": sortDataField = "D2.DeptName"; break; case "StatusName": sortDataField = "D.DeptStatus"; break; case "DeptLevel": sortDataField = string.Format("D.{0}", sortDataField); break; case "CorpName": sortDataField = "C.CorpName"; break; case "DeptTypeName": sortDataField = "D.DeptType"; break; } orderStr = string.Format("{0} {1}", sortDataField, sortOrder); } NFMT.User.BLL.DepartmentBLL departmentBLL = new NFMT.User.BLL.DepartmentBLL(); NFMT.Common.SelectModel select = departmentBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, deptName, corpId); NFMT.Common.ResultModel result = departmentBLL.Load(user, select); context.Response.ContentType = "application/json; charset=utf-8"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } int totalRows = result.AffectCount; System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; Dictionary<string, object> dic = new Dictionary<string, object>(); //jqwidgets dic.Add("count", result.AffectCount); dic.Add("data", dt); string jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dic, new Newtonsoft.Json.Converters.DataTableConverter()); context.Response.Write(jsonStr); }