Пример #1
0
        public ActionResult VehicleDriverMapping(string id)
        {
            VehicleDriverMappingViewModel vd = new VehicleDriverMappingViewModel();

            var vehicle = ApplicationConfigHelper.GetVehicleList().FirstOrDefault(m => m.ID.ToString() == id);

            vd.VID       = vehicle.ID;
            vd.VehicleNo = vehicle.CarNo;


            //var driver = ApplicationConfigHelper.GetDriverList();
            DriverSearchCondition ds = new DriverSearchCondition();

            ds.VehicleID = id;


            //int pagesize = 17;
            var response = new DriverService().GetAllDriver(new GetDriverByConditionRequest()
            {
                SearchCondition = ds,
                PageIndex       = vd.PageIndex,
                PageSize        = UtilConstants.PAGESIZE,
            });

            if (response.IsSuccess)
            {
                vd.Driver    = response.Result.DriverCollection;
                vd.PageIndex = response.Result.PageIndex;
                vd.PageCount = response.Result.PageCount;
            }


            return(View(vd));
        }
Пример #2
0
        public ActionResult VehicleDriverMapping(VehicleDriverMappingViewModel vd)
        {
            DriverSearchCondition ds = new DriverSearchCondition();

            ds.DriverName = vd.DriverName;

            var response = new DriverService().GetAllDrivers(new GetDriverByConditionRequest()
            {
                SearchCondition = ds,
                PageIndex       = vd.PageIndex,
                PageSize        = UtilConstants.PAGESIZE
            });

            if (response.IsSuccess)
            {
                vd.Driver    = response.Result.DriverCollection;
                vd.PageIndex = response.Result.PageIndex;
                vd.PageCount = response.Result.PageCount;
            }

            return(View(vd));
        }