Пример #1
0
        public ActionResult CommentList(Int64 RoomID)
        {
            Room room = new Room();
            room.RoomID = RoomID;
            RoomRepository _RoomRepository = new RoomRepository(room);

            return PartialView(_RoomRepository.getdata());
        }
Пример #2
0
 public ActionResult RoomlistOwner()
 {
     Room model = new Room();
     Account AccountModel = new Account();
     AccountModel.username = User.Identity.Name;
     AccountRepository _accountRepository = new AccountRepository(AccountModel);
     model.UserID = _accountRepository.getData().ID;
     List<Room> modelList = new List<Room>();
     RoomRepository _RoomAccountRepository = new RoomRepository(model);
     return View(_RoomAccountRepository.getRoomListByID());
 }
Пример #3
0
        public ActionResult AppointmentList(Int64 RoomID)
        {
            Room model = new Room();
            model.RoomID = RoomID;
            Appointment _AppointmentModel = new Appointment();
            Account AccountModel = new Account();
            AccountModel.username = User.Identity.Name;

            AccountRepository _accountRepository = new AccountRepository(AccountModel);
            _AppointmentModel.UserID = _accountRepository.getData().ID;
            _AppointmentModel.RoomID = RoomID;
            AppointmentRepository _appointmentRepository = new AppointmentRepository(_AppointmentModel);
            return View(_appointmentRepository.getAppointmentList());
        }
Пример #4
0
 public ActionResult RoomUpdateProcess(Room model)
 {
     RoomRepository _RoomRepository = new RoomRepository(model);
     _RoomRepository.UpdateRoomData();
     return RedirectToAction("RoomlistOwner");
 }
Пример #5
0
 public ActionResult RoomUpdate(Room _model)
 {
     return View(_model);
 }
Пример #6
0
 public Room getdata()
 {
     Room _RoomAccount = new Room();
     SqlCeCommand cmd = new SqlCeCommand("Select * from RoomInformation " +
                                         "inner join Comment on RoomInformation.RoomID = Comment.RoomID " +
                                         "inner join UserInformation on RoomInformation.UserID = UserInformation.User_ID " +
                                         "inner join UserInformation As CommentAccount on Comment.UserID = CommentAccount.User_ID " +
                                         "where RoomInformation.RoomID =@RoomID Order by Comment.CommentDateTime DESC", conn);
     cmd.Parameters.AddWithValue("@RoomID", this.roominformation.RoomID);
     SqlCeDataAdapter adapter = new SqlCeDataAdapter();
     adapter.SelectCommand = cmd;
     DataSet setdata = new DataSet();
     adapter.Fill(setdata, "RoomInformation");
     if (setdata.Tables[0].Rows.Count > 0)
     {
         _RoomAccount.RoomID = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[0].ToString());
         _RoomAccount.ApartmentName = setdata.Tables[0].Rows[0].ItemArray[1].ToString();
         _RoomAccount.RoomForSale = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[2].ToString());
         _RoomAccount.RoomForRent = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[3].ToString());
         _RoomAccount.RoomType = setdata.Tables[0].Rows[0].ItemArray[4].ToString();
         _RoomAccount.RoomSize = setdata.Tables[0].Rows[0].ItemArray[5].ToString();
         _RoomAccount.RoomPrice = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[6].ToString());
         _RoomAccount.District = setdata.Tables[0].Rows[0].ItemArray[7].ToString();
         _RoomAccount.Tambon = setdata.Tables[0].Rows[0].ItemArray[8].ToString();
         _RoomAccount.Road = setdata.Tables[0].Rows[0].ItemArray[9].ToString();
         _RoomAccount.Soi = setdata.Tables[0].Rows[0].ItemArray[10].ToString();
         _RoomAccount.PostCode = setdata.Tables[0].Rows[0].ItemArray[11].ToString();
         _RoomAccount.FullAddress = setdata.Tables[0].Rows[0].ItemArray[12].ToString();
         _RoomAccount.ElecPerUnit = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[13].ToString());
         _RoomAccount.WaterPerUnit = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[14].ToString());
         _RoomAccount.RoomStatus = setdata.Tables[0].Rows[0].ItemArray[15].ToString();
         _RoomAccount.AirCon = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[16].ToString());
         _RoomAccount.Fridge = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[17].ToString());
         _RoomAccount.Balcony = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[18].ToString());
         _RoomAccount.Tv = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[19].ToString());
         _RoomAccount.Internet = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[20].ToString());
         _RoomAccount.WHeater = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[21].ToString());
         _RoomAccount.Pets = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[22].ToString());
         _RoomAccount.Fitness = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[23].ToString());
         _RoomAccount.Swimming = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[24].ToString());
         _RoomAccount.Laundry = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[25].ToString());
         _RoomAccount.Store = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[26].ToString());
         _RoomAccount.Elevator = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[27].ToString());
         _RoomAccount.Parking = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[28].ToString());
         _RoomAccount.FrontDesk = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[29].ToString());
         _RoomAccount.KeyCard = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[30].ToString());
         _RoomAccount.FingerPrint = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[31].ToString());
         _RoomAccount.CCTV = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[32].ToString());
         _RoomAccount.Guard = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[33].ToString());
         _RoomAccount.FireAlarm = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[34].ToString());
         _RoomAccount.UserID = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[35].ToString());
         _RoomAccount.Username = setdata.Tables[0].Rows[0].ItemArray[48].ToString();
         for (int i = 0; i < setdata.Tables[0].Rows.Count; i++)
         {
             Comment _comment = new Comment();
             _comment.CommentID = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[36].ToString());
             _comment.Username = setdata.Tables[0].Rows[i].ItemArray[61].ToString();
             _comment.CommentContent = setdata.Tables[0].Rows[i].ItemArray[39].ToString();
             _comment.CommentDateTime = DateTime.Parse(setdata.Tables[0].Rows[0].ItemArray[40].ToString());
             _RoomAccount.RoomCommentList.Add(_comment);
         }
     }
     return _RoomAccount;
 }
