Exemplo n.º 1
0
        public ActionResult Edit(SKL_ColorCodeModel model, bool continueEditing)
        {
            var colorCode = _colorCodeService.GetColorCodeById(model.Id);

            if (colorCode == null)
            {
                //No colorCode found with the specified id
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                colorCode = model.ToEntity(colorCode);
                _colorCodeService.UpdateColorCode(colorCode);

                SuccessNotification(_localizationService.GetResource("Admin.Sankalp.ColorCode.Updated"));
                if (continueEditing)
                {
                    //selected tab
                    SaveSelectedTabName();
                    return(RedirectToAction("Edit", new { id = colorCode.Id }));
                }
                return(RedirectToAction("List"));
            }

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Create(SKL_ColorCodeModel model, bool continueEditing)
        {
            if (ModelState.IsValid)
            {
                var colorCode = model.ToEntity();
                _colorCodeService.InsertColorCode(colorCode);

                SuccessNotification(_localizationService.GetResource("Admin.Sankalp.ColorCode.Added"));

                if (continueEditing)
                {
                    //selected tab
                    SaveSelectedTabName();
                    return(RedirectToAction("Edit", new { id = colorCode.Id }));
                }
                return(RedirectToAction("List"));
            }

            return(View(model));
        }
Exemplo n.º 3
0
 public static SKL_ColorCode ToEntity(this SKL_ColorCodeModel model, SKL_ColorCode destination)
 {
     return(model.MapTo(destination));
 }
Exemplo n.º 4
0
 public static SKL_ColorCode ToEntity(this SKL_ColorCodeModel model)
 {
     return(model.MapTo <SKL_ColorCodeModel, SKL_ColorCode>());
 }
Exemplo n.º 5
0
        public ActionResult Create()
        {
            var model = new SKL_ColorCodeModel();

            return(View(model));
        }