예제 #1
0
 protected MvcDatalist()
 {
     AdditionalFilters = new List<String>();
     Columns = new List<DatalistColumn>();
     Filter = new DatalistFilter();
     Filter.Rows = 20;
 }
예제 #2
0
 protected MvcDatalist()
 {
     AdditionalFilters = new List <String>();
     Columns           = new List <DatalistColumn>();
     Filter            = new DatalistFilter();
     Dialog            = "DatalistDialog";
 }
        public DatalistControllerTests()
        {
            unitOfWork = Substitute.For<IUnitOfWork>();
            controller = Substitute.ForPartsOf<DatalistController>(unitOfWork);

            HttpContext.Current = HttpContextFactory.CreateHttpContext();
            datalist = Substitute.For<AbstractDatalist>();
            filter = new DatalistFilter();
        }
예제 #4
0
        protected AbstractDatalist(UrlHelper url)
        {
            String sanitizedName = GetType().Name.Replace(Prefix, "");

            AdditionalFilters     = new List <String>();
            CurrentFilter         = new DatalistFilter();
            Columns               = new DatalistColumns();
            DialogTitle           = sanitizedName;
            DefaultRecordsPerPage = 20;

            DatalistUrl = url.Action(sanitizedName, Prefix, new { area = "" });
        }
예제 #5
0
        protected AbstractDatalist()
        {
            String sanitizedName = GetType().Name.Replace(Prefix, String.Empty);

            AdditionalFilters     = new List <String>();
            CurrentFilter         = new DatalistFilter();
            Columns               = new DatalistColumns();
            DialogTitle           = sanitizedName;
            DefaultRecordsPerPage = 20;

            String applicationPath = HttpContext.Current.Request.ApplicationPath ?? "/";

            if (!applicationPath.EndsWith("/"))
            {
                applicationPath += "/";
            }

            DatalistUrl = String.Format("{0}://{1}{2}{3}/{4}",
                                        HttpContext.Current.Request.Url.Scheme,
                                        HttpContext.Current.Request.Url.Authority,
                                        applicationPath,
                                        Prefix,
                                        sanitizedName);
        }
 public JsonResult Role(DatalistFilter filter)
 {
     return GetData(new Datalist<Role, RoleView>(UnitOfWork), filter);
 }
        public virtual JsonResult GetData(AbstractDatalist datalist, DatalistFilter filter)
        {
            datalist.CurrentFilter = filter;

            return Json(datalist.GetData(), JsonRequestBehavior.AllowGet);
        }