/// <summary> /// 初始话部门和月份 /// </summary> protected void DepartmentInit() { EyouSoft.BLL.CompanyStructure.Department bllDepartment = new EyouSoft.BLL.CompanyStructure.Department(); IList <EyouSoft.Model.CompanyStructure.Department> listDepartment = bllDepartment.GetAllDept(CurrentUserCompanyID); this.dpDepartment.Items.Clear(); this.dpDepartment.Items.Add(new ListItem("--请选择--", "0")); if (listDepartment != null && listDepartment.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.Department modelDepartment in listDepartment) { this.dpDepartment.Items.Add(new ListItem(modelDepartment.DepartName, modelDepartment.Id.ToString())); } } this.dpYear.Items.Clear(); int year = DateTime.Now.Year; for (int i = 0; i < 10; i++) { this.dpYear.Items.Add(new ListItem((year - i) + "年", (year - i).ToString())); } this.dpMonth.Value = DateTime.Now.Month.ToString(); }
protected void BindDepart() { EyouSoft.BLL.CompanyStructure.Department depBll = new EyouSoft.BLL.CompanyStructure.Department(); IList <EyouSoft.Model.CompanyStructure.Department> deplist = depBll.GetAllDept(this.CurrentUserCompanyID); this.ddldep.DataValueField = "Id"; this.ddldep.DataTextField = "DepartName"; this.ddldep.DataSource = deplist; this.ddldep.DataBind(); this.ddldep.Items.Insert(0, new ListItem("请选择", "0")); this.ddldep.SelectedValue = Convert.ToString(qwrModel.DepartmentId); }
/// <summary> /// 部门列表初始化 /// </summary> protected void DepartmentInit() { EyouSoft.BLL.CompanyStructure.Department bllDepartment = new EyouSoft.BLL.CompanyStructure.Department(); IList <EyouSoft.Model.CompanyStructure.Department> listDepartment = bllDepartment.GetAllDept(CurrentUserCompanyID); this.dpDepartment.Items.Clear(); this.dpDepartment.Items.Add(new ListItem("--请选择--", "0")); if (listDepartment != null && listDepartment.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.Department modelDepartment in listDepartment) { this.dpDepartment.Items.Add(new ListItem(modelDepartment.DepartName, modelDepartment.Id.ToString())); } } }
List <string> dpList = new List <string>();//选择过的部门列表 protected void Page_Load(object sender, EventArgs e) { EyouSoft.BLL.CompanyStructure.Department departBll = new EyouSoft.BLL.CompanyStructure.Department(); IList <EyouSoft.Model.CompanyStructure.Department> departList = departBll.GetAllDept(CurrentUserCompanyID); string dpids = Utils.GetQueryStringValue("dpids"); if (dpids != "") { dpList = dpids.Split(',').ToList();//产生选择过的部门 } //绑定部门列表 if (departList != null && departList.Count > 0) { rptDepart.DataSource = departList; rptDepart.DataBind(); } else { rptDepart.EmptyText = "<tr><td align='center'>对不起,暂无部门信息</td></tr>"; } }
private void DepartInit() { EyouSoft.BLL.CompanyStructure.Department depBll = new EyouSoft.BLL.CompanyStructure.Department(); deplist = depBll.GetAllDept(this.CurrentUserCompanyID); }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_组织机构_部门人员栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_组织机构_部门人员栏目, false); return; } empId = Utils.GetInt(Utils.GetQueryStringValue("empId")); //获取员工Id string method = Utils.GetFormValue("hidMethod"); //获取当前操作(保存/继续) method2 = Utils.GetQueryStringValue("copy"); //是否复制数据 string showMess = "数据保存成功!"; //提示消息 //如果当前操作无则初始加载(否则保存操作) EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(SiteUserInfo); //初始化bll EyouSoft.BLL.CompanyStructure.Department departBll = new EyouSoft.BLL.CompanyStructure.Department(); //初始化bll if (method == "") { #region 初始化员工信息 //所属部门 IList <EyouSoft.Model.CompanyStructure.Department> departList = departBll.GetAllDept(CurrentUserCompanyID); selBdepart.DataTextField = "DepartName"; selBdepart.DataValueField = "Id"; selBdepart.DataSource = departList; selBdepart.DataBind(); selBdepart.Items.Insert(0, new ListItem("选择部门", "")); //监管部门 selMdepart.DataTextField = "DepartName"; selMdepart.DataValueField = "Id"; selMdepart.DataSource = departList; selMdepart.DataBind(); selMdepart.Items.Insert(0, new ListItem("选择部门", "")); if (empId != 0) //如果员工Id不为空则加载数据 { EyouSoft.Model.CompanyStructure.CompanyUser userModel = userBll.GetUserInfo(empId); if (userModel != null) { txtEmail.Value = userModel.PersonInfo.ContactEmail; txtFax.Value = userModel.PersonInfo.ContactFax; txtIntroduce.Value = userModel.PersonInfo.PeopProfile; txtMoible.Value = userModel.PersonInfo.ContactMobile; txtMSN.Value = userModel.PersonInfo.MSN; txtQQ.Value = userModel.PersonInfo.QQ; txtRemark.Value = userModel.PersonInfo.Remark; txtTel.Value = userModel.PersonInfo.ContactTel; rdiSex.SelectedValue = ((int)userModel.PersonInfo.ContactSex).ToString(); selMdepart.Value = userModel.SuperviseDepartId.ToString(); selBdepart.Value = userModel.DepartId.ToString(); txtDuty.Value = userModel.PersonInfo.JobName; if (method2 != "copy") //如果不是复制则显示用户名,密码,姓名 { txtUserName.Value = userModel.UserName; txtUserName.Attributes.Add("readonly", "readonly"); txtPass.Value = userModel.PassWordInfo.NoEncryptPassword; pass = userModel.PassWordInfo.NoEncryptPassword; txtName.Value = userModel.PersonInfo.ContactName; } } } #endregion } else { #region 保存员工信息 bool result = false; //判断用户名是否已经存在 if (method == "isexist") { string uName = Utils.GetFormValue("uName"); if (method2 == "copy") { empId = 0; } result = userBll.IsExists(empId, uName, CurrentUserCompanyID); Utils.ResponseMeg(true, result ? "isExist" : "noisExist"); return; } //验证数据完整性 if (Utils.InputText(txtUserName.Value) == "" || Utils.InputText(txtPass.Value) == "" || Utils.InputText(txtName.Value) == "") { MessageBox.Show(this, "数据请填写完整!"); return; } EyouSoft.Model.CompanyStructure.CompanyUser userModel = new EyouSoft.Model.CompanyStructure.CompanyUser(); //如果员工编号不为空且不是复制操作则修改操作(否则为新增) EyouSoft.Model.CompanyStructure.ContactPersonInfo PersonInfo = new EyouSoft.Model.CompanyStructure.ContactPersonInfo(); PersonInfo.JobName = Utils.InputText(txtDuty.Value); PersonInfo.ContactEmail = Utils.InputText(txtEmail.Value); PersonInfo.ContactFax = Utils.InputText(txtFax.Value); PersonInfo.PeopProfile = Utils.InputText(txtIntroduce.Value, 250); PersonInfo.ContactMobile = Utils.InputText(txtMoible.Value); PersonInfo.UserType = EyouSoft.Model.EnumType.CompanyStructure.CompanyUserType.专线用户; PersonInfo.MSN = Utils.InputText(txtMSN.Value); PersonInfo.ContactName = Utils.InputText(txtName.Value); PersonInfo.QQ = Utils.InputText(txtQQ.Value); PersonInfo.Remark = Utils.InputText(txtRemark.Value, 250); PersonInfo.ContactTel = Utils.InputText(txtTel.Value); PersonInfo.ContactSex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)Utils.GetInt(rdiSex.SelectedValue); userModel.PersonInfo = PersonInfo; userModel.IsEnable = true; userModel.LastLoginTime = DateTime.Now; userModel.CompanyId = CurrentUserCompanyID; userModel.DepartId = Utils.GetInt(Utils.GetFormValue(selBdepart.UniqueID)); userModel.SuperviseDepartName = Utils.GetFormValue("selMName"); if (userModel.SuperviseDepartName == "选择部门") { userModel.SuperviseDepartName = ""; } userModel.DepartName = Utils.GetFormValue("selBName"); userModel.IssueTime = DateTime.Now; userModel.PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord { NoEncryptPassword = Utils.InputText(txtPass.Value) }; userModel.SuperviseDepartId = Utils.GetInt(Utils.GetFormValue(selMdepart.UniqueID)); userModel.UserName = Utils.InputText(txtUserName.Value); if (empId != 0 && method2 != "copy")//修改 { userModel.ID = empId; result = userBll.Update(userModel); } else { result = userBll.Add(userModel);//添加 } if (!result) { showMess = "数据保存失败!"; } //继续添加则刷新页面,否则关闭当前窗口 if (method == "continue") { MessageBox.ShowAndRedirect(this, showMess, "EmployeeEdit.aspx"); } else { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.location='/systemset/organize/DepartEmployee.aspx';window.parent.Boxy.getIframeDialog('{1}').hide()", showMess, Utils.GetQueryStringValue("iframeId"))); } #endregion } }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_组织机构_部门设置栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_组织机构_部门设置栏目, false); return; } int departId = Utils.GetInt(Utils.GetQueryStringValue("departId")); //报价Id string method = Utils.GetFormValue("hidMethod"); //获取当前操作(保存/继续) string method2 = Utils.GetQueryStringValue("method2"); //判断是否为新增或修改 string showMess = "数据保存成功!"; //提示消息 EyouSoft.Model.CompanyStructure.Department departModel = null; EyouSoft.BLL.CompanyStructure.Department departBll = new EyouSoft.BLL.CompanyStructure.Department(); //初始化bll EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(SiteUserInfo); //初始化bll IList <EyouSoft.Model.CompanyStructure.Department> departList = departBll.GetAllDept(CurrentUserCompanyID); IList <EyouSoft.Model.CompanyStructure.CompanyUser> userlist = userBll.GetCompanyUser(CurrentUserCompanyID); //绑定部门列表 if (departList != null && departList.Count > 0) { selParentDE.DataTextField = "DepartName"; selParentDE.DataValueField = "Id"; selParentDE.DataSource = departList; selParentDE.DataBind(); } //绑定员工列表 if (userlist != null && userlist.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyUser user in userlist) { selDepEmp.Items.Add(new ListItem(user.PersonInfo.ContactName, user.ID.ToString())); } } selParentDE.Items.Insert(0, new ListItem("请选择", "")); //上级部门 selDepEmp.Items.Insert(0, new ListItem("请选择", "")); //部门主管 //无操作方式则为获取数据 if (method == "") { #region 初始化数据 if (departId != 0) { departModel = departBll.GetModel(departId); if (method2 == "update")//修改 { if (departModel != null) { txtDepName.Value = departModel.DepartName; //部门名称 selDepEmp.Value = departModel.DepartManger.ToString(); //部门主管 selParentDE.Value = departModel.PrevDepartId.ToString(); // 上级部门 parentD = departModel.PrevDepartId.ToString(); txtTel.Value = departModel.ContactTel; //联系电话 txtRemark.Value = departModel.Remark; //备注 txtFax.Value = departModel.ContactFax; //传真 if (!string.IsNullOrEmpty(departModel.PageHeadFile)) { hidHeader.Value = departModel.PageHeadFile; } if (!string.IsNullOrEmpty(departModel.PageFootFile)) { hidFooter.Value = departModel.PageFootFile; } if (!string.IsNullOrEmpty(departModel.TemplateFile)) { hidModel.Value = departModel.TemplateFile; } if (!string.IsNullOrEmpty(departModel.DepartStamp)) { hidSeat.Value = departModel.DepartStamp; } pageHeader = !string.IsNullOrEmpty(departModel.PageHeadFile) ? string.Format("<a href='{0}' target='_blank'>查看</a> <a href='javascript:;' onclick=\"return De.del('{1}',this);\"><img src='/images/fujian_x.gif'/></a>", departModel.PageHeadFile, hidHeader.ClientID) : "暂无页眉"; pageFooter = !string.IsNullOrEmpty(departModel.PageFootFile) ? string.Format("<a href='{0}' target='_blank'>查看</a> <a href='javascript:;' onclick=\"return De.del('{1}',this);\"><img src='/images/fujian_x.gif'/></a>", departModel.PageFootFile, hidFooter.ClientID) : "暂无页脚"; pageModel = !string.IsNullOrEmpty(departModel.TemplateFile) ? string.Format("<a href='{0}' target='_blank'>查看</a> <a href='javascript:;' onclick=\"return De.del('{1}',this);\"><img src='/images/fujian_x.gif'/></a>", departModel.TemplateFile, hidModel.ClientID) : "暂无模板"; departSeal = !string.IsNullOrEmpty(departModel.DepartStamp) ? string.Format("<a href='{0}' target='_blank'>查看</a> <a href='javascript:;' onclick=\"return De.del('{1}',this);\"><img src='/images/fujian_x.gif'/></a>", departModel.DepartStamp, hidSeat.ClientID) : "暂无公章"; if (parentD == "0") { selParentDE.Attributes.Remove("valid"); } } } else { if (departModel != null) { selParentDE.Value = departModel.Id.ToString();//如果是添加操作则将部门ID设置上级部门 } } return; } #endregion } else { #region 保存操作 bool result = true; departModel = new EyouSoft.Model.CompanyStructure.Department(); string fileName = string.Empty; string oldName = string.Empty; HttpPostedFile fHeader = Request.Files["fileHeader"]; HttpPostedFile fFooter = Request.Files["fileFooter"]; HttpPostedFile fSeal = Request.Files["fileSeal"]; HttpPostedFile fModel = Request.Files["fileModel"]; if (fHeader != null && !string.IsNullOrEmpty(fHeader.FileName)) { result = UploadFile.FileUpLoad(fHeader, "systemset", out fileName, out oldName);//上传页眉 departModel.PageHeadFile = fileName; } else { departModel.PageHeadFile = hidHeader.Value; } if (result && (fFooter != null && !string.IsNullOrEmpty(fFooter.FileName))) { result = UploadFile.FileUpLoad(fFooter, "systemset", out fileName, out oldName);//上传页脚 departModel.PageFootFile = fileName; } else { departModel.PageFootFile = hidFooter.Value; } if (result && (fModel != null && !string.IsNullOrEmpty(fModel.FileName))) { result = UploadFile.FileUpLoad(fModel, "systemset", out fileName, out oldName);//上传模板 departModel.TemplateFile = fileName; } else { departModel.TemplateFile = hidModel.Value; } if (result && (fSeal != null && !string.IsNullOrEmpty(fSeal.FileName))) { result = UploadFile.FileUpLoad(fSeal, "systemset", out fileName, out oldName);//上传公章 departModel.DepartStamp = fileName; } else { departModel.DepartStamp = hidSeat.Value; } if (result) { departModel.CompanyId = CurrentUserCompanyID; //公司ID departModel.ContactFax = Utils.InputText(txtFax.Value); //传真 departModel.ContactTel = Utils.InputText(txtTel.Value); //电话 departModel.DepartName = Utils.InputText(txtDepName.Value); //部门名称 departModel.Remark = Utils.InputText(txtRemark.Value); //备注 departModel.IssueTime = DateTime.Now; //添加时间 departModel.OperatorId = SiteUserInfo.ID; //操作人 departModel.PrevDepartId = Utils.GetInt(Utils.GetFormValue(selParentDE.UniqueID)); //上级部门 departModel.DepartManger = Utils.GetInt(Utils.GetFormValue(selDepEmp.UniqueID)); //部门主管 //if (departModel.DepartManger == 0) //{ // MessageBox.Show(this, "请填写完整数据!"); // return; //} if (departId != 0) { if (method2 == "update") { departModel.Id = departId; result = departBll.Update(departModel);//修改部门 } else { result = departBll.Add(departModel);//添加部门 } } else { result = departBll.Add(departModel);//添加部门 } } if (!result) { showMess = "数据保存失败!"; } StringBuilder messBuilder = new StringBuilder(); //如果是修改则回调父窗口的修改方法,否则回调新增方法 if (method2 == "update") { messBuilder.AppendFormat(";window.parent.DM.callbackUpdateD('{0}','{1}','{3}');alert('{2}');", departId, Utils.InputText(txtDepName.Value), showMess, departModel.PrevDepartId.ToString() != Utils.GetFormValue("hidParentDE")); } else { messBuilder.AppendFormat(";window.parent.DM.callbackAddD('{0}');alert('{1}');", departId, showMess); } //如果是保存继续则刷新页面,否则关闭弹窗 if (method == "continue") { messBuilder.AppendFormat("window.location='/systemset/organize/DepartEdit.aspx?method2=add&departId={0}", departId); } else { messBuilder.AppendFormat("window.parent.Boxy.getIframeDialog('{0}').hide();", Utils.GetQueryStringValue("iframeId")); } MessageBox.ResponseScript(this, messBuilder.ToString()); return; #endregion } }
protected int itemIndex;//序号 protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_系统日志_系统日志栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_系统日志_系统日志栏目, true); return; } pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); itemIndex = (pageIndex - 1) * pageSize + 1; EyouSoft.BLL.CompanyStructure.SysHandleLogs logBll = new EyouSoft.BLL.CompanyStructure.SysHandleLogs();//日志bll //获取查询条件 string operatorId = Utils.GetQueryStringValue("operator"); string startDate = Utils.GetQueryStringValue("startDate"); string endDate = Utils.GetQueryStringValue("endDate"); string departId = Utils.GetQueryStringValue("departId"); EyouSoft.BLL.CompanyStructure.Department departBll = new EyouSoft.BLL.CompanyStructure.Department();//部门bll //绑定部门列表 IList <EyouSoft.Model.CompanyStructure.Department> departList = departBll.GetAllDept(CurrentUserCompanyID); if (departList != null && departList.Count > 0) { selDeaprt.DataTextField = "DepartName"; selDeaprt.DataValueField = "Id"; selDeaprt.DataSource = departList; selDeaprt.DataBind(); } selDeaprt.Items.Insert(0, new ListItem("请选择", "0")); //绑定操作员列表 EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(SiteUserInfo);//初始化bll IList <EyouSoft.Model.CompanyStructure.CompanyUser> userlist = userBll.GetCompanyUser(CurrentUserCompanyID); if (userlist != null && userlist.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyUser user in userlist) { selOperator.Items.Add(new ListItem(user.PersonInfo.ContactName, user.ID.ToString())); } } selOperator.Items.Insert(0, new ListItem("请选择", "0")); //日志查询试实体 EyouSoft.Model.CompanyStructure.QueryHandleLog queryLog = new EyouSoft.Model.CompanyStructure.QueryHandleLog(); queryLog.CompanyId = CurrentUserCompanyID; //公司编号 queryLog.DepartId = Utils.GetInt(departId); //部门编号 queryLog.HandEndTime = Utils.GetDateTimeNullable(endDate); //操作结束时间 queryLog.HandStartTime = Utils.GetDateTimeNullable(startDate); //操作开始时间 queryLog.OperatorId = Utils.GetInt(operatorId); //操作员 //绑定日志列表 IList <EyouSoft.Model.CompanyStructure.SysHandleLogs> list = logBll.GetList(pageSize, pageIndex, ref recordCount, queryLog); if (list != null && list.Count > 0) { rptLog.DataSource = list; rptLog.DataBind(); BindExportPage(); } else { rptLog.EmptyText = "<tr><td colspan='10' align='center'>对不起,暂无日志信息!</td></tr>"; ExportPageInfo1.Visible = false; } //恢复查询关键字 txtEndDate.Value = endDate; //操作结束时间 selOperator.Value = operatorId; //操作员 txtStartDate.Value = startDate; //操作开始时间 selDeaprt.Value = departId; //部门编号 }