// 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));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void Create(string name)
 {
     PlaceTypeDb.Create(name);
 }
Пример #5
0
 public void Delete(int id)
 {
     PlaceTypeDb.Delete(id);
 }
Пример #6
0
 public void Edit(int id, string name)
 {
     PlaceTypeDb.Edit(id, name);
 }