Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        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);
        }