Exemple #1
0
        public void Update(M.Room model)
        {
            var item = _roomRepo.GetById(model.ID);

            item.Name   = model.Name;
            item.Status = (DB.Enum.RoomStatus)model.Status;
            item.Type   = (DB.Enum.RoomType)model.Type;
            _roomRepo.Update(item);
            UnitOfWork.SaveChanges();
        }
Exemple #2
0
        public M.Room Create(M.Room model)
        {
            var room = new DB.Room()
            {
                Name   = model.Name,
                Status = DB.Enum.RoomStatus.Ready,
                Type   = (DB.Enum.RoomType)model.Type
            };

            _roomRepo.Create(room);

            UnitOfWork.SaveChanges();

            model.ID = room.ID;

            return(model);
        }