// GET: PlaceType/Edit/5 public ActionResult Edit(int id) { var rows = PlaceTypeDb.GetPlaceById(id).Rows; CreateEditTypeVm vm = new CreateEditTypeVm(); vm.Id = id; vm.Name = rows[0]["Name"].ToString(); return(View(vm)); }
public List <TypeVm> GetAllPlaceTypes() { var db = PlaceTypeDb.GetAllPlaceTypes(); var types = new List <TypeVm>(); foreach (DataRow row in db.Rows) { var type = new TypeVm(); type.Id = (int)row["Id"]; type.Name = (string)row["Name"]; types.Add(type); } return(types); }
private IEnumerable <PlaceType> GetAllPlaceTypes() { var db = PlaceTypeDb.GetAllPlaceTypes(); var types = new List <PlaceType>(); foreach (DataRow row in db.Rows) { var type = new PlaceType(); type.Id = (int)row["Id"]; type.Name = (string)row["Name"]; types.Add(type); } return(types); }
public void Create(string name) { PlaceTypeDb.Create(name); }
public void Delete(int id) { PlaceTypeDb.Delete(id); }
public void Edit(int id, string name) { PlaceTypeDb.Edit(id, name); }