Example #1
0
 public ActionResult AddButton(AddButtonModel model)
 {
     if (!(string.IsNullOrEmpty(model.Text)))
     {
         _companyService.AddButton(model.CompanyId, new Button()
         {
             BgColor   = model.BgColor,
             FontColor = model.FontColor,
             Text      = model.Text
         });
         return(RedirectToAction("IndexPage", new { id = model.CompanyId }));
     }
     else
     {
         ModelState.AddModelError("", "Button text is required");
         return(RedirectToAction("AddButton", new { id = model.CompanyId }));
     }
 }