Пример #7
0
        public List<Room> Searchwithcriterion()
        {
            string Criterion = " select * from RoomInformation ";
            int counter = 0;
            if (this._searchModel.District != null)
            {
                if (counter == 0)
                    Criterion += "where District = @District ";
                else
                    Criterion += "and District = @District ";
                counter++;
            }
            if (this._searchModel.RoomType != null)
            {
                if (counter == 0)
                    Criterion += "where RoomType = @RoomType ";
                else
                    Criterion += "and RoomType = @RoomType ";
                counter++;

            }

            if (this._searchModel.Max != 0)
            {
                //if ((this._searchModel.Max > this._searchModel.Mini) && (this._searchModel.Max >= 0))
                //{
                if (counter == 0)
                    Criterion += "where RoomPrice <= @MaxPrice ";
                else
                    Criterion += "and RoomPrice <= @MaxPrice ";
                counter++;
                //}
            }
            if (this._searchModel.Mini != 0)
            {
                //if (this._searchModel.Mini >= 0)
                //{
                if (counter == 0)
                    Criterion += "where RoomPrice >= @MinPrice ";
                else
                    Criterion += "and RoomPrice >= @MinPrice ";
                counter++;
                //}
            }
            conn.Open();
            SqlCeCommand cmd = new SqlCeCommand(Criterion, conn);
            if (this._searchModel.District != null)
                cmd.Parameters.AddWithValue("@District", this._searchModel.District);
            if (this._searchModel.RoomType != null)
                cmd.Parameters.AddWithValue("@RoomType", this._searchModel.RoomType);
            if (this._searchModel.Max != 0)
                cmd.Parameters.AddWithValue("@MaxPrice", this._searchModel.Max);
            if (this._searchModel.Mini != 0)
                cmd.Parameters.AddWithValue("@MinPrice", this._searchModel.Mini);

            SqlCeDataAdapter adapter = new SqlCeDataAdapter();
            DataSet setdata = new DataSet();
            adapter.SelectCommand = cmd;
            adapter.Fill(setdata);

            List<Room> RoomList = new List<Room>();
            Room _RoomAccount = new Room();
            for (int i = 0; i < setdata.Tables[0].Rows.Count; i++)
            {
                _RoomAccount = new Room();
                _RoomAccount.RoomID = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[0].ToString());
                _RoomAccount.ApartmentName = setdata.Tables[0].Rows[i].ItemArray[1].ToString();
                _RoomAccount.RoomForSale = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[2].ToString());
                _RoomAccount.RoomForRent = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[3].ToString());
                _RoomAccount.RoomType = setdata.Tables[0].Rows[i].ItemArray[4].ToString();
                _RoomAccount.RoomSize = setdata.Tables[0].Rows[i].ItemArray[5].ToString();
                _RoomAccount.RoomPrice = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[6].ToString());
                _RoomAccount.District = setdata.Tables[0].Rows[i].ItemArray[7].ToString();
                _RoomAccount.Tambon = setdata.Tables[0].Rows[i].ItemArray[8].ToString();
                _RoomAccount.Road = setdata.Tables[0].Rows[i].ItemArray[9].ToString();
                _RoomAccount.Soi = setdata.Tables[0].Rows[i].ItemArray[10].ToString();
                _RoomAccount.PostCode = setdata.Tables[0].Rows[i].ItemArray[11].ToString();
                _RoomAccount.FullAddress = setdata.Tables[0].Rows[i].ItemArray[12].ToString();
                _RoomAccount.ElecPerUnit = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[13].ToString());
                _RoomAccount.WaterPerUnit = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[14].ToString());
                _RoomAccount.RoomStatus = setdata.Tables[0].Rows[i].ItemArray[15].ToString();
                _RoomAccount.AirCon = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[16].ToString());
                _RoomAccount.Fridge = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[17].ToString());
                _RoomAccount.Balcony = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[18].ToString());
                _RoomAccount.Tv = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[19].ToString());
                _RoomAccount.Internet = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[20].ToString());
                _RoomAccount.WHeater = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[21].ToString());
                _RoomAccount.Pets = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[22].ToString());
                _RoomAccount.Fitness = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[23].ToString());
                _RoomAccount.Swimming = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[24].ToString());
                _RoomAccount.Laundry = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[25].ToString());
                _RoomAccount.Store = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[26].ToString());
                _RoomAccount.Elevator = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[27].ToString());
                _RoomAccount.Parking = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[28].ToString());
                _RoomAccount.FrontDesk = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[29].ToString());
                _RoomAccount.KeyCard = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[30].ToString());
                _RoomAccount.FingerPrint = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[31].ToString());
                _RoomAccount.CCTV = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[32].ToString());
                _RoomAccount.Guard = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[33].ToString());
                _RoomAccount.FireAlarm = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[34].ToString());
                _RoomAccount.UserID = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[35].ToString());

                RoomList.Add(_RoomAccount);
            }
            conn.Close();
            return RoomList;
        }
