//המרה לDB public static TypesOfService ConvertionToTypesOfService(TypesOfService t) { TypesOfService newTypeOfServiceConvertion = new TypesOfService(); newTypeOfServiceConvertion.TypesOfServiceId = t.TypesOfServiceId; newTypeOfServiceConvertion.TypesOfServiceName = t.TypesOfServiceName; return(newTypeOfServiceConvertion); }
//המרה מDB public static typeOfServiceDto ConvertionToDto(TypesOfService t) { typeOfServiceDto newTypeOfServiceConvertion = new typeOfServiceDto(); newTypeOfServiceConvertion.TypesOfServiceId = t.TypesOfServiceId; newTypeOfServiceConvertion.TypesOfServiceName = t.TypesOfServiceName; return(newTypeOfServiceConvertion); }
public ActionResult DeleteConfirmed(int id) { TypesOfService typesOfService = db.TypesOfServices.Find(id); db.TypesOfServices.Remove(typesOfService); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Landscaping,SnowRemoval,Pavement,Exterior,Plumbing,Electrical,Appliances,Painting,General,HVAC,Roofing,Windows,Cleaning,Carpet,DrywallInsulation,Doors")] TypesOfService typesOfService) { if (ModelState.IsValid) { db.Entry(typesOfService).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typesOfService)); }
// GET: TypesOfServices/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypesOfService typesOfService = db.TypesOfServices.Find(id); if (typesOfService == null) { return(HttpNotFound()); } return(View(typesOfService)); }