Esempio n. 1
0
        public JsonResult DataRequested()
        {
            var gridModel = new LeasingDatabase.Models.Grid.VendorRateJqGridModel();
            var db        = new AuleaseEntities();

            SetUpGrid(gridModel.OrdersGrid);

            List <VendorRate> rates = new List <VendorRate>();

            var Types = db.VendorRates.Select(n => new { n.TypeId, n.Term }).Distinct();

            foreach (var type in Types)
            {
                rates.Add(db.VendorRates.Where(n => n.TypeId == type.TypeId && n.Term == type.Term).OrderByDescending(n => n.BeginDate).FirstOrDefault());
            }

            var model = rates.Select(n => new VendorRateModel
            {
                Id       = n.Id,
                Rate     = n.Rate,
                RateType = n.Type.Name,
                Term     = n.Term
            }).AsQueryable();

            return(gridModel.OrdersGrid.DataBind(model));
        }
Esempio n. 2
0
        //
        // GET: /VendorRate/

        public ActionResult Index()
        {
            var gridModel  = new LeasingDatabase.Models.Grid.VendorRateJqGridModel();
            var ordersGrid = gridModel.OrdersGrid;

            SetUpGrid(ordersGrid);

            return(View(gridModel));
        }