protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["IsEnterpriseSubmit"] != null) { return; } zlzw.Model.CoreUserModel coreUserModel = new zlzw.Model.CoreUserModel(); coreUserModel.UserGuid = Guid.NewGuid(); coreUserModel.UserName = Request.Form["txbUserName"];//账号 coreUserModel.Password = Request.Form["txbPassword"];//密码 coreUserModel.UserMobileNO = Request.Form["txbUserMobileNO"];//手机号 coreUserModel.UserRegisterDate = DateTime.Now;//用户注册日期 coreUserModel.UserLastDateTime = DateTime.Now;//用户最后一次登录日期 coreUserModel.UserType = 2;//企业用户 coreUserModel.UserStatus = 1;//状态可用 zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = new zlzw.Model.GeneralEnterpriseModel(); generalEnterpriseModel.UserGuid = new Guid(coreUserModel.UserGuid.ToString());//所属账号的GUID generalEnterpriseModel.CompanyName = Request.Form["txbEnterpriseName"];//企业名称 //generalEnterpriseModel.IndustryKey = drpJobFeildKindsType.SelectedValue + "-" + Request.Params["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.CreateDate = DateTime.Now;//创建日期 //添加所在省市区信息 generalEnterpriseModel.ShengName = Request.Form["drpShengList"];//省名称 generalEnterpriseModel.ShiName = Request.Form["drpShiList"];//市名称 generalEnterpriseModel.QuName = Request.Form["drpQuList"];//区名称 generalEnterpriseModel.EnterpriseDescription = Request.Form["txbEnterpriseDescription"];//企业简介 ////设置企业基本数据 //generalEnterpriseModel.Expand_PublishJobCount = 0;//企业已发布的职位数 //generalEnterpriseModel.Expand_MainResumeCount = 0;//企业已查看主投简历数 //generalEnterpriseModel.Expand_SearchStrangeResumeCount = 0;//企业已搜索陌生简历数 //generalEnterpriseModel.Expand_DownloadStrangeResumeCount = 0;//企业已下载陌生简历数量 //generalEnterpriseModel.Expand_Balance = 0;//企业充值金额 generalEnterpriseModel.IsEmergencyRecruitment = 0;//默认不允许企业发布紧急招聘 generalEnterpriseModel.DownloadResume = 0;//默认下载陌生简历次数为0 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 { zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL(); coreUserBLL.Add(coreUserModel); zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL(); generalEnterpriseBLL.Add(generalEnterpriseModel); if (Session["IsEnterpriseSubmit"] == null) { FineUI.Alert.Show("用户注册成功"); Session["IsEnterpriseSubmit"] = "1"; } HttpCookie userGUID = new HttpCookie("CurrentUserGUID", coreUserModel.UserGuid.ToString()); HttpCookie uerName = new HttpCookie("CurrentUserName", coreUserModel.UserName); userGUID.Expires = DateTime.Now.AddDays(1); uerName.Expires = DateTime.Now.AddDays(1); System.Web.HttpContext.Current.Response.Cookies.Add(userGUID); System.Web.HttpContext.Current.Response.Cookies.Add(uerName); Response.Redirect("default.aspx"); } catch (Exception exp) { FineUI.Alert.Show("用户注册失败,请稍后重试"); } }
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()); }