Ejemplo n.º 1
0
        public virtual ActionResult Submit(StyleLocationViewModel model)
        {
            LogI("Submit, model=" + model);

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

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

                return(Json(new UpdateRowViewModel(outputModel,
                                                   "Styles",
                                                   new[]
                {
                    "Locations",
                    "MainLocation",
                    "HasLocation",
                },
                                                   false)));
            }
            return(View(PopupContentView, model));
        }
Ejemplo n.º 2
0
        public virtual ActionResult GetAll(GridRequest request)
        {
            LogI("GetAll");

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

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

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

            return(Json(data, JsonRequestBehavior.AllowGet));
        }