// 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);
 }