public static FMSDailyCheckListVM DailyEveningGeneralCheckListToViewModel(DailyEvening dailyEvening) { FMSDailyCheckListVM checkListVM = new FMSDailyCheckListVM(); checkListVM.Category = "Evening"; checkListVM.SubCategeory = "General"; checkListVM.VehicleNumber = dailyEvening.VehicleNumber; checkListVM.LastUpdated = dailyEvening.LastUpdated; checkListVM.DriverName = dailyEvening.DriverName; checkListVM.Region = dailyEvening.Region; checkListVM.Subregion = dailyEvening.Subregion; checkListVM.Station = dailyEvening.Station; checkListVM.Remarks = dailyEvening.Remarks; checkListVM.OdometerIn = dailyEvening.OdometerIn; checkListVM.OdometerOut = dailyEvening.OdometerOut; checkListVM.Checklist = new List <Check>(); checkListVM.Checklist.Add(new Check() { Code = "EG1", Description = "Fr Grill with Mono Gram", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG1").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EG2", Description = "Tool Kit Check", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG2").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EG3", Description = "Check cctv Cameras", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG3").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EG4", Description = "Daily Vehicle Wash", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG4").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EG5", Description = "Check Spare Tyre", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG5").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EG6", Description = "Check vehicle under the body", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EG6").GetValue(dailyEvening, null).ToString(), true) }); int totalChecks = checkListVM.Checklist.Count; int markedDoneCount = checkListVM.Checklist.Where(x => x.Value == DailyCheckStatus.Checked).Count(); if (totalChecks == markedDoneCount) { checkListVM.Status = "Complete"; } else { checkListVM.Status = "Pending"; } return(checkListVM); }
public static FMSDailyCheckListVM DailyEveningAcCheckListToViewModel(DailyEvening dailyEvening) { FMSDailyCheckListVM checkListVM = new FMSDailyCheckListVM(); checkListVM.Category = "Evening"; checkListVM.SubCategeory = "Ac"; checkListVM.VehicleNumber = dailyEvening.VehicleNumber; checkListVM.LastUpdated = dailyEvening.LastUpdated; checkListVM.DriverName = dailyEvening.DriverName; checkListVM.Region = dailyEvening.Region; checkListVM.Subregion = dailyEvening.Subregion; checkListVM.Station = dailyEvening.Station; checkListVM.Remarks = dailyEvening.Remarks; checkListVM.OdometerIn = dailyEvening.OdometerIn; checkListVM.OdometerOut = dailyEvening.OdometerOut; checkListVM.Checklist = new List <Check>(); checkListVM.Checklist.Add(new Check() { Code = "EA1", Description = "Operate Ac Front & Rear", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA1").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EA2", Description = "Ac Throw", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA2").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EA3", Description = "Ac cooling", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA3").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EA4", Description = "Check Ac Condonser", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA4").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EA5", Description = "Check Ac Filter", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA5").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EA6", Description = "Ac Condensor Cleaning", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EA6").GetValue(dailyEvening, null).ToString(), true) }); int totalChecks = checkListVM.Checklist.Count; int markedDoneCount = checkListVM.Checklist.Where(x => x.Value == DailyCheckStatus.Checked).Count(); if (totalChecks == markedDoneCount) { checkListVM.Status = "Complete"; } else { checkListVM.Status = "Pending"; } return(checkListVM); }
public static FMSDailyCheckListVM DailyEveningBodyCheckListToViewModel(DailyEvening dailyEvening) { FMSDailyCheckListVM checkListVM = new FMSDailyCheckListVM(); checkListVM.Category = "Evening"; checkListVM.SubCategeory = "Body"; checkListVM.VehicleNumber = dailyEvening.VehicleNumber; checkListVM.LastUpdated = dailyEvening.LastUpdated; checkListVM.DriverName = dailyEvening.DriverName; checkListVM.Region = dailyEvening.Region; checkListVM.Subregion = dailyEvening.Subregion; checkListVM.Station = dailyEvening.Station; checkListVM.Remarks = dailyEvening.Remarks; checkListVM.OdometerIn = dailyEvening.OdometerIn; checkListVM.OdometerOut = dailyEvening.OdometerOut; checkListVM.Checklist = new List <Check>(); checkListVM.Checklist.Add(new Check() { Code = "EB1", Description = "Dents", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB1").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB2", Description = "Scratches", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB2").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB3", Description = "Check Tyres Condition", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB3").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB4", Description = "Check Tyres Air Pressure", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB4").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB5", Description = "Check Silencer Condition", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB5").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB6", Description = "Front & Rear Bumper", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB6").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EB7", Description = "Complete Body Condition", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EB7").GetValue(dailyEvening, null).ToString(), true) }); int totalChecks = checkListVM.Checklist.Count; int markedDoneCount = checkListVM.Checklist.Where(x => x.Value == DailyCheckStatus.Checked).Count(); if (totalChecks == markedDoneCount) { checkListVM.Status = "Complete"; } else { checkListVM.Status = "Pending"; } return(checkListVM); }
public static FMSDailyCheckListVM DailyEveningInteriorCheckListToViewModel(DailyEvening dailyEvening) { FMSDailyCheckListVM checkListVM = new FMSDailyCheckListVM(); checkListVM.Category = "Evening"; checkListVM.SubCategeory = "Interior"; checkListVM.VehicleNumber = dailyEvening.VehicleNumber; checkListVM.LastUpdated = dailyEvening.LastUpdated; checkListVM.DriverName = dailyEvening.DriverName; checkListVM.Region = dailyEvening.Region; checkListVM.Subregion = dailyEvening.Subregion; checkListVM.Station = dailyEvening.Station; checkListVM.Remarks = dailyEvening.Remarks; checkListVM.OdometerIn = dailyEvening.OdometerIn; checkListVM.OdometerOut = dailyEvening.OdometerOut; checkListVM.Checklist = new List <Check>(); checkListVM.Checklist.Add(new Check() { Code = "EI1", Description = "Check Brake Pedal", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI1").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI2", Description = "Check Accelerator Pedal", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI2").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI3", Description = "Check Clutch Pedal", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI3").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI4", Description = "Check Operate key Log", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI4").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI5", Description = "Check ignition Switch", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI5").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI6", Description = "Check Vault Door Function", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI6").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI7", Description = "Operate Front & Rear Wipers", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI7").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI8", Description = "Check Steering Tilt", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI8").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI9", Description = "Check Trurn On Head Lights", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI9").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI10", Description = "Turn On Indicators Lights", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI10").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI11", Description = "Check Spare Tyres Condition", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI11").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI12", Description = "Check Horn", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI12").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI13", Description = "Check Gear Shifting", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI13").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI14", Description = "Check Gauge Neddle", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI14").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI15", Description = "Check Odoo Meter Reading", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI15").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI16", Description = "Check Fuel Lid", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI16").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI17", Description = "Check Foot mate", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI17").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI18", Description = "Check Seat Cover", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI18").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI19", Description = "Check Back View Mirror", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI19").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI20", Description = "Check Side View Mirror", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI20").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI21", Description = "Check Elecrical Cable(Install & Not fit)", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI21").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI22", Description = "Check Brake Lights", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI22").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EI23", Description = "Trip Wise Daily at the Start & end of Shift", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EI23").GetValue(dailyEvening, null).ToString(), true) }); int totalChecks = checkListVM.Checklist.Count; int markedDoneCount = checkListVM.Checklist.Where(x => x.Value == DailyCheckStatus.Checked).Count(); if (totalChecks == markedDoneCount) { checkListVM.Status = "Complete"; } else { checkListVM.Status = "Pending"; } return(checkListVM); }
public static FMSDailyCheckListVM DailyEveningEngineCheckListToViewModel(DailyEvening dailyEvening) { FMSDailyCheckListVM checkListVM = new FMSDailyCheckListVM(); checkListVM.Category = "Evening"; checkListVM.SubCategeory = "Engine"; checkListVM.VehicleNumber = dailyEvening.VehicleNumber; checkListVM.LastUpdated = dailyEvening.LastUpdated; checkListVM.Remarks = dailyEvening.Remarks; checkListVM.DriverName = dailyEvening.DriverName; checkListVM.Region = dailyEvening.Region; checkListVM.Subregion = dailyEvening.Subregion; checkListVM.Station = dailyEvening.Station; checkListVM.OdometerIn = dailyEvening.OdometerIn; checkListVM.OdometerOut = dailyEvening.OdometerOut; checkListVM.Checklist = new List <Check>(); checkListVM.Checklist.Add(new Check() { Code = "EE1", Description = "Check Engine Oil Level with dip stick", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE1").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE2", Description = "Check Battery water Level", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE2").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE3", Description = "Check Brake Fluid Level", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE3").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE4", Description = "Check Transmission Oil", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE4").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE5", Description = "Check Clutch Fluied", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE5").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE6", Description = "Check Cloolant Water Level", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE6").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE7", Description = "Check Battery terminal", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE7").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE8", Description = @"Check P\steering Oil Level", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE8").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE9", Description = "Check Smoke Exuast", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE9").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE10", Description = "Air Filter cleaning with air pressure", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE10").GetValue(dailyEvening, null).ToString(), true) }); checkListVM.Checklist.Add(new Check() { Code = "EE11", Description = "Check electric components", Value = (DailyCheckStatus)Enum.Parse(typeof(DailyCheckStatus), dailyEvening.GetType().GetProperty("EE11").GetValue(dailyEvening, null).ToString(), true) }); int totalChecks = checkListVM.Checklist.Count; int markedDoneCount = checkListVM.Checklist.Where(x => x.Value == DailyCheckStatus.Checked).Count(); if (totalChecks == markedDoneCount) { checkListVM.Status = "Complete"; } else { checkListVM.Status = "Pending"; } return(checkListVM); }