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