/// <summary> /// 获取部门 /// </summary> /// <param name="DepartmentID">部门ID</param> protected string GetDepartmentById(int DepartmentID, string companyid) { //返回信息 string result = ""; //实例化部门业务层 BComDepartment BLL = new BComDepartment(); MComDepartment model = BLL.GetModel(DepartmentID, companyid); if (model != null) { result = model.DepartName; } return(result); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id, string doType) { #region 用户控件初始化 this.HrSelect1.ParentIframeID = Utils.GetQueryStringValue("iframeId"); this.HrSelect1.SetTitle = "部门主管"; this.uc_Head.CompanyID = this.SiteUserInfo.CompanyId; this.uc_Foot.CompanyID = this.SiteUserInfo.CompanyId; this.uc_Temp.CompanyID = this.SiteUserInfo.CompanyId; this.uc_Seal.CompanyID = this.SiteUserInfo.CompanyId; #endregion BComDepartment BLL = new BComDepartment(); //根据编辑传过来的编号获取部门信息实体 MComDepartment Model = BLL.GetModel(Utils.GetInt(id), this.SiteUserInfo.CompanyId); if (doType == "update") { if (null != Model) { //部门名称 this.txtDepartName.Text = Model.DepartName; //部门编号 this.hidDepartId.Value = Model.DepartId.ToString(); //联系电话 this.txtContact.Text = Model.Contact; //传真 this.txtFaxa.Text = Model.Fax; //备注 this.txtRemark.Text = Model.Remarks; string strDel = "<span class='upload_filename'><a href='{0}' target='_blank'>查看</a><a href=\"javascript:void(0)\" onclick=\"PageJsData.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hide_{1}\" value=\"{0}\"/></span>"; if (!string.IsNullOrEmpty(Model.PrintHeader)) { //页眉 this.lbTxtHead.Text = string.Format(strDel, Model.PrintHeader, "head"); } if (!string.IsNullOrEmpty(Model.PrintFooter)) { //页脚 this.lbTxtFoot.Text = string.Format(strDel, Model.PrintFooter, "foot"); } if (!string.IsNullOrEmpty(Model.PrintTemplates)) { //模板 this.lbTxtTemp.Text = string.Format(strDel, Model.PrintTemplates, "temp"); } if (!string.IsNullOrEmpty(Model.Seal)) { //公章 this.lbTxtSeal.Text = string.Format(strDel, Model.Seal, "seal"); } //部门主管编号 this.HrSelect1.HrSelectID = Model.DepartHead; //this.HrSelect1.HrSelectName = Model.DepartHead; MComDepartment ModelPart = BLL.GetModel(Model.PrevDepartId, Model.CompanyId); if (ModelPart != null) { //上级部门名称和编号 this.txtUpSection.Text = ModelPart.DepartName; this.hidupsectionId.Value = ModelPart.DepartId.ToString(); } else { this.txtUpSection.Text = "股东会"; } //通过部门主管编号获取人事档案信息实体 EyouSoft.BLL.GovStructure.BArchives BLLManager = new EyouSoft.BLL.GovStructure.BArchives(); EyouSoft.Model.GovStructure.MGovFile ModelManager; ModelManager = BLLManager.GetArchivesModel(Model.DepartHead); if (ModelManager != null) { this.HrSelect1.HrSelectName = ModelManager.Name; this.HrSelect1.HrSelectID = ModelManager.ID; } } else { this.txtUpSection.Text = "股东会"; } } else { if (Model != null) { this.txtUpSection.Text = Model.DepartName; this.hidupsectionId.Value = Model.DepartId.ToString(); } else { this.txtUpSection.Text = "股东会"; this.hidupsectionId.Value = "0"; } } }