Example #1
0
        public ViewResult Detail(Guid id)
        {
            driver dbItem = RepoDriver.FindByPk(id);
            DriverPresentationStub model = new DriverPresentationStub(dbItem);

            return(View(model));
        }
Example #2
0
        public string BindingDriver()
        {
            //kamus
            GridRequestParameters param = GridRequestParameters.Current;

            Business.Infrastructure.FilterInfo filters = param.Filters;
            Guid?         idOwner = (User as CustomPrincipal).IdOwner;
            List <driver> items;
            List <DriverPresentationStub> result = new List <DriverPresentationStub>();
            int total = 0;

            //algoritma
            if (idOwner.HasValue)
            {
                AddOwnerFilter(filters, idOwner.Value);

                items  = RepoDriver.FindAll(null, null, null, filters);
                total  = items.Count();
                result = new DriverPresentationStub().MapList(items).OrderBy(x => x.Name).ToList();
            }

            return(new JavaScriptSerializer().Serialize(new { total = total, data = result }));
        }