public virtual ActionResult Submit(StyleDescriptionViewModel model)
        {
            LogI("Submit, model=" + model);

            //Save
            if (ModelState.IsValid)
            {
                model.Apply(Db,
                            Time.GetAppNowTime(),
                            AccessManager.UserId);

                var outputModel = StyleDescriptionViewModel.GetAll(Db, new StyleSearchFilterViewModel()
                {
                    StyleId = model.Id
                }).FirstOrDefault();

                return(Json(new UpdateRowViewModel(outputModel,
                                                   "Styles",
                                                   new[]
                {
                    "Description",
                    "ShortDescription",
                    "SearchTerms",
                    "BulletPoint1",
                    "BulletPoint2",
                    "BulletPoint3",
                    "BulletPoint4",
                    "BulletPoint5",
                },
                                                   false)));
            }
            return(View(PopupContentView, model));
        }
        public virtual ActionResult EditStyleDescription(long styleId)
        {
            LogI("EditStyleDescription, id=" + styleId);

            var model = new StyleDescriptionViewModel(Db, styleId);

            ViewBag.PartialViewName = PopupContentView;
            return(View("EditEmpty", model));
        }
        public virtual ActionResult GetAll(GridRequest request)
        {
            LogI("GetAll");

            var searchFilter = new StyleSearchFilterViewModel();
            var items        = StyleDescriptionViewModel.GetAll(Db, searchFilter).ToList();
            var data         = new GridResponse <StyleDescriptionViewModel>(items, items.Count, Time.GetAppNowTime());

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
        public virtual ActionResult GetAllUpdates(DateTime?fromDate)
        {
            LogI("GetAllUpdates, fromDate=" + fromDate);

            var searchFilter = new StyleSearchFilterViewModel()
            {
                FromReSaveDate = fromDate
            };
            var items = StyleDescriptionViewModel.GetAll(Db, searchFilter).ToList();
            var data  = new GridResponse <StyleDescriptionViewModel>(items, items.Count, Time.GetAppNowTime());

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
        public virtual ActionResult SetDescription(long fromStyleId, long toStyleId)
        {
            LogI("SetDescription, toStyleId=" + toStyleId + ", fromStyleId=" + fromStyleId);
            var model = new StyleDescriptionViewModel(Db, fromStyleId); //NOTE: get all fields from Db include LongDescriptions

            model.Id = toStyleId;

            model.Apply(Db,
                        Time.GetAppNowTime(),
                        AccessManager.UserId);

            var outputModel = StyleDescriptionViewModel.GetAll(Db, new StyleSearchFilterViewModel()
            {
                StyleId = model.Id
            }).FirstOrDefault();

            return(Json(CallResult <StyleDescriptionViewModel> .Success(outputModel)));
        }