/// <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> 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() { #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(); }
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); }