Пример #8
0
        public List<Room> getRoomUser()
        {
            List<Room> _SelfRoomList = new List<Room>();
            SqlCeCommand cmd = new SqlCeCommand("Select * from UserInformation inner join RoomInformation on  UserInformation.User_ID = RoomInformation.UserID", conn);

            SqlCeDataAdapter adapter = new SqlCeDataAdapter();
            adapter.SelectCommand = cmd;
            DataSet setdata = new DataSet();
            adapter.Fill(setdata, "UserInformation");
            if (setdata.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < setdata.Tables[0].Rows.Count; i++)
                {
                     Room _RoomAccount= new Room();
                    _RoomAccount.RoomID = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[0].ToString());
                    _RoomAccount.ApartmentName = setdata.Tables[0].Rows[i].ItemArray[1].ToString();
                    _RoomAccount.RoomForSale = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[2].ToString());
                    _RoomAccount.RoomForRent = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[3].ToString());
                    _RoomAccount.RoomType = setdata.Tables[0].Rows[i].ItemArray[4].ToString();
                    _RoomAccount.RoomSize = setdata.Tables[0].Rows[i].ItemArray[5].ToString();
                    _RoomAccount.RoomPrice = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[6].ToString());
                    _RoomAccount.District = setdata.Tables[0].Rows[i].ItemArray[7].ToString();
                    _RoomAccount.Tambon = setdata.Tables[0].Rows[i].ItemArray[8].ToString();
                    _RoomAccount.Road = setdata.Tables[0].Rows[i].ItemArray[9].ToString();
                    _RoomAccount.Soi = setdata.Tables[0].Rows[i].ItemArray[10].ToString();
                    _RoomAccount.PostCode = setdata.Tables[0].Rows[i].ItemArray[11].ToString();
                    _RoomAccount.FullAddress = setdata.Tables[0].Rows[i].ItemArray[12].ToString();
                    _RoomAccount.ElecPerUnit = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[13].ToString());
                    _RoomAccount.WaterPerUnit = Int64.Parse(setdata.Tables[0].Rows[i].ItemArray[14].ToString());
                    _RoomAccount.RoomStatus = setdata.Tables[0].Rows[i].ItemArray[15].ToString();
                    _RoomAccount.AirCon = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[16].ToString());
                    _RoomAccount.Fridge = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[17].ToString());
                    _RoomAccount.Balcony = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[18].ToString());
                    _RoomAccount.Tv = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[19].ToString());
                    _RoomAccount.Internet = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[20].ToString());
                    _RoomAccount.WHeater = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[21].ToString());
                    _RoomAccount.Pets = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[22].ToString());
                    _RoomAccount.Fitness = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[23].ToString());
                    _RoomAccount.Swimming = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[24].ToString());
                    _RoomAccount.Laundry = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[25].ToString());
                    _RoomAccount.Store = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[26].ToString());
                    _RoomAccount.Elevator = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[27].ToString());
                    _RoomAccount.Parking = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[28].ToString());
                    _RoomAccount.FrontDesk = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[29].ToString());
                    _RoomAccount.KeyCard = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[30].ToString());
                    _RoomAccount.FingerPrint = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[31].ToString());
                    _RoomAccount.CCTV = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[32].ToString());
                    _RoomAccount.Guard = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[33].ToString());
                    _RoomAccount.FireAlarm = bool.Parse(setdata.Tables[0].Rows[i].ItemArray[34].ToString());
                   _SelfRoomList.Add(_RoomAccount);

                }

            }
            return _SelfRoomList;
        }
