//public ActionResult Edit([Bind(Include = "ID,ReportingPeriod,Operator,UserName,Email,IsExpectingNewVehicles,HasGillig,HasNewFlyer,HasElDorado,HasOther,OtherName,GilligNewVehicles,GilligNewModel,GilligReplacementVehicles,GilligReplacementManufacturingDate,GilligReplacementDeliveryDate,GilligExpansionVehicles,GilligExpansionManufacturingDate,GilligExpansionDeliveryDate,NewFlyerNewVehicles,NewFlyerNewModel,NewFlyerReplacementVehicles,NewFlyerReplacementManufacturingDate,NewFlyerReplacementDeliveryDate,NewFlyerExpansionVehicles,NewFlyerExpansionManufacturingDate,NewFlyerExpansionDeliveryDate,ElDoradoNewVehicles,ElDoradoNewModel,ElDoradoReplacementVehicles,ElDoradoReplacementManufacturingDate,ElDoradoReplacementDeliveryDate,ElDoradoExpansionVehicles,ElDoradoExpansionManufacturingDate,ElDoradoExpansionDeliveryDate,OtherNewVehicles,OtherNewModel,OtherReplacementVehicles,OtherReplacementManufacturingDate,OtherReplacementDeliveryDate,OtherExpansionVehicles,OtherExpansionManufacturingDate,OtherExpansionDeliveryDate,OwnExistingVehicles,ExistingVehicleDetails,ReplacementVehicleDetails,PreWireRequirements,IncludedCosts,LastUpdated,RecordStatus,Notes")] DeviceSurvey deviceSurvey) public ActionResult Edit(DeviceSurvey deviceSurvey) { if (ModelState.IsValid) { DeviceSurveyProvider.Update(deviceSurvey); return(RedirectToAction("Index")); } return(View(deviceSurvey)); }
// GET: DeviceSurvey/Edit/5 public ActionResult Edit(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var deviceSurvey = DeviceSurveyProvider.Get(id.Value); if (deviceSurvey == null) { return(HttpNotFound()); } return(View(deviceSurvey)); }
public APIResponse Delete(int id) { try { DeviceSurveyProvider.Delete(id); return(new APIResponse { Status = "Device Survey Deleted" }); } catch (Exception ex) { return(new APIResponse { ErrorMessage = ex.Message }); } }
// GET DeviceSurvey/Export public FileContentResult Export() { var csvExport = new CSVExporter(); var excludedFields = "ID,HasGilligYN,HasNewFlyerYN,HasElDoradoYN,HasOtherYN,IsGilligNewVehiclesAndModelRequired,IsNewFlyerNewVehiclesAndModelRequired,IsElDoradoNewVehiclesAndModelRequired,IsOtherNewVehiclesAndModelRequired"; var excluded = excludedFields.Split(',').ToList <String>(); foreach (var deviceSurvey in DeviceSurveyProvider.GetAll()) { csvExport.AddRow(); foreach (var prop in deviceSurvey.GetType().GetProperties()) { if (excluded.Find(x => x == prop.Name) == null) { csvExport[prop.Name] = prop.GetValue(deviceSurvey, null); } } } return(File(new UTF8Encoding().GetBytes(csvExport.Export()), "text/csv", "DeviceSurvey.csv")); }
public DeviceSurvey Get(int id) { return(DeviceSurveyProvider.Get(id)); }
public IEnumerable <DeviceSurvey> Get() { return(DeviceSurveyProvider.GetAll()); }
// GET: DeviceSurvey public ActionResult Index() { var model = DeviceSurveyProvider.GetList(); return(View(model)); }