public ActionResult CheckEmailIsAvailable(string email) { Regex reg = new Regex(@"^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})"); bool available = true; if (!reg.IsMatch(email)) { available = false; } else if (BLLEnterprise.GetEnterpriseByEmailOnly(email) != null) { available = false; } if (available) { Response.Write("Yes"); } else { Response.Write("No"); } Response.Flush(); Response.End(); return(null); }
public ActionResult DeleteEnterprise(int id) { ViewBag.MenuGroup = "EI"; ViewBag.MenuTitle = "企业列表"; BLLEnterprise.DeleteEnterprise(id); return(Redirect("Index")); }
public ActionResult Register(string enterpriseName, string enterpriseEmail, string password, string enterpriseAddress, string enterpriseTel) { if (!string.IsNullOrEmpty(enterpriseName) && !string.IsNullOrEmpty(enterpriseEmail) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(enterpriseAddress) && !string.IsNullOrEmpty(enterpriseTel) && BLLEnterprise.GetEnterpriseByEmailOnly(enterpriseEmail) == null) { bool isSuccess = BLLEnterprise.RegisterEnterprise(enterpriseName, enterpriseEmail, password, enterpriseAddress, enterpriseTel); if (isSuccess) { //发送邮件,等待审核 EmailHelper.SendMail(enterpriseEmail, "企业信息管理系统激活", "请激活"); Response.Write("Success"); Response.Flush(); Response.End(); } else { Response.Write("Fail"); } } return(View()); }
// // GET: /Home/ public ActionResult Index(int?pageindex) { ViewBag.MenuGroup = "EI"; if (!BLLMEnterpriseAdmin.IsLogin()) { return(Redirect("~/AdminAccount/Login")); } ViewBag.MenuTitle = "企业列表"; PageHelper page = new PageHelper(); if (!pageindex.HasValue) { pageindex = 1; } page.TotalCount = BLLEnterprise.GetEnterprise().Count; page.PageNext = pageindex.Value + 1; page.PageCurrent = pageindex.Value; page.PagePre = pageindex.Value - 1; ViewBag.Page = page; List <Enterprise> EnterpriseList = BLLEnterprise.GetEnterpriseList(page.PageCurrent - 1, page.PageSize); return(View(EnterpriseList)); }
// // GET: /Enterprise/ public ActionResult Index(string name) { Enterprise entreprise = BLLEnterprise.GetEnterprise(name); if (null != entreprise) { ViewBag.Enterprise = entreprise; } else { return(Redirect("~/Enterprise/" + name + "/NotExists")); } ViewBag.EPmenu = "EPI"; ViewBag.title = name == null ? "多企业用户管理系统" : name; List <EnterpriseCases> EnterpriseCaseList = BLLEnterpriseCases.GetEnterpriseCasesList(entreprise.EnterpriseID, 0, 50); ViewBag.EnterpriseCaseList = EnterpriseCaseList; List <EnterpriseDynamic> EnterpriseDynamicList = BLLEnterpriseDynamic.EnterpriseDynamic(entreprise.EnterpriseID, 0, 50); ViewBag.EnterpriseDynamicList = EnterpriseDynamicList; return(View()); }
// // GET: /Home/ public ActionResult Index() { ViewBag.Menu = "IX"; List <MEnterpriseCases> MElist = BLLMEnterpriseCases.GetMEnterpriseCases(); ViewBag.MEnterprseList = MElist; List <Enterprise> Elist = BLLEnterprise.GetEnterprise(); ViewBag.EnterprseList = Elist; return(View()); }
// // GET: /Account/ public ActionResult Login(string useremail, string userpwd, bool?rememberme) { if (string.IsNullOrEmpty(useremail) && string.IsNullOrEmpty(userpwd)) { return(View()); } //服务端开始验证数据 if (string.IsNullOrWhiteSpace(useremail)) { ViewBag.emailError = "请输入您的邮箱"; } else { Regex reg = new Regex(@"^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})"); if (!reg.IsMatch(useremail)) { ViewBag.emailError = "请输入正确的邮箱地址"; } //检查是否存在这个用户 Enterprise existEnterprise = BLLEnterprise.ExistEnterprise(useremail); if (existEnterprise == null) { ViewBag.emailError = "该邮箱地址不存在"; } } if (string.IsNullOrWhiteSpace(userpwd)) { ViewBag.pwdError = "请输入您的密码"; } if (!string.IsNullOrEmpty(ViewBag.emailError) || !string.IsNullOrEmpty(ViewBag.pwdError)) { return(View()); } //检查用户输入是否正确 Enterprise _enterprise = BLLEnterprise.IsLogin(useremail, userpwd); string loginError = string.Empty; if (_enterprise == null) { loginError = "邮箱密码错误"; } else if (!_enterprise.EnterpriseActive.HasValue || !_enterprise.EnterpriseActive.Value) { loginError = "您的账户未激活,请联系网站内部人员"; } if (!string.IsNullOrEmpty(loginError)) { return(View()); } return(Redirect("~/Home/Index")); }
public ActionResult ChangePassword(string oldpassword, string password, string repassword) { ViewBag.MenuGroup = "Password"; ViewBag.PageTitle = "修改密码"; if (oldpassword == BLLEnterprise.Current.EnterprisePassword) { if (password == repassword && BLLEnterprise.ChangePassword(BLLEnterprise.Current.EnterpriseID, password)) { Response.Write("Success"); Response.Flush(); Response.End(); } } return(View()); }
public ActionResult EPBrief(string name) { Enterprise entreprise = BLLEnterprise.GetEnterprise(name); if (null != entreprise) { ViewBag.Enterprise = entreprise; } else { return(Redirect("~/Enterprise/" + name + "/NotExists")); } ViewBag.EPmenu = "EPB"; ViewBag.title = name == null ? "多企业用户管理系统" : name; return(View()); }
public ActionResult EnterpriseDetail(int id, string pass) { ViewBag.MenuGroup = "EI"; ViewBag.MenuTitle = "企业详情"; if (id <= 0) { return(null); } if (!string.IsNullOrEmpty(pass)) { BLLEnterprise.SetEnterpriseStatus(id, pass == "是" ? true : false); ViewBag.result = "success"; } Enterprise enterprise = BLLEnterprise.GetBgEnterprise(id); return(View(enterprise)); }
protected void Application_BeginRequest(Object sender, EventArgs e) { bool isEnterpriseBg = false; if (Request.Url.ToString().IndexOf("http://" + Request.Url.Host + ":" + Request.Url.Port + "/EnterpriseBg") > -1) { isEnterpriseBg = true; } if (Request.Url.ToString().IndexOf("http://" + Request.Url.Host + "/EnterpriseBg") > -1) { isEnterpriseBg = true; } if (!BLLEnterprise.IsLogin() && isEnterpriseBg) { Response.Redirect("~/Home"); } }
public ActionResult EPDynamic(string name, int?enterpriseDynamicID, int?currentPage) { Enterprise entreprise = BLLEnterprise.GetEnterprise(name); if (null != entreprise) { ViewBag.Enterprise = entreprise; } else { return(Redirect("~/Enterprise/" + name + "/NotExists")); } ViewBag.EPmenu = "EPD"; ViewBag.title = name == null ? "多企业用户管理系统" : name; if (enterpriseDynamicID != null) { EnterpriseDynamic dynamic = BLLEnterpriseDynamic.EnterpriseDynamicByEnterpriseDynamicID(enterpriseDynamicID.Value); if (dynamic.Enterprise.EnterpriseID == entreprise.EnterpriseID) { ViewBag.EnterpriseDynamic = dynamic; } return(View("/Views/Enterprise/EPDynamicDetail.aspx")); } int page = 1; if (currentPage != null) { page = currentPage.Value; } List <EnterpriseDynamic> dynamicList = BLLEnterpriseDynamic.EnterpriseDynamics(entreprise.EnterpriseID); ViewBag.CurrentPage = page; ViewBag.TotalPage = dynamicList.Count() / 9 + (dynamicList.Count() % 9 == 0 ? 0 : 1); List <EnterpriseDynamic> list = BLLEnterpriseDynamic.EnterpriseDynamic(entreprise.EnterpriseID, page - 1, 9); return(View(list)); }
public ActionResult EnterpriseBrief(string action, string brief) { if (!BLLEnterprise.IsLogin()) { return(Redirect("~/Home")); } ViewBag.MenuGroup = "Info"; ViewBag.PageTitle = "企业简介"; if (action == "Save") { brief = (brief == null ? "" : brief); BLLEnterprise.SetEnterpriseBrief(BLLEnterprise.Current.EnterpriseID, brief); } ViewBag.CurrentEnterprise = BLLEnterprise.Current; return(View()); }
public string AddEnterpriseInfo(int id) { Enterprise enterprise = BLLEnterprise.GetEnterprise(id); StringBuilder builder = new StringBuilder(); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业名称</td><td class='tdContent'>" + enterprise.EnterpriseName ?? "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业电话</td><td class='tdContent'>" + enterprise.EnterpriseTelphoneNumber ?? "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业邮箱</td><td class='tdContent'>" + enterprise.EnterpriseEmail ?? "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业地址</td><td class='tdContent'>" + enterprise.EnterpriseAddress ?? "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>版权声明</td><td class='tdContent'>" + enterprise.EnterpriseRight ?? "" + "</td></tr>"); //builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>注册时间</td><td class='tdContent'>" + enterprise.EnterpriseRegistTime.HasValue ? enterprise.EnterpriseRegistTime.Value.ToString("yyyy-MM-dd") : "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业说明</td><td class='tdContent'>" + enterprise.EnterpriseBriefShort ?? "" + "</td></tr>"); builder.Append("<tr class='enterpriseinfo'><td style='width: 100px;'>企业简介</td><td class='tdContent contentBriefHtmlToTxt' id='contentBriefHtmlToTxt'>" + enterprise.EnterpriseBrief ?? "" + "</td></tr>"); builder.Append("<tr style=\"display:none;\"><td></td><td><input type='hidden' name='ename' id='ename' value='" + enterprise.EnterpriseName + "' />"); builder.Append("<input type='hidden' name='eshort' id='eshort' value='" + enterprise.EnterpriseBriefShort + "' />"); builder.Append("<input type='hidden' name='eurl' id='eurl' value='" + enterprise.EnterpriseUrl + "' /></td></tr>"); //builder.Append("<input type='hidden' name='imgurl' value='" + BLLEnterprise.ServerDns + enterprise. + "' />"); return(builder.ToString()); }
public ActionResult EnterpriseInfoEdit(string enterpriseName, string enterpriseUrl, int?templateID, string enterpriseAddress, string enterpriseTelphoneNumber, string enterpriseEmail, string EnterpriseBriefShort, string enterpriseLogo_f) { ViewBag.MenuGroup = "Info"; ViewBag.PageTitle = "编辑企业信息"; bool validData = true; validData = validData && (!string.IsNullOrEmpty(enterpriseName) && new Regex(@"^([\w]|[\u4E00-\u9FA5]){2,20}$").IsMatch(enterpriseName)); validData = validData && (!string.IsNullOrEmpty(enterpriseEmail) && new Regex(@"^(([\w-\s]+)|([\w-]+(?:\.[\w-]+)*)|([\w-\s]+)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)", RegexOptions.IgnoreCase).IsMatch(enterpriseEmail)); validData = validData && (!string.IsNullOrEmpty(enterpriseTelphoneNumber) && new Regex(@"^\+?(\d[\d\-\+\(\) ]{5,}\d$)").IsMatch(enterpriseTelphoneNumber)); validData = validData && (!string.IsNullOrEmpty(enterpriseAddress)); if (validData) { if (templateID == null) { templateID = 0; } if (BLLEnterprise.SaveEnterpriseInfoChanges(BLLEnterprise.Current.EnterpriseID, enterpriseName, enterpriseUrl, templateID.Value, enterpriseAddress, enterpriseTelphoneNumber, enterpriseEmail, EnterpriseBriefShort, enterpriseLogo_f)) { return(Redirect("~/EnterpriseBg/EnterpriseInfo")); } } if (!BLLEnterprise.IsLogin()) { return(Redirect("~/Home")); } ViewBag.CurrentEnterprise = BLLEnterprise.Current; List <Templates> TemplatesList = BLLTemplate.GetTemplateList(); ViewBag.TemplatesList = TemplatesList; return(View()); }
public ActionResult Logout() { BLLEnterprise.Logout(); return(Redirect("~/Home/Index")); }