Example #1
0
        public ActionResult Delete(Int16 id)
        {
            MasterRoomType cat = db.MasterRoomTypes.Where(x => x.RoomTypeID == id).Single <MasterRoomType>();

            db.MasterRoomTypes.DeleteOnSubmit(cat);
            db.SubmitChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult Edit(MasterRoomType_model cat)
        {
            MasterRoomType tblcat = db.MasterRoomTypes.Where(x => x.RoomTypeID == cat.RoomTypeID).Single <MasterRoomType>();

            tblcat.RoomTypeID          = cat.RoomTypeID;
            tblcat.RoomTypeName        = cat.RoomTypeName;
            tblcat.RoomTypeDescription = cat.RoomTypeDescription;
            tblcat.Price = cat.Price;
            db.SubmitChanges();
            return(View());
        }
Example #3
0
        public ActionResult RoomType(MasterRoomType_model cat)
        {
            MasterRoomType tblcat = new MasterRoomType();

            tblcat.RoomTypeName        = cat.RoomTypeName;
            tblcat.RoomTypeDescription = cat.RoomTypeDescription;
            tblcat.Price = cat.Price;
            db.MasterRoomTypes.InsertOnSubmit(tblcat);
            db.SubmitChanges();
            return(View());
        }