/// <summary> /// 导出 /// </summary> void ToXls() { string browser = this.Context.Request.UserAgent.ToUpper(); int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } int recordCount = 0; StringBuilder s = new StringBuilder(); EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); var data = BLL.GetSearchArchivesList(Utils.GetQueryStringValue("txtName"), Utils.GetQueryStringValue(this.SelectSection1.SelectIDClient), Utils.GetQueryStringValue(this.SelectSection1.SelectNameClient), this.SiteUserInfo.CompanyId, toXlsRecordCount, 1, ref recordCount); if (data != null && data.Count > 0) { s.AppendFormat("<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/><table border='1' style='border-collapse:collapse;'><tr><th width='105'>档案编号</th><th width='105'>姓名</th><th width='107'>部门</th><th width='168'>职务</th><th width='168'>电话</th><th width='158'>手机</th><th width='164'>QQ</th>"); foreach (var item in data) { s.AppendFormat("<tr><td align='center'>{0}</td><td align='center'>{1}</td><td align='center'>{2}</td><td align='center'>{3}</td><td align='center'>{4}</td><td align='center'>{5}</td><td align='center'>{6}</td></tr>", item.FileNumber, item.Name, item.DepartName, getSectionInfo(item.GovFilePositionList), item.Contact, item.Mobile, item.qq); } s.AppendFormat("</table>"); } string fileName = "内部通讯录"; if (browser.Contains("MS") && browser.Contains("IE")) { fileName = System.Web.HttpUtility.UrlEncode(fileName, Encoding.UTF8); } ResponseToXls(s.ToString(), Encoding.UTF8, fileName); }
/// <summary> /// 获得人事档案信息 /// </summary> /// <param name="GovId"></param> /// <returns></returns> public string GetGovFileInfo(string GovId) { if (!string.IsNullOrEmpty(GovId)) { var model = new EyouSoft.BLL.GovStructure.BArchives().GetArchivesModel(GovId); return(Newtonsoft.Json.JsonConvert.SerializeObject(model)); } return(""); }
/// <summary> /// 初始化 /// </summary> private void DataInit() { string name = Utils.GetQueryStringValue("userName"); bool isshow = Utils.GetQueryStringValue("isShow").ToLower() == "true"; pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); string sModel = Utils.GetQueryStringValue("sModel"); EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); EyouSoft.Model.GovStructure.MSearchGovFile model = new EyouSoft.Model.GovStructure.MSearchGovFile(); model.Name = name; if (!isshow) { model.IsAccount = isshow; } if (sModel != "2") { this.ph_checkbox.Visible = false; } model.NoLeft = true; IList <EyouSoft.Model.GovStructure.MGovFile> lst = BLL.GetSearchArchivesList(model, this.SiteUserInfo.CompanyId, pageSize, pageIndex, ref recordCount); if (null != lst && lst.Count > 0) { this.RepList.DataSource = lst; this.RepList.DataBind(); listCount = lst.Count; BindPage(); } else { this.RepList.Controls.Add(new Label() { Text = "<li style='text-align:center;'>对不起,没有相关数据!</li>" }); this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 初始化 /// </summary> private void DataInit() { //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); string sectionName = Utils.GetQueryStringValue(this.SelectSection1.SelectNameClient); string sectionID = Utils.GetQueryStringValue(this.SelectSection1.SelectIDClient); this.SelectSection1.SectionName = sectionName; this.SelectSection1.SectionID = sectionID; string txtName = Utils.GetQueryStringValue("txtName");//姓名 EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); IList <EyouSoft.Model.GovStructure.MGovFile> lst = BLL.GetSearchArchivesList(txtName, sectionID, sectionName, this.SiteUserInfo.CompanyId, this.pageSize, this.pageIndex, ref this.recordCount); if (null != lst && lst.Count > 0) { this.RepList.DataSource = lst; this.RepList.DataBind(); if (recordCount <= pageSize) { this.ExporPageInfoSelect1.Visible = false; this.ExporPageInfoSelect1.intRecordCount = recordCount; } else { BindPage(); } } else { this.RepList.Controls.Add(new Label() { Text = "<tr><td colspan='8' align='center'>对不起,没有相关数据!</td></tr>" }); this.ExporPageInfoSelect1.Visible = false; } }
/// <summary> /// 初始化 /// </summary> private void DataInit(string id) { EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); EyouSoft.Model.GovStructure.MGovFile Model = BLL.GetArchivesModel(id); if (null == Model) { return; } /*1.基本信息*/ this.lbName.Text = Model.Name; //头部姓名 this.lbName_.Text = Model.Name; //姓名 this.lbNum.Text = Model.FileNumber; //档案编号 this.lbSex.Text = Convert.ToString(Model.Sex); //性别 if (!string.IsNullOrEmpty(Model.StaffPhoto)) { this.lbImg.Text = String.Format("<img src='{0}' width='100' heigth='150'/>", Model.StaffPhoto);//照片 } else { this.lbImg.Text = " 暂无照片"; } this.lbIDCard.Text = Model.IDNumber; //身份证号 this.lbBirth.Text = string.Format("{0:yyyy-MM-dd}", Model.BirthDate); //出生年月 //部门 this.lbSection.Text = Model.DepartName; //职务信息 IList <MGovFilePosition> postionLst = Model.GovFilePositionList; if (null != postionLst && postionLst.Count > 0) { StringBuilder strPositionName = new StringBuilder(); StringBuilder strPositionId = new StringBuilder(); foreach (MGovFilePosition m in postionLst) { strPositionName.Append(m.Title + ","); } this.lbDuty.Text = strPositionName.Length > 0 ? strPositionName.ToString().Substring(0, strPositionName.Length - 1) : ""; //职务名 } this.lbType.Text = Convert.ToString(Model.StaffType); //类型 this.lbState.Text = Convert.ToString(Model.StaffStatus); //员工状态 this.lbJoinTime.Text = string.Format("{0:yyyy-MM-dd}", Model.EntryTime); //入职时间 this.lbWorkAge.Text = Convert.ToString(Model.LengthService); //工龄 this.lbNation.Text = Model.Nation; //民族 this.lbNativePlace.Text = Model.Birthplace; //籍贯 this.lbFace.Text = Model.PoliticalFace; //政治面貌 this.lbWedState.Text = Model.IsMarriage ? "已婚" : "未婚"; //婚姻状态 this.lbTel.Text = Model.Contact; //电话 this.lbMobile.Text = Model.Mobile; //手机 if (Model.StaffStatus == EyouSoft.Model.EnumType.GovStructure.StaffStatus.离职) { EyouSoft.BLL.GovStructure.BGovFilePersonnel leaveBLL = new EyouSoft.BLL.GovStructure.BGovFilePersonnel(); EyouSoft.Model.GovStructure.MGovFilePersonnel leaveModel = leaveBLL.GetGovFilePersonnelModelByFileId(id); if (null != leaveModel) { this.lbLeave.Text = String.Format("离职时间:{0:yyyy-MM-dd}", leaveModel.DepartureTime); } } this.lbQQ.Text = Model.qq; //qq this.lbMsn.Text = Model.Msn; //msn this.lbEmail.Text = Model.Email; //email this.lbPlace.Text = Model.Address; //住 址 this.lbRemark.Text = Model.Remarks; //备注 /*2.家庭关系*/ IList <MGovFilehome> homeLst = Model.GovFilehomeList; if (null != homeLst && homeLst.Count > 0) { this.RepRation.DataSource = homeLst; this.RepRation.DataBind(); } else { this.RepRation.Controls.Add(new Label() { Text = "<tr><td colspan='5' align='center'>暂无相关数据!</td></tr>" }); } /*3.学历信息*/ IList <MGovFileEducation> schoolLst = Model.GovFileEducationList; if (null != schoolLst && schoolLst.Count > 0) { this.RepSchool.DataSource = schoolLst; this.RepSchool.DataBind(); } else { this.RepSchool.Controls.Add(new Label() { Text = "<tr><td colspan='7' align='center'>暂无相关数据!</td></tr>" }); } /*4.履历信息*/ IList <MGovFileCurriculum> workLst = Model.GovFileCurriculumList; if (null != workLst && workLst.Count > 0) { this.RepWork.DataSource = workLst; this.RepWork.DataBind(); } else { this.RepWork.Controls.Add(new Label() { Text = "<tr><td colspan='6' align='center'>暂无相关数据!</td></tr>" }); } /*5.劳动合同*/ IList <MGovFileContract> packLst = Model.GovFileContractList; if (null != packLst && packLst.Count > 0) { this.rpt_Contact.DataSource = packLst; this.rpt_Contact.DataBind(); } else { this.rpt_Contact.Controls.Add(new Label() { Text = "<tr><td colspan='6' align='center'>暂无相关数据!</td></tr>" }); } }
/// <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"; } } }
/// <summary> /// 初始化 /// </summary> private void DataInit() { #region 查询参数 //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); //档案编号 string txtNum = Utils.GetQueryStringValue("txtNum"); //姓名 string txtName = Utils.GetQueryStringValue("txtName"); //性别 int selSex = Utils.GetInt(Utils.GetQueryStringValue("selSex"), -1); //出生日期 DateTime?txtSBirth = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtSBirth")); DateTime?txtEBirth = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEBirth")); //工龄 string txtWorkYear = Utils.GetQueryStringValue("txtWorkYear"); //职务 int txtDutyId = Utils.GetInt(Utils.GetQueryStringValue(this.SelectDuty1.DutyIDClient)); this.SelectDuty1.DutyID = txtDutyId.ToString(); //职务名 string txtDutyName = Utils.GetQueryStringValue(this.SelectDuty1.DutyNameClient); this.SelectDuty1.DutyName = txtDutyName; //类型 int selType = Utils.GetInt(Utils.GetQueryStringValue("selType"), -1); //员工状态 int selState = Utils.GetInt(Utils.GetQueryStringValue("selState"), -1); //婚姻状态 int selWedState = Utils.GetInt(Utils.GetQueryStringValue("selWedState"), -1); #endregion EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); //查询实体 EyouSoft.Model.GovStructure.MSearchGovFile searchModel = new EyouSoft.Model.GovStructure.MSearchGovFile(); searchModel.BirthDateBegin = txtSBirth; searchModel.BirthDateEnd = txtEBirth; searchModel.FileNumber = txtNum; if (selWedState != -1) { searchModel.IsMarriage = selWedState == 1 ? true : false; } searchModel.LengthService = Utils.GetIntNull(txtWorkYear); searchModel.Name = txtName; searchModel.PositionId = txtDutyId; searchModel.Position = txtDutyName; searchModel.Sex = (EyouSoft.Model.EnumType.GovStructure.Gender)selSex; searchModel.StaffStatus = (EyouSoft.Model.EnumType.GovStructure.StaffStatus)selState; searchModel.StaffType = (EyouSoft.Model.EnumType.GovStructure.StaffType)selType; searchModel.DangAnId = Utils.GetQueryStringValue("danganid"); string depts = txtDept.SectionID = Utils.GetQueryStringValue(txtDept.SelectIDClient); txtDept.SectionName = Utils.GetQueryStringValue(txtDept.SelectNameClient); searchModel.DeptIds = Utils.GetIntArray(depts, ","); IList <EyouSoft.Model.GovStructure.MGovFile> lst = BLL.GetSearchArchivesList(searchModel, this.SiteUserInfo.CompanyId, this.pageSize, this.pageIndex, ref this.recordCount); if (null != lst && lst.Count > 0) { this.RepList.DataSource = lst; this.RepList.DataBind(); } else { this.RepList.Controls.Add(new Label() { Text = "<tr><td colspan='15' align='center'>对不起,没有相关数据!</td></tr>" }); } BindPage(); }
/// <summary> /// 工龄同步 /// </summary> void GongLingTongBu() { var bllRetCode = new EyouSoft.BLL.GovStructure.BArchives().GongLingTongBu(CurrentUserCompanyID); RCWE(UtilsCommons.AjaxReturnJson("1", "工龄同步成功")); }
void ToXls() { int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } StringBuilder s = new StringBuilder(); #region 查询参数 //获取分页参数并强转 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); //档案编号 string txtNum = Utils.GetQueryStringValue("txtNum"); //姓名 string txtName = Utils.GetQueryStringValue("txtName"); //性别 int selSex = Utils.GetInt(Utils.GetQueryStringValue("selSex"), -1); //出生日期 DateTime?txtSBirth = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtSBirth")); DateTime?txtEBirth = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEBirth")); //工龄 int txtWorkYear = Utils.GetInt(Utils.GetQueryStringValue("txtWorkYear")); //职务 int txtDuty = Utils.GetInt(Utils.GetQueryStringValue("DutyHideID")); //类型 int selType = Utils.GetInt(Utils.GetQueryStringValue("selType"), -1); //员工状态 int selState = Utils.GetInt(Utils.GetQueryStringValue("selState"), -1); //婚姻状态 int selWedState = Utils.GetInt(Utils.GetQueryStringValue("selWedState"), -1); #endregion EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); //查询实体 EyouSoft.Model.GovStructure.MSearchGovFile searchModel = new EyouSoft.Model.GovStructure.MSearchGovFile(); searchModel.BirthDateBegin = txtSBirth; searchModel.BirthDateEnd = txtEBirth; searchModel.FileNumber = txtNum; if (selWedState != -1) { searchModel.IsMarriage = selWedState == 1 ? true : false; } searchModel.LengthService = Utils.GetIntNull(Utils.GetQueryStringValue("txtWorkYear")); searchModel.Name = txtName; searchModel.PositionId = txtDuty; searchModel.Sex = (EyouSoft.Model.EnumType.GovStructure.Gender)selSex; searchModel.StaffStatus = (EyouSoft.Model.EnumType.GovStructure.StaffStatus)selState; searchModel.StaffType = (EyouSoft.Model.EnumType.GovStructure.StaffType)selType; IList <EyouSoft.Model.GovStructure.MGovFile> lst = BLL.GetSearchArchivesList(searchModel, this.SiteUserInfo.CompanyId, toXlsRecordCount, 1, ref this.recordCount); if (lst != null && lst.Count > 0) { s.AppendFormat("<table><tr><th align='center' class='th-line'>档案编号</th><th align='center' class='th-line'>姓名</th><th align='center' class='th-line'>性别</th><th align='center' class='th-line'>出生日期</th><th align='center' class='th-line'>所属部门</th><th align='center' class='th-line'>职务</th><th align='center' class='th-line'>工龄</th><th align='center' class='th-line'>联系电话</th><th align='center' class='th-line'>手机</th><th align='center' class='th-line'>QQ</th><th align='center' class='th-line'>学历</th><th align='center' class='th-line'>合同是否签订</th><th align='center' class='th-line'>合同到期时间</th></tr>"); foreach (var item in lst) { s.AppendFormat("<tr><td align='center'>{0}</td><td align='center'>{1}</td><td align='center'>{2}</td><td align='center'>{3}</td><td align='center'>{4}</td><td align='center'>{5}</td><td align='center'>{6}</td><td align='center'>{7}</td><td align='center'>{8}</td><td align='center'>{9}</td><td align='center'>{10}</td><td align='center'>{11}</td><td align='center'>{12}</td></tr>", item.FileNumber, item.Name, item.Sex.ToString(), item.BirthDate.HasValue ? item.BirthDate.Value.ToString("yyyy-MM-dd") : "", item.DepartName, GetMoreInfo(item.GovFilePositionList, "position"), item.LengthService, item.Contact, item.Mobile, item.qq, item.Education, item.IsSignContract ? "是" : "否", item.MaturityTime.HasValue ? item.MaturityTime.Value.ToString("yyyy-MM-dd") : ""); } s.AppendFormat("</table>"); } string browser = this.Context.Request.UserAgent.ToUpper(); string fileName = "人事档案"; if (browser.Contains("MS") && browser.Contains("IE")) { fileName = System.Web.HttpUtility.UrlEncode(fileName, Encoding.UTF8); } ResponseToXls(s.ToString(), Encoding.UTF8, fileName); }
/// <summary> /// 删除操作 /// </summary> private void DeleteData() { /*string msg = String.Empty; * int b = 0; * if (!String.IsNullOrEmpty(id)) * { * EyouSoft.BLL.GovStructure.BArchives BLL = new EyouSoft.BLL.GovStructure.BArchives(); * b = BLL.DeleteArchives(id.Split(',')); * } * switch (b) * { * case 0: * msg = "删除成功";//成功 * break; * case 1: * msg = "已经分配用户,不能删除!"; * break; * case -1: * msg = "删除失败!"; * break; * default: * msg = "删除失败!"; * break; * } * //返回ajax操作结果 * Response.Clear(); * Response.Write(UtilsCommons.AjaxReturnJson(b.ToString(), msg)); * Response.End();*/ if (!CheckGrant(EyouSoft.Model.EnumType.PrivsStructure.Privs.行政中心_人事档案_删除)) { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:没有操作权限!")); } string s = Utils.GetQueryStringValue("id"); if (string.IsNullOrEmpty(s)) { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:未选择任何要删除的档案信息!")); } int bllRetCode = new EyouSoft.BLL.GovStructure.BArchives().DeleteArchives(SiteUserInfo.CompanyId, s); if (bllRetCode == 1) { RCWE(UtilsCommons.AjaxReturnJson("1", "操作成功:人事档案信息已成功删除!")); } else if (bllRetCode == -99) { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:人事档案信息不存在或已删除!")); } else if (bllRetCode == -98) { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:同步到用户信息的人事档案不能删除!")); } else if (bllRetCode == -97) { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:同步到导游信息的人事档案不能删除!")); } else { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败:未知异常,ERROR CODE:" + bllRetCode)); } }