Ejemplo n.º 1
0
        public ActionResult AddServiceType(ServiceTypeViewModel model)
        {
            string userId = User.Identity.GetUserId();

            //Send new data to logic layer
            LogicService cmLogic          = new LogicService();
            bool         addedSucessfully = cmLogic.AddServiceType(model.ServiceName, decimal.Parse(model.HourlyRate), userId);

            //Redirect back to dashbaord, print results to screen
            if (addedSucessfully)
            {
                return(RedirectToAction("Result", "Dashboard", new { statusCode = 0, message = "Service Type Added Successfully" }));
            }
            else
            {
                return(RedirectToAction("Result", "Dashboard", new { statusCode = 1, message = "Failed To Add Service Type" }));
            }
        }