Esempio n. 1
0
 public ActionResult Create(PageManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _pageServices.SavePageManageModel(model);
         if (response.Success)
         {
             var pageId = (int)response.Data;
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = pageId });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.Parents = _pageTemplateServices.GetPossibleParents();
     model.Positions = EnumUtilities.GetSelectListFromEnum<PageEnums.PositionEnums>();
     model.RelativePages = _pageServices.GetRelativePages(model.Id, model.ParentId);
     model.StatusList = _pageServices.GetStatus();
     model.PageTemplates = _pageTemplateServices.GetPageTemplateSelectList(model.PageTemplateId);
     return View(model);
 }
Esempio n. 2
0
        public ActionResult Create(PageManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _pageServices.SavePageManageModel(model);
                if (response.Success)
                {
                    var pageId = (int)response.Data;
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = pageId }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.Parents       = _pageTemplateServices.GetPossibleParents();
            model.Positions     = EnumUtilities.GetSelectListFromEnum <PageEnums.PositionEnums>();
            model.RelativePages = _pageServices.GetRelativePages(model.Id, model.ParentId);
            model.StatusList    = _pageServices.GetStatus();
            model.PageTemplates = _pageTemplateServices.GetPageTemplateSelectList(model.PageTemplateId);
            return(View(model));
        }
Esempio n. 3
0
 public ActionResult Edit(EmailAccountManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _emailAccountServices.SaveEmailAccount(model);
         if (response.Success)
         {
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = model.Id });
             }
         }
         SetErrorMessage(response.Message);
     }
     return View(model);
 }
 public ActionResult EditSettings(GroupManageSettingModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _rotatingImageGroupServices.SaveGroupSettings(model);
         if (response.Success)
         {
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("EditSettings", new { id = model.Id });
             }
         }
         SetErrorMessage(response.Message);
     }
     return View(model);
 }
Esempio n. 5
0
 public ActionResult Edit(ServiceManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _serviceServices.SaveServiceManageModel(model);
         if (response.Success)
         {
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = model.Id });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.StatusList = _serviceServices.GetStatus();
     return View(model);
 }
Esempio n. 6
0
        public ActionResult Edit(TemplateManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _templateServices.SaveTemplateManageModel(model);
                if (response.Success)
                {
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = model.Id }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            return(View(model));
        }
Esempio n. 7
0
 public ActionResult Edit(ClientMenuManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _clientMenuServices.SaveClientMenuManageModel(model);
         if (response.Success)
         {
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = model.Id });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.Parents = _clientMenuServices.GetPossibleParents();
     return View(model);
 }
Esempio n. 8
0
 public ActionResult Edit(SiteSettingManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _settingServices.SaveSettingManageModel(model, Request.Form);
         if (response.Success)
         {
             var templateId = model.Id;
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = templateId });
             }
         }
         SetErrorMessage(response.Message);
     }
     return View(model);
 }
Esempio n. 9
0
 public ActionResult Create(TemplateManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _templateServices.SaveTemplateManageModel(model);
         if (response.Success)
         {
             var templateId = (int)response.Data;
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = templateId });
             }
         }
         SetErrorMessage(response.Message);
     }
     return View(model);
 }
        public ActionResult EditSettings(GroupManageSettingModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _rotatingImageGroupServices.SaveGroupSettings(model);
                if (response.Success)
                {
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("EditSettings", new { id = model.Id }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            return(View(model));
        }
Esempio n. 11
0
 public ActionResult Create(RotatingImageManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _rotatingImageServices.SaveRotatingImage(model);
         if (response.Success)
         {
             var rotatingImageId = (int)response.Data;
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = rotatingImageId });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.Groups = _rotatingImageGroupServices.GetRotatingImageGroups();
     return View(model);
 }
Esempio n. 12
0
 public ActionResult Edit(FileTemplateManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _fileTemplateServices.SaveFileTemplate(model);
         if (response.Success)
         {
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = model.Id });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.PageTemplates = _pageTemplateServices.GetPageTemplateSelectListForFileTemplate(model.Id);
     model.Parents = _fileTemplateServices.GetPossibleParents(model.Id);
     return View(model);
 }
Esempio n. 13
0
        public ActionResult Edit(ClientMenuManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _clientMenuServices.SaveClientMenuManageModel(model);
                if (response.Success)
                {
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = model.Id }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.Parents = _clientMenuServices.GetPossibleParents();
            return(View(model));
        }
Esempio n. 14
0
        public ActionResult Create(EmailAccountManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _emailAccountServices.SaveEmailAccount(model);
                if (response.Success)
                {
                    var emailAccountId = (int)response.Data;
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = emailAccountId }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            return(View(model));
        }
Esempio n. 15
0
        public ActionResult Create(PageTemplateManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _pageTemplateServices.SavePageTemplate(model);
                if (response.Success)
                {
                    var templateId = (int)response.Data;
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = templateId }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.Parents = _pageTemplateServices.GetPossibleParents();
            return(View(model));
        }
Esempio n. 16
0
 public ActionResult Create(NewsManageModel model, SubmitTypeEnums submit)
 {
     if (ModelState.IsValid)
     {
         var response = _newsServices.SaveNewsManageModel(model);
         if (response.Success)
         {
             var templateId = (int)response.Data;
             SetSuccessMessage(response.Message);
             switch (submit)
             {
                 case SubmitTypeEnums.Save:
                     return RedirectToAction("Index");
                 default:
                     return RedirectToAction("Edit", new { id = templateId });
             }
         }
         SetErrorMessage(response.Message);
     }
     model.StatusList = _newsServices.GetStatus();
     model.NewsCategories = _newsCategoryServices.GetNewsCategories();
     return View(model);
 }
Esempio n. 17
0
        public ActionResult Edit(NewsManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _newsServices.SaveNewsManageModel(model);
                if (response.Success)
                {
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = model.Id }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.StatusList     = _newsServices.GetStatus();
            model.NewsCategories = _newsCategoryServices.GetNewsCategories(model.Id);
            return(View(model));
        }
Esempio n. 18
0
        public ActionResult Edit(FileTemplateManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _fileTemplateServices.SaveFileTemplate(model);
                if (response.Success)
                {
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = model.Id }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.PageTemplates = _pageTemplateServices.GetPageTemplateSelectListForFileTemplate(model.Id);
            model.Parents       = _fileTemplateServices.GetPossibleParents(model.Id);
            return(View(model));
        }
Esempio n. 19
0
        public ActionResult Create(RotatingImageManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _rotatingImageServices.SaveRotatingImage(model);
                if (response.Success)
                {
                    var rotatingImageId = (int)response.Data;
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = rotatingImageId }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.Groups = _rotatingImageGroupServices.GetRotatingImageGroups();
            return(View(model));
        }
Esempio n. 20
0
        public ActionResult Create(ServiceManageModel model, SubmitTypeEnums submit)
        {
            if (ModelState.IsValid)
            {
                var response = _serviceServices.SaveServiceManageModel(model);
                if (response.Success)
                {
                    var serviceId = (int)response.Data;
                    SetSuccessMessage(response.Message);
                    switch (submit)
                    {
                    case SubmitTypeEnums.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = serviceId }));
                    }
                }
                SetErrorMessage(response.Message);
            }
            model.StatusList = _serviceServices.GetStatus();
            return(View(model));
        }