protected void btnSubmit_Click(object sender, EventArgs e) { if(Request.QueryString["ID"] == null) { Response.Redirect("default.aspx"); } if (Session["IsUpdateSubmit"] != null) { return; } zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL(); DataTable dt = coreUserBLL.GetList("UserGuid='" + Request.QueryString["ID"] + "'").Tables[0]; zlzw.Model.CoreUserModel coreUserModel = coreUserBLL.GetModel(int.Parse(dt.Rows[0]["UserID"].ToString())); coreUserModel.UserGuid = new Guid(Request.QueryString["ID"]); coreUserModel.UserID = int.Parse(dt.Rows[0]["UserID"].ToString()); coreUserModel.UserName = Request.Params["txbUserName"]; //txbUserName.Text;//用户名 coreUserModel.Password = Request.Params["txbPassword"];//用户密码 coreUserModel.UserNameCN = Request.Params["txbUserNameCN"];//用户姓名 coreUserModel.UserSex = int.Parse(Request.Form["drpUserSex"]);//用户性别 coreUserModel.UserEducationalBackground = int.Parse(Request.Form["drpUserEducationalBackground"]);//用户学历 coreUserModel.UserBirthDay = DateTime.Parse(Request.Params["txbUserBirthDay"]);//出生日期 coreUserModel.UserMobileNO = Request.Params["txbUserMobileNO"];//联系电话 coreUserModel.UserCountry = Request.Params["txbUserCountry"];//户口原籍 coreUserModel.CurrentResidence = Request.Params["txbCurrentResidence"];//当前居住地 coreUserModel.UserEmail = Request.Params["txbUserEmail"];//用户电子信箱 coreUserModel.MaritalStatus = int.Parse(Request.Form["drpMaritalStatus"]);//婚姻状态 coreUserModel.UserHeight = Decimal.Parse(Request.Params["txbUserHeight"]);//身高 coreUserModel.UserWeight = Decimal.Parse(Request.Params["txbUserWeight"]);//体重 coreUserModel.UserRegisterDate = DateTime.Parse(ViewState["UserRegisterDate"].ToString());//用户注册日期 coreUserModel.UserLastDateTime = DateTime.Now;//用户最后一次登录日期 coreUserModel.UserType = 1;//普通用户 coreUserModel.UserStatus = 1;//状态可用 if (uploadUserPhoto.HasFile) { string strFileExt = System.IO.Path.GetExtension(uploadUserPhoto.FileName); if (strFileExt == ".jpg" || strFileExt == ".gif" || strFileExt == ".png" || strFileExt == ".jpeg" || strFileExt == ".bmp") { string strFilePath = "~/UserPhotos/" + txbUserName.Text + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + strFileExt; uploadUserPhoto.SaveAs(Server.MapPath(strFilePath)); coreUserModel.UserPhoto = strFilePath; } } else { coreUserModel.UserPhoto = ViewState["UserPhoto"].ToString(); } zlzw.BLL.JobPersonResumeBLL jobPersonResumeBLL = new zlzw.BLL.JobPersonResumeBLL(); DataTable dt01 = jobPersonResumeBLL.GetList("OwnerUserKey='" + Request.QueryString["ID"] + "'").Tables[0]; zlzw.Model.JobPersonResumeModel jobPersonResumeModel = jobPersonResumeBLL.GetModel(int.Parse(dt01.Rows[0]["ResumeID"].ToString())); jobPersonResumeModel.ResumeID = int.Parse(dt01.Rows[0]["ResumeID"].ToString()); jobPersonResumeModel.OwnerUserKey = Request.QueryString["ID"]; //jobPersonResumeModel.JobPositionKinds = drpJobPositionKindsType.SelectedValue + "-" + Request.Form["drpJobPositionKinds"];//职位类别 //jobPersonResumeModel.JobFeildKinds = drpJobFeildKindsType.SelectedValue + "-" + Request.Form["drpJobFeildKinds"];//期望行业 jobPersonResumeModel.JobPositionKinds = Get_CurrentValue(Request.Params["txbJobPositionKinds"]) + "-" + Request.Params["txbJobPositionKinds"]; jobPersonResumeModel.JobFeildKinds = Get_CurrentValue(Request.Params["txbJobFeildKinds"]) + "-" + Request.Params["txbJobFeildKinds"]; jobPersonResumeModel.HopeJob = Request.Params["txbHopeJob"];//意向职位 jobPersonResumeModel.JobWorkPlaceNames = Request.Params["txbJobWorkPlaceNames"];//期望地址 jobPersonResumeModel.HopeRoomAndBoard = int.Parse(Request.Form["drpHopeRoomAndBoard"]);//期望食宿 jobPersonResumeModel.JobSalary = int.Parse(Request.Form["drpJobSalary"]);//期望薪资 jobPersonResumeModel.PersonalSkills = Request.Params["txbPersonalSkills"];//个人技能 jobPersonResumeModel.SkillsCertificate = Request.Params["txbSkillsCertificate"];//技能证书 jobPersonResumeModel.JobCurrentWorkStatus = int.Parse(Request.Form["drpJobCurrentWorkStatus"]);//当前状态 jobPersonResumeModel.CurrentSalary = Request.Form["drpCurrentSalary"];//当前薪资 jobPersonResumeModel.JobWorkType = int.Parse(Request.Form["drpJobWorkType"]);//工作性质 jobPersonResumeModel.WorkExperience = Request.Params["txbWorkExperience"];//工作经历 jobPersonResumeModel.EducationExperience = Request.Params["txbEducationExperience"];//教育经历 jobPersonResumeModel.CreateDate = DateTime.Parse(ViewState["CreateDate"].ToString());//创建日期 jobPersonResumeModel.UpdateDate = DateTime.Now;//简历更新时间 jobPersonResumeModel.CanUsable = 1;//状态可用 jobPersonResumeModel.ResumeStatus = 1;//状态可用 jobPersonResumeModel.UserAge = int.Parse(Get_CurrentUserAge(Request.Form["txbUserBirthDay"]));//用户年龄 jobPersonResumeModel.UserSex = Get_UserSex(Request.Form["drpUserSex"]);//用户性别 try { coreUserBLL.Update(coreUserModel); jobPersonResumeBLL.Update(jobPersonResumeModel); txbUserName.Text = ""; txbPassword.Text = ""; txbUserNameCN.Text = ""; txbUserMobileNO.Text = ""; txbUserCountry.Text = ""; txbCurrentResidence.Text = ""; txbUserEmail.Text = ""; txbHopeJob.Text = ""; txbJobWorkPlaceNames.Text = ""; txbPersonalSkills.Text = ""; txbSkillsCertificate.Text = ""; txbWorkExperience.Text = ""; txbEducationExperience.Text = ""; if (Session["IsUpdateSubmit"] == null) { FineUI.Alert.Show("简历更新成功"); Session["IsUpdateSubmit"] = "1"; } System.Web.HttpCookie UserGUID = System.Web.HttpContext.Current.Request.Cookies["CurrentUserGUID"]; System.Web.HttpCookie UserName = System.Web.HttpContext.Current.Request.Cookies["CurrentUserName"]; UserGUID.Expires = DateTime.Now.AddDays(-1); UserName.Expires = DateTime.Now.AddDays(-1); System.Web.HttpContext.Current.Response.Cookies.Add(UserGUID); System.Web.HttpContext.Current.Response.Cookies.Add(UserName); Response.Redirect("default.aspx"); } catch (Exception exp) { FineUI.Alert.Show("简历更新失败,请稍后重试"); } }
protected void btnDel_Click(object sender, EventArgs e) { if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0) { string strSelectID = "0"; for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++) { int rowIndex = grid1.SelectedRowIndexArray[i]; foreach (object key in grid1.DataKeys[rowIndex]) { strSelectID = key.ToString(); } } #region 删除逻辑 zlzw.BLL.JobPersonResumeBLL jobPersonResumeBLL = new zlzw.BLL.JobPersonResumeBLL(); DataTable dt = jobPersonResumeBLL.GetList("ResumeGuid='" + strSelectID + "'").Tables[0]; zlzw.Model.JobPersonResumeModel jobPersonResumeModel = jobPersonResumeBLL.GetModel(int.Parse(dt.Rows[0]["ResumeID"].ToString())); jobPersonResumeModel.CanUsable = 0; jobPersonResumeBLL.Update(jobPersonResumeModel); JobPersonResumeList_BindGrid(); #endregion } else { return; } }