Exemplo n.º 1
0
        public ActionResult ListDeltas(string code, string startcode, DateTime?lastupdatedate, int max = 0)
        {
            PageTitle = "List Deltas";

            var model = new ListDeltasViewModel();

            model.Overview = new Infrastructure.ViewModels.ContentViewModel().AddTitle("List Deltas").AddParagraph("List Deltas for a specified table type. This allows testing the various types of Delta web services directly i.e. bypass the use of CommonComponentsOne.");

            if (!string.IsNullOrEmpty(code))
            {
                model.CodeType       = code;
                model.StartCode      = startcode;
                model.MaxRows        = max;
                model.LastUpdateDate = lastupdatedate != null ? lastupdatedate.Value : UserService.DateTime;

                var results = AdwAdminService.GetDeltaList(model.CodeType, model.StartCode, model.LastUpdateDate, maxRows: model.MaxRows);

                model.Results = results.ToPageableDeltaViewModel();

                if (model.Results == null || (model.Results != null && !model.Results.Any()))
                {
                    AddInformationMessage("No results returned.");
                }
            }



            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult ListDeltas(ListDeltasViewModel model)
        {
            if (ModelState.IsValid)
            {
                var routeValueDictionary = new RouteValueDictionary();
                routeValueDictionary.Add("code", model.CodeType);
                routeValueDictionary.Add("startcode", model.StartCode);
                routeValueDictionary.Add("lastupdatedate", model.LastUpdateDate);
                routeValueDictionary.Add("max", model.MaxRows);

                return(RedirectToAction("ListDeltas", routeValueDictionary));
            }

            return(View(model));
        }