Example #1
0
        //
        // GET: /MstGroupCostCenter/

        public ActionResult Index()
        {
            var data  = _GroupCostCenterBLL.GetGroupCenter();
            var model = new GroupCostCenterModel();

            model.Details           = Mapper.Map <List <GroupCostCenterItem> >(data);
            model.MainMenu          = _mainMenu;
            model.CurrentLogin      = CurrentUser;
            model.CurrentPageAccess = CurrentPageAccess;
            return(View(model));
        }
Example #2
0
        public ActionResult Index()
        {
            var model = new CostObModel();

            model.SearchView.Year = DateTime.Now.Year;
            var VehicleTypeList     = _settingBLL.GetSetting().Where(x => x.IsActive && x.SettingGroup == EnumHelper.GetDescription(Enums.SettingGroup.VehicleType)).Select(x => new { x.SettingName }).Distinct().ToList();
            var FunctionList        = _functionGroupBll.GetGroupCenter().Where(x => x.IsActive).Select(x => new { x.FunctionName }).Distinct().ToList();
            var LocationMappingList = _locationMappingBLL.GetLocationMapping().Where(x => x.IsActive).Select(x => new { x.Region }).Distinct().ToList();

            model.SearchView.VehicleTypeList = new SelectList(VehicleTypeList, "SettingName", "SettingName");
            model.SearchView.FunctionList    = new SelectList(FunctionList, "FunctionName", "FunctionName");
            model.SearchView.RegionalList    = new SelectList(LocationMappingList, "Region", "Region");

            var filter = new CostObParamInput();

            filter.Year = DateTime.Now.Year;

            var data = _costObBLL.GetByFilter(filter);

            model.Details           = Mapper.Map <List <CostObItem> >(data);
            model.MainMenu          = _mainMenu;
            model.CurrentLogin      = CurrentUser;
            model.CurrentPageAccess = CurrentPageAccess;
            foreach (CostObItem item in model.Details)
            {
                item.MonthS = this.SetMonthToString(item.Month == null ? 0:item.Month.Value);
            }
            return(View(model));
        }
Example #3
0
        //
        // GET: /MstFuelOdometer/

        public ActionResult Index()
        {
            var model = new FuelOdometerModel();

            //model.Details = Mapper.Map<List<FuelOdometerItem>>(data);
            model.SearchView = new FuelOdometerSearchView();
            var fleetList        = _fleetBLL.GetFleet().ToList();
            var costCenterList   = _groupCostCenterBLL.GetGroupCenter().ToList();
            var fuelOdometerList = _fuelodometerBLL.GetFuelOdometer().ToList();
            var listVehType      = _settingBLL.GetSetting().Where(x => x.SettingGroup == EnumHelper.GetDescription(Enums.SettingGroup.VehicleType) && x.IsActive).Select(x => new { x.MstSettingId, x.SettingValue }).ToList();

            model.SearchView.PoliceNumberList  = new SelectList(fleetList.Select(x => new { x.PoliceNumber }).Distinct().ToList(), "PoliceNumber", "PoliceNumber");
            model.SearchView.EmployeeNameList  = new SelectList(fleetList.Select(x => new { x.EmployeeName }).Distinct().ToList(), "EmployeeName", "EmployeeName");
            model.SearchView.EmployeeIDList    = new SelectList(fleetList.Select(x => new { x.EmployeeID }).Distinct().ToList(), "EmployeeID", "EmployeeID");
            model.SearchView.CostCenterList    = new SelectList(costCenterList.Select(x => new { x.CostCenter }).Distinct().ToList(), "CostCenter", "CostCenter");
            model.SearchView.EcsRmbTransIdList = new SelectList(fuelOdometerList.Select(x => new { x.EcsRmbTransId }).Distinct().ToList(), "EcsRmbTransId", "EcsRmbTransId");
            model.SearchView.ClaimTypeList     = new SelectList(fuelOdometerList.Select(x => new { x.ClaimType }).Distinct().ToList(), "ClaimType", "ClaimType");
            model.SearchView.VehicleTypeList   = new SelectList(listVehType.Select(x => new { x.SettingValue }).Distinct().ToList(), "SettingValue", "SettingValue");
            model.MainMenu          = _mainMenu;
            model.CurrentLogin      = CurrentUser;
            model.CurrentPageAccess = CurrentPageAccess;
            return(View(model));
        }
Example #4
0
        //public ActionResult Create()
        //{
        //    var model = initCreate();
        //    model.MainMenu = _mainMenu;

        //    return View(model);
        //}

        //[HttpPost]
        //public ActionResult Create(FleetItem Model)
        //{
        //    try
        //    {
        //        if(ModelState.IsValid)
        //        {
        //            var dto = Mapper.Map<FleetDto>(Model);
        //            dto.CreatedDate = DateTime.Now;
        //            dto.CreatedBy = "Doni";
        //            dto.IsActive = true;
        //            _fleetBLL.Save(dto);
        //        }
        //    }
        //    catch (Exception )
        //    {
        //        var model = initCreate();
        //        return View(model);
        //    }

        //    return RedirectToAction("Index","MstFleet");
        //}
        #endregion

        public FleetItem initEdit(FleetItem model)
        {
            var data = _vendorBLL.GetVendor().Where(x => x.IsActive == true);

            model.VendorList = new SelectList(data, "VendorName", "VendorName", model.VendorName);

            var list1 = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Extend", Value = "Extend"
                },
                new SelectListItem {
                    Text = "Temporary", Value = "Temporary"
                },
                new SelectListItem {
                    Text = "Lease", Value = "Lease"
                },
                new SelectListItem {
                    Text = "Services", Value = "Services"
                }
            };

            model.SupplyMethodList = new SelectList(list1, "Value", "Text", model.SupplyMethod);

            list1 = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Automatic", Value = "Automatic"
                },
                new SelectListItem {
                    Text = "Manual", Value = "Manual"
                }
            };
            model.TransmissionList = new SelectList(list1, "Value", "Text", model.Transmission);

            list1 = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "MPV", Value = "MPV"
                },
                new SelectListItem {
                    Text = "SUV", Value = "SUV"
                },
                new SelectListItem {
                    Text = "Forklift", Value = "Forklift"
                },
                new SelectListItem {
                    Text = "Motorcycle", Value = "Motorcycle"
                },
                new SelectListItem {
                    Text = "Truck", Value = "Truck"
                }
            };
            model.BodyTypeList = new SelectList(list1, "Value", "Text", model.BodyType);

            list1 = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Gasoline", Value = "Gasoline"
                },
                new SelectListItem {
                    Text = "Diesel", Value = "Diesel"
                }
            };
            model.FuelTypeList = new SelectList(list1, "Value", "Text", model.FuelType);

            var groupCostData = _groupCostCenterBLL.GetGroupCenter().Where(x => x.IsActive == true);

            model.FunctionList = new SelectList(groupCostData, "FunctionName", "FunctionName", model.Function);

            var locationMappingData = _locationMappingBLL.GetLocationMapping().Where(x => x.IsActive == true);

            model.RegionalList = new SelectList(locationMappingData, "Region", "Region", model.Regional);

            return(model);
        }