/// <summary> /// ajax检查档案编号是否存在 /// </summary> protected void CheckFileNum() { String str = String.Empty; String num = Request.QueryString["num"]; String id = Request.QueryString["id"]; if (!String.IsNullOrEmpty(num.Trim())) { BArchives BLL = new BArchives(); if (String.IsNullOrEmpty(id)) {//新增时 if (BLL.ExistsFileNumber(num, "", this.SiteUserInfo.CompanyId)) { str = "1"; } } else { //编辑时 MGovFile Model = BLL.GetArchivesModel(id); if (null != Model && !String.Equals(num, Model.FileNumber)) { if (BLL.ExistsFileNumber(num, "", this.SiteUserInfo.CompanyId)) { str = "1"; } } } } Response.Clear(); Response.Write(str); Response.End(); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="id">操作ID</param> protected void PageInit(string id) { #region 用户控件初始化 this.SingleFileUpload1.CompanyID = this.SiteUserInfo.CompanyId; this.SingleFileUpload2.CompanyID = this.SiteUserInfo.CompanyId; //性别 this.selSex.DataSource = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.GovStructure.Gender)); this.selSex.DataValueField = "Value"; this.selSex.DataTextField = "Text"; this.selSex.DataBind(); //员工类型 this.selType.DataSource = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.GovStructure.StaffType)); this.selType.DataValueField = "Value"; this.selType.DataTextField = "Text"; this.selType.DataBind(); //员工状态 this.selState.DataSource = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.GovStructure.StaffStatus)); this.selState.DataValueField = "Value"; this.selState.DataTextField = "Text"; this.selState.DataBind(); #endregion #region 临时变量 string sex = string.Empty; //性别 string type = string.Empty; //类型 string state = string.Empty; //员工状态 string packState = string.Empty; //合同状态 #endregion //编辑初始化 if (!string.IsNullOrEmpty(id)) { BArchives BLL = new BArchives(); MGovFile Model = BLL.GetArchivesModel(id); if (null == Model) { return; } #region 表单赋值 //主键id this.hdKeyid.Value = Model.ID; this.hdUserid.Value = Model.UserId.Trim(); this.hidGuid.Value = Model.GuideId.Trim(); //档案编号 this.tbNum.Text = Model.FileNumber; //姓名 this.tbName.Text = Model.Name; //性别 sex = Convert.ToString((int)Model.Sex); //类型 type = Convert.ToString((int)Model.StaffType); //状态 state = Convert.ToString((int)Model.StaffStatus); //身份证 this.tbIdcard.Text = Model.IDNumber; //出生日期 this.tbBirthDay.Text = string.Format("{0:yyyy-MM-dd}", Model.BirthDate); //入职时间 this.tbIntime.Text = string.Format("{0:yyyy-MM-dd}", Model.EntryTime); //工龄 this.tbWorkyear.Text = Convert.ToString(Model.LengthService); //婚姻状态 this.selWed.SelectedIndex = this.selWed.Items.IndexOf(this.selWed.Items.FindByValue(Model.IsMarriage ? "1" : "0")); //民族 this.tbNation.Text = Model.Nation; //籍贯 this.tbOrigin.Text = Model.Birthplace; //政治面貌 this.tbGovface.Text = Model.PoliticalFace; //联系电话 this.tbTelnum.Text = Model.Contact; //电话短号 this.tbShortel.Text = Model.ContactShort; //手机 this.tbPhonenum.Text = Model.Mobile; //手机短号 this.tbShortphone.Text = Model.MobileShort; //QQ this.tbQnum.Text = Model.qq; //Email this.tbEmail.Text = Model.Email; //msn this.tbMsn.Text = Model.Msn; //住址 this.tbAddress.Text = Model.Address; //基本资料备注 this.tbRemark.Text = Model.Remarks; //用户名 this.tbUsername.Text = Model.UserName; //密码 //this.tbUserpwd.Attributes.Add("value", Model.Password.Trim()); //重复密码 //this.tbrepeatpwd.Attributes.Add("value", Model.Password.Trim()); this.selSex.SelectedValue = sex; this.selType.SelectedValue = type; this.selState.SelectedValue = state; //部门 this.SelectSection1.SectionID = Model.DepartId.ToString(); this.SelectSection1.SectionName = Model.DepartName; //职务 this.SelectDuty1.DutyID = GetDutyInfo(Model.GovFilePositionList, 1); this.SelectDuty1.DutyName = GetDutyInfo(Model.GovFilePositionList, 2); if (!string.IsNullOrEmpty(Model.UserId.Trim())) { this.rbSetSysID.SelectedValue = "1"; } if (!string.IsNullOrEmpty(Model.GuideId.Trim())) { this.rbGuid.SelectedValue = "1"; } if (!string.IsNullOrEmpty(Model.StaffPhoto)) { //照片 this.lbPhoto.Text = string.Format("<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\" id=\"hideFileInfo_photo\" name=\"hideFileInfo_photo\" value=\"{0}\"/></span>", Model.StaffPhoto); } StringBuilder strFile = new StringBuilder(); IList <EyouSoft.Model.ComStructure.MComAttach> fileLst = Model.ComAttachList; if (null != fileLst && fileLst.Count > 0) { for (int i = 0; i < fileLst.Count; i++) { strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</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=\"hideFileInfo\" value='{1}|{0}'/></span>", fileLst[i].FilePath, fileLst[i].Name); } } this.lbFiles.Text = strFile.ToString();//附件 //家庭信息 if (Model.GovFilehomeList != null && Model.GovFilehomeList.Count > 0) { this.rpt_homelist.DataSource = Model.GovFilehomeList; this.rpt_homelist.DataBind(); this.ph_homelistUpdate.Visible = true; this.ph_homelistAdd.Visible = false; } else { this.ph_homelistUpdate.Visible = false; this.ph_homelistAdd.Visible = true; } //学历信息 if (Model.GovFileEducationList != null && Model.GovFileEducationList.Count > 0) { this.rpt_schoollist.DataSource = Model.GovFileEducationList; this.rpt_schoollist.DataBind(); this.ph_schoollistUpdate.Visible = true; this.ph_schoollistAdd.Visible = false; } else { this.ph_schoollistUpdate.Visible = false; this.ph_schoollistAdd.Visible = true; } //履历信息 if (Model.GovFileCurriculumList != null && Model.GovFileCurriculumList.Count > 0) { this.rpt_worllist.DataSource = Model.GovFileCurriculumList; this.rpt_worllist.DataBind(); this.ph_worklistUpdate.Visible = true; this.ph_worklistAdd.Visible = false; } else { this.ph_worklistUpdate.Visible = false; this.ph_worklistAdd.Visible = true; } //劳动合同 if (Model.GovFileContractList != null && Model.GovFileContractList.Count > 0) { this.rpt_contract.DataSource = Model.GovFileContractList; this.rpt_contract.DataBind(); this.ph_contractUpdate.Visible = true; this.ph_contractAdd.Visible = false; } else { this.ph_contractUpdate.Visible = false; this.ph_contractAdd.Visible = true; } #endregion /*if (!this.SiteUserInfo.IsHandleElse && this.SiteUserInfo.UserId != Model.OperatorId) * { * this.ph_Save.Visible = false; * }*/ } else { this.ph_homelistUpdate.Visible = false; this.ph_homelistAdd.Visible = true; this.ph_schoollistUpdate.Visible = false; this.ph_schoollistAdd.Visible = true; this.ph_worklistUpdate.Visible = false; this.ph_worklistAdd.Visible = true; this.ph_contractUpdate.Visible = false; this.ph_contractAdd.Visible = true; } }