public JsonResult GetDomains(RolePaginInfo PaginInfo)
        {
            DomainListFilter Filter = new DomainListFilter();

            Filter.CurrentPage  = PaginInfo.CurrentPage;
            Filter.ItemsPerPage = PaginInfo.ItemsPerPage;
            Filter.SortOrderAsc = PaginInfo.SortOrderAsc;
            Filter.SortColumn   = PaginInfo.SortColumn;

            Filter.SortColumnName = "DomainID";
            switch (PaginInfo.SortColumn)
            {
            case 1: Filter.SortColumnName = "DomainID"; break;

            case 2: Filter.SortColumnName = "Name"; break;

            case 3: Filter.SortColumnName = "Description"; break;

            case 4: Filter.SortColumnName = "Created"; break;

            case 5: Filter.SortColumnName = "Modified"; break;
            }

            var totalItems = 0;
            var domains    = Web.Admin.Logic.Collections.Domains.Get(Filter, out totalItems);

            return(Json(new
            {
                Html = this.RenderPartialView("_DomainList", new DomainListModel(PaginInfo.HolderName, domains, Filter, totalItems))
            }, JsonRequestBehavior.AllowGet));
        }
        public DomainListModel(string HolderName)
        {
            int result = 0;

            Filter    = new DomainListFilter();
            AppParams = new ApplicationParameters();

            int TotalItems = 0;

            this.HolderName          = HolderName;
            this.Filter.ItemsPerPage = (HttpContext.Current.Request["s"] != null && int.TryParse(HttpContext.Current.Request["s"], out result)) ? result : int.Parse(AppParams.AppUiPagingSize.Value);
            this.Filter.CurrentPage  = (HttpContext.Current.Request["p"] != null && int.TryParse(HttpContext.Current.Request["p"], out result)) ? result : 1;

            this.Filter.SortColumn   = (HttpContext.Current.Request["c"] != null && int.TryParse(HttpContext.Current.Request["c"], out result)) ? result : 1;
            this.Filter.SortOrderAsc = (HttpContext.Current.Request["o"] != null && (int.TryParse(HttpContext.Current.Request["o"], out result)) ? (result == 1 ? true : false) : true);

            this.Filter.SortColumnName = "DomainID";
            switch (this.Filter.SortColumn)
            {
            case 1: this.Filter.SortColumnName = "DomainID"; break;

            case 2: this.Filter.SortColumnName = "Name"; break;

            case 3: this.Filter.SortColumnName = "Description"; break;

            case 4: this.Filter.SortColumnName = "Created"; break;

            case 5: this.Filter.SortColumnName = "Modified"; break;
            }

            this.Domains    = Web.Admin.Logic.Collections.Domains.Get(Filter, out TotalItems);
            this.TotalItems = TotalItems;
        }
        public JsonResult GetDomains(RolePaginInfo PaginInfo)
        {
            DomainListFilter Filter = new DomainListFilter();
            Filter.CurrentPage = PaginInfo.CurrentPage;
            Filter.ItemsPerPage = PaginInfo.ItemsPerPage;
            Filter.SortOrderAsc = PaginInfo.SortOrderAsc;
            Filter.SortColumn = PaginInfo.SortColumn;

            Filter.SortColumnName = "DomainID";
            switch (PaginInfo.SortColumn)
            {
                case 1: Filter.SortColumnName = "DomainID"; break;
                case 2: Filter.SortColumnName = "Name"; break;
                case 3: Filter.SortColumnName = "Description"; break;
                case 4: Filter.SortColumnName = "Created"; break;
                case 5: Filter.SortColumnName = "Modified"; break;
            }

            var totalItems = 0;
            var domains = Web.Admin.Logic.Collections.Domains.Get(Filter, out totalItems);

            return Json(new
            {
                Html = this.RenderPartialView("_DomainList", new DomainListModel(PaginInfo.HolderName, domains, Filter, totalItems))
            }, JsonRequestBehavior.AllowGet);
        }
        public DomainListModel(string HolderName)
        {
            int result = 0;
            Filter = new DomainListFilter();
            AppParams = new ApplicationParameters();

            int TotalItems = 0;
            this.HolderName = HolderName;
            this.Filter.ItemsPerPage = (HttpContext.Current.Request["s"] != null && int.TryParse(HttpContext.Current.Request["s"], out result)) ? result : int.Parse(AppParams.AppUiPagingSize.Value);
            this.Filter.CurrentPage = (HttpContext.Current.Request["p"] != null && int.TryParse(HttpContext.Current.Request["p"], out result)) ? result : 1;

            this.Filter.SortColumn = (HttpContext.Current.Request["c"] != null && int.TryParse(HttpContext.Current.Request["c"], out result)) ? result : 1;
            this.Filter.SortOrderAsc = (HttpContext.Current.Request["o"] != null && (int.TryParse(HttpContext.Current.Request["o"], out result)) ? (result == 1 ? true : false) : true);

            this.Filter.SortColumnName = "DomainID";
            switch (this.Filter.SortColumn)
            {
                case 1: this.Filter.SortColumnName = "DomainID"; break;
                case 2: this.Filter.SortColumnName = "Name"; break;
                case 3: this.Filter.SortColumnName = "Description"; break;
                case 4: this.Filter.SortColumnName = "Created"; break;
                case 5: this.Filter.SortColumnName = "Modified"; break;
            }

            this.Domains = Web.Admin.Logic.Collections.Domains.Get(Filter, out TotalItems);
            this.TotalItems = TotalItems;
        }
 public DomainListModel()
 {
     Domains             = new List <Domain>();
     Filter              = new DomainListFilter();
     HolderName          = "";
     Filter.ItemsPerPage = 5;
     Filter.CurrentPage  = 1;
     AppParams           = new ApplicationParameters();
 }
 public DomainListModel()
 {
     Domains = new List<Domain>();
     Filter = new DomainListFilter();
     HolderName = "";
     Filter.ItemsPerPage = 5;
     Filter.CurrentPage = 1;
     AppParams = new ApplicationParameters();
 }
        public DomainListModel(String HolderName, List <Domain> Domains, DomainListFilter Filter, int TotalItems)
        {
            this.Filter = new DomainListFilter();

            this.HolderName          = HolderName;
            this.Domains             = Domains;
            this.Filter.CurrentPage  = Filter.CurrentPage;
            this.Filter.ItemsPerPage = Filter.ItemsPerPage;
            this.Filter.SortColumn   = Filter.SortColumn;
            this.Filter.SortOrderAsc = Filter.SortOrderAsc;
            this.TotalItems          = TotalItems;
        }
        public DomainListModel(String HolderName, List<Domain> Domains, DomainListFilter Filter, int TotalItems)
        {
            this.Filter = new DomainListFilter();

            this.HolderName = HolderName;
            this.Domains = Domains;
            this.Filter.CurrentPage = Filter.CurrentPage;
            this.Filter.ItemsPerPage = Filter.ItemsPerPage;
            this.Filter.SortColumn = Filter.SortColumn;
            this.Filter.SortOrderAsc = Filter.SortOrderAsc;
            this.TotalItems = TotalItems;
        }