Пример #9
0
 public RoomRepository(Room _roominformation)
 {
     this.roominformation = _roominformation;
 }
Пример #10
0
        public Room GetRoomData()
        {
            Room Roominfo = new Room();
            SqlCeCommand cmd = new SqlCeCommand("Select * from RoomInformation where RoomID = @RoomID", conn);
            SqlCeDataAdapter adapter = new SqlCeDataAdapter();
            cmd.Parameters.AddWithValue("@RoomID", this.roominformation.RoomID);
            adapter.SelectCommand = cmd;
            DataSet setdata = new DataSet();
            adapter.Fill(setdata,"RoomInformation");
            for (int i = 0; i < setdata.Tables[0].Rows.Count; i++)
            {
                Roominfo.RoomID = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[0].ToString());
                Roominfo.ApartmentName = setdata.Tables[0].Rows[0].ItemArray[1].ToString();
                Roominfo.RoomForSale = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[2].ToString());
                Roominfo.RoomForRent = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[3].ToString());
                Roominfo.RoomType = setdata.Tables[0].Rows[0].ItemArray[4].ToString();
                Roominfo.RoomSize = setdata.Tables[0].Rows[0].ItemArray[5].ToString();
                Roominfo.RoomPrice = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[6].ToString());
                Roominfo.District = setdata.Tables[0].Rows[0].ItemArray[7].ToString();
                Roominfo.Tambon = setdata.Tables[0].Rows[0].ItemArray[8].ToString();
                Roominfo.Road = setdata.Tables[0].Rows[0].ItemArray[9].ToString();
                Roominfo.Soi = setdata.Tables[0].Rows[0].ItemArray[10].ToString();
                Roominfo.PostCode = setdata.Tables[0].Rows[0].ItemArray[11].ToString();
                Roominfo.FullAddress = setdata.Tables[0].Rows[0].ItemArray[12].ToString();
                Roominfo.ElecPerUnit = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[13].ToString());
                Roominfo.WaterPerUnit = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[14].ToString());
                Roominfo.RoomStatus = setdata.Tables[0].Rows[0].ItemArray[15].ToString();
                Roominfo.AirCon = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[16].ToString());
                Roominfo.Fridge = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[17].ToString());
                Roominfo.Balcony = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[18].ToString());
                Roominfo.Tv = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[19].ToString());
                Roominfo.Internet = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[20].ToString());
                Roominfo.WHeater = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[21].ToString());
                Roominfo.Pets = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[22].ToString());
                Roominfo.Fitness = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[23].ToString());
                Roominfo.Swimming = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[24].ToString());
                Roominfo.Laundry = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[25].ToString());
                Roominfo.Store = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[26].ToString());
                Roominfo.Elevator = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[27].ToString());
                Roominfo.Parking = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[28].ToString());
                Roominfo.FrontDesk = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[29].ToString());
                Roominfo.KeyCard = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[30].ToString());
                Roominfo.FingerPrint = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[31].ToString());
                Roominfo.CCTV = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[32].ToString());
                Roominfo.Guard = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[33].ToString());
                Roominfo.FireAlarm = bool.Parse(setdata.Tables[0].Rows[0].ItemArray[34].ToString());
                Roominfo.UserID = Int64.Parse(setdata.Tables[0].Rows[0].ItemArray[35].ToString());

            }
            return Roominfo;
        }
