protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["EditIsEnterpriseSubmit"] != 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())); zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); DataTable dt01 = generalEnterpriseBLL.GetList("UserGuid='" + Request.QueryString["ID"] + "'").Tables[0]; zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt01.Rows[0]["EnterpriseID"].ToString())); coreUserModel.UserName = Request.Form["txbUserName"];//账号 coreUserModel.Password = Request.Form["txbPassword"];//密码 coreUserModel.UserMobileNO = Request.Form["txbUserMobileNO"];//手机号 coreUserModel.UserRegisterDate = DateTime.Parse(ViewState["UserRegisterDate"].ToString());//用户注册日期 coreUserModel.UserLastDateTime = DateTime.Parse(ViewState["UserLastDateTime"].ToString());//用户最后一次登录日期 coreUserModel.UserType = 2;//企业用户 coreUserModel.UserStatus = 1;//状态可用 coreUserModel.UserID = int.Parse(dt.Rows[0]["UserID"].ToString());//CoerUser表ID generalEnterpriseModel.EnterpriseID = int.Parse(dt01.Rows[0]["EnterpriseID"].ToString());//企业表ID generalEnterpriseModel.CompanyName = txbEnterpriseName.Text;//企业名称 //generalEnterpriseModel.IndustryKey = Request.Form["drpJobFeildKindsType"] + "-" + Request.Form["drpItems"];//公司行业 generalEnterpriseModel.IndustryKey = Get_CurrentValue(Request.Params["txbJobFeildKinds"]) + "-" + Request.Params["txbJobFeildKinds"]; generalEnterpriseModel.PrincipleAddress = Request.Form["txbPrincipleAddress"];//公司地址 generalEnterpriseModel.Telephone = Request.Form["txbTelephone"];//联系电话 generalEnterpriseModel.ContactPerson = Request.Form["txbContactPerson"];//联系人 generalEnterpriseModel.Email = Request.Form["txbEmail"];//电子邮件 generalEnterpriseModel.EnterpriseWWW = Request.Form["txbEnterpriseWWW"];//公司网站 generalEnterpriseModel.BusRoute = Request.Form["txbBusRoute"];//乘车路线 generalEnterpriseModel.CanUsable = 1; generalEnterpriseModel.LastUpdateDate = DateTime.Now;//最后一次修改日期 generalEnterpriseModel.CreateDate = DateTime.Parse(ViewState["CreateDate"].ToString());//创建日期 generalEnterpriseModel.ShengName = Request.Form["drpShengList"];//省名称 generalEnterpriseModel.ShiName = Request.Form["drpShiList"];//市名称 generalEnterpriseModel.QuName = Request.Form["drpQuList"];//区名称 generalEnterpriseModel.EnterpriseDescription = Request.Form["txbEnterpriseDescription"];//企业简介 if (uploadBusinessLicense.HasFile) { string strFileExt = System.IO.Path.GetExtension(uploadBusinessLicense.FileName); if (strFileExt == ".jpg" || strFileExt == ".gif" || strFileExt == ".png" || strFileExt == ".jpeg" || strFileExt == ".bmp") { string strFilePath = "~/BusinessLicense/" + txbEnterpriseName.Text + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + strFileExt; uploadBusinessLicense.SaveAs(Server.MapPath(strFilePath)); generalEnterpriseModel.BusinessLicense = strFilePath; } } try { coreUserBLL.Update(coreUserModel); generalEnterpriseBLL.Update(generalEnterpriseModel); if (Session["EditIsEnterpriseSubmit"] == null) { FineUI.Alert.Show("修改信息注册成功"); Session["EditIsEnterpriseSubmit"] = "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 imgBtnDownload_Click(object sender, ImageClickEventArgs e) { string strEnterpriseGUID = Get_EnterpriaseGUID(Request.Cookies["CurrentUserGUID"].Value); zlzw.Model.ResumeCollectionListModel resumeCollectionListModel = new zlzw.Model.ResumeCollectionListModel(); resumeCollectionListModel.ResumeCollectionType = 0;//类型为企业简历收藏 resumeCollectionListModel.ResumeGuid = new Guid(Request.QueryString["id"]);//当前简历GUID resumeCollectionListModel.EnterpriseGuid = new Guid(strEnterpriseGUID);//收藏企业的GUID resumeCollectionListModel.EnterpriseIsDel = 1;//企业标注为可显示 resumeCollectionListModel.IsEnable = 1; resumeCollectionListModel.PublishDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); #region 减去可下载简历数 zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); System.Data.DataTable dt = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strEnterpriseGUID + "'").Tables[0]; zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt.Rows[0]["EnterpriseID"].ToString())); if (generalEnterpriseModel.DownloadResume < 1) { FineUI.Alert.Show("您剩余的简历下载数不足,请联系我们的客服人员"); return; } generalEnterpriseModel.DownloadResume = generalEnterpriseModel.DownloadResume - 1; generalEnterpriseModel.CreateDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); zlzw.BLL.ResumeCollectionListBLL resumeCollectionListBLL = new zlzw.BLL.ResumeCollectionListBLL(); resumeCollectionListBLL.Add(resumeCollectionListModel); generalEnterpriseBLL.Update(generalEnterpriseModel); FineUI.Alert.Show("简历下载成功"); #endregion }
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.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); DataTable dt = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strSelectID + "'").Tables[0]; zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt.Rows[0]["EnterpriseID"].ToString())); generalEnterpriseModel.CanUsable = 0; generalEnterpriseBLL.Update(generalEnterpriseModel); GeneralEnterpriseList_BindGrid(); #endregion } else { return; } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = new zlzw.Model.GeneralEnterpriseModel(); generalEnterpriseModel.CompanyName = txbCompanyName.Text;//企业名称 generalEnterpriseModel.IndustryKey = drpIndustryKey.SelectedValue;//所属行业 generalEnterpriseModel.ShengCode = ddlSheng.SelectedValue;//企业所在省代码 generalEnterpriseModel.ShiCode = ddlShi.SelectedValue;//企业所在市代码 generalEnterpriseModel.QuCode = ddlXian.SelectedValue;//企业所在区代码 generalEnterpriseModel.PrincipleAddress = txbPrincipleAddress.Text;//企业所在地址 generalEnterpriseModel.Telephone = txbTelephone.Text;//联系电话 generalEnterpriseModel.TelephoneOther = txbTelephoneOther.Text;//其他联系电话 generalEnterpriseModel.Fax = txbFax.Text;//传真 generalEnterpriseModel.Email = txbEmail.Text;//电子邮件 generalEnterpriseModel.ContactPerson = txbContactPerson.Text;//联系人 generalEnterpriseModel.EnterpriseWWW = txbEnterpriseWWW.Text;//企业网址 generalEnterpriseModel.BusRoute = txbBusRoute.Text;//乘车路线 generalEnterpriseModel.EnterpriseDescription = txbEnterpriseDescription.Text;//企业简介 generalEnterpriseModel.CanUsable = 1; if (ckbIsEmergencyRecruitment.Checked) { generalEnterpriseModel.IsEmergencyRecruitment = 1; } else { generalEnterpriseModel.IsEmergencyRecruitment = 0; } //是否允许职位发布 if (ckbIsEnablePublishJob.Checked) { generalEnterpriseModel.IsEnablePublishJob = 1; } else { generalEnterpriseModel.IsEnablePublishJob = 0; } generalEnterpriseModel.DownloadResume = int.Parse(txbDownloadResume.Text);//允许下载陌生简历数量 generalEnterpriseModel.CreateDate = DateTime.Parse(ViewState["CreateDate"].ToString()); zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); generalEnterpriseModel.EnterpriseID = int.Parse(Get_ID(generalEnterpriseBLL, Request.QueryString["value"])); if (fileBusinessLicense.PostedFile.ContentLength > 0) { fileBusinessLicense.SaveAs(Server.MapPath(ViewState["fileBusinessLicense"].ToString())); generalEnterpriseModel.BusinessLicense = ViewState["fileBusinessLicense"].ToString(); } else { generalEnterpriseModel.BusinessLicense = ViewState["fileBusinessLicense"].ToString(); } generalEnterpriseModel.UserGuid = new Guid(ViewState["UserGuid"].ToString()); generalEnterpriseModel.EnterpriseGuid = new Guid(ViewState["EnterpriseGuid"].ToString()); generalEnterpriseBLL.Update(generalEnterpriseModel); } else { //添加保存 zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = new zlzw.Model.GeneralEnterpriseModel(); generalEnterpriseModel.CompanyName = txbCompanyName.Text;//企业名称 generalEnterpriseModel.IndustryKey = drpIndustryKey.SelectedValue;//所属行业 generalEnterpriseModel.ShengCode = ddlSheng.SelectedValue;//企业所在省代码 generalEnterpriseModel.ShiCode = ddlShi.SelectedValue;//企业所在市代码 generalEnterpriseModel.QuCode = ddlXian.SelectedValue;//企业所在区代码 generalEnterpriseModel.PrincipleAddress = txbPrincipleAddress.Text;//企业所在地址 generalEnterpriseModel.Telephone = txbTelephone.Text;//联系电话 generalEnterpriseModel.TelephoneOther = txbTelephoneOther.Text;//其他联系电话 generalEnterpriseModel.Fax = txbFax.Text;//传真 generalEnterpriseModel.Email = txbEmail.Text;//电子邮件 generalEnterpriseModel.ContactPerson = txbContactPerson.Text;//联系人 generalEnterpriseModel.EnterpriseWWW = txbEnterpriseWWW.Text;//企业网址 generalEnterpriseModel.BusRoute = txbBusRoute.Text;//乘车路线 generalEnterpriseModel.EnterpriseDescription = txbEnterpriseDescription.Text;//企业简介 generalEnterpriseModel.CreateDate = DateTime.Now;//企业系统创建日期 generalEnterpriseModel.CanUsable = 1;//可用 generalEnterpriseModel.UserGuid = new Guid(Request.Cookies["UserID"].Value); if (ckbIsEmergencyRecruitment.Checked) { generalEnterpriseModel.IsEmergencyRecruitment = 1; } else { generalEnterpriseModel.IsEmergencyRecruitment = 0; } //是否允许职位发布 //是否允许职位发布 if (ckbIsEnablePublishJob.Checked) { generalEnterpriseModel.IsEnablePublishJob = 1; } else { generalEnterpriseModel.IsEnablePublishJob = 0; } generalEnterpriseModel.DownloadResume = int.Parse(txbDownloadResume.Text);//允许下载陌生简历数量 generalEnterpriseModel.UserGuid = new Guid(Request.Cookies["UserID"].Value); if (fileBusinessLicense.PostedFile.ContentLength > 0) { string fileName = DateTime.Now.Ticks.ToString() + "_" + fileBusinessLicense.FileName; fileBusinessLicense.SaveAs(Server.MapPath("~/UploadImages/" + fileName)); generalEnterpriseModel.BusinessLicense = "~/UploadImages/" + fileName;//保存营业执照图片路径 } zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); generalEnterpriseBLL.Add(generalEnterpriseModel); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }