Beispiel #1
0
        public ActionResult EnterpriseInfo()
        {
            ViewBag.MenuGroup         = "Info";
            ViewBag.PageTitle         = "企业信息";
            ViewBag.CurrentEnterprise = BLLEnterprise.Current;

            Templates Template = BLLTemplate.GetTemplate(BLLEnterprise.Current.TemplateID);

            ViewBag.Template = Template;

            return(View());
        }
Beispiel #2
0
        public ActionResult TemplateAdd(string templateName, string templateFile)
        {
            ViewBag.MenuGroup = "TL";
            ViewBag.MenuTitle = "企业模板";

            if (templateName != null && templateFile != null)
            {
                templateFile = templateFile.Replace(".css", "");
                BLLTemplate.AddTemplate(templateName, templateFile);
                return(Redirect("TemplateList"));
            }

            return(View());
        }
Beispiel #3
0
        public ActionResult TemplateList(int?page)
        {
            ViewBag.MenuGroup = "TL";
            ViewBag.MenuTitle = "企业模板";

            List <Templates> list = BLLTemplate.GetTemplateList();

            if (page == null)
            {
                page = 1;
            }

            ViewBag.CurrentMEnterprise = BLLMEnterprise.GetMEnterprise();

            ViewBag.TotalPage   = list.Count();
            ViewBag.CurrentPage = page.Value;
            int pageSize = 10;

            list = list.OrderBy(m => m.TemplateID).Skip((page.Value - 1) * pageSize).Take(pageSize).ToList();

            return(View(list));
        }
Beispiel #4
0
        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());
        }