Пример #11
0
 public ActionResult InsertRoomData(Room model)
 {
     //if (model.ApartmentName != "" || model.RoomType != "" || model.RoomSize != "" || model.RoomPrice != 0 || model.District != "" || model.FullAddress != "" || model.ElecPerUnit != 0 || model.WaterPerUnit != 0 || model.RoomStatus != "")
     //{
     Account AccountModel = new Account();
     AccountModel.username = User.Identity.Name;
     AccountRepository _accountRepository = new AccountRepository(AccountModel);
     model.UserID = _accountRepository.getData().ID;
     RoomRepository _RoomRepository = new RoomRepository(model);
     _RoomRepository.InsertRoomData();
     return RedirectToAction("RoomlistOwner","MY");
     //}
     //else
     //{
     //    ViewData["MSGREGISTER"] = "Please Input All The Data!!!";
     //    return View();
     //}
 }
Пример #12
0
        public ActionResult SearchResultDetail(Int64 ID)
        {
            Room room = new Room();
            room.RoomID = ID;
            RoomRepository _RoomRepository = new RoomRepository(room);

            return View(_RoomRepository.GetRoomData());
        }
Пример #13
0
 public ActionResult RoomList()
 {
     Room model = new Room();
      List<Room> modelList = new List<Room>();
      RoomRepository _RoomAccountRepository = new RoomRepository(model);
      modelList = _RoomAccountRepository.getRoomList();
      return View(modelList);
 }
Пример #14
0
 public ActionResult RoomDeleteData(Room model)
 {
     RoomRepository _RoomRepository = new RoomRepository(model);
     _RoomRepository.DeleteRoomData();
     return RedirectToAction("RoomlistOwner","MY");
 }
Пример #15
0
        public ActionResult MakeReservations(Int64 RoomID)
        {
            Room model = new Room();
            model.RoomID = RoomID;
            RoomRepository _roomRepository = new RoomRepository(model);

            Reservation _ReservationtModel = new Reservation();
            _ReservationtModel.RoomID = _roomRepository.getdata().RoomID;
            _ReservationtModel.RoomAccount = _roomRepository.getdata();
            Account AccountModel = new Account();
            AccountModel.username = User.Identity.Name;
            AccountRepository _accountRepository = new AccountRepository(AccountModel);
            _ReservationtModel.UserID = _accountRepository.getData().ID;
            return View(_ReservationtModel);
        }