Esempio n. 1
0
        public ActionResult Index()
        {
            string rescode = "";

            //Lấy list phong
            TempData["room"] = new SelectList(db1.GetList_Room(1), "Value", "Name");
            //Lấy list country
            TempData["country"] = new SelectList(db1.GetList_Country(1), "Value", "Name", 238);

            if (true)
            {
                try
                {
                    if (Session[CConfig.SESSION_USERID] != null && Session[CConfig.SESSION_HOTELCODE].ToString() != null)
                    {
                        ReservationRoomModel reservation = new ReservationRoomModel();
                        reservation.HotelCode = Session[CConfig.SESSION_HOTELCODE].ToString();
                        reservation.Activity  = "RESERVATIONCODE";

                        if (db.GenResCode(reservation, ref rescode))
                        {
                            if (rescode.Length < 1)
                            {
                                TempData["ResCode"] = reservation.HotelCode + "000001";
                            }
                            else
                            {
                                TempData["ResCode"] = rescode;
                            }
                        }
                        else
                        {
                            TempData["ResCode"] = "";
                        }
                    }
                    TempData.Keep("ResCode");
                }
                catch (Exception ex)
                {
                    rescode = ex.Message;
                }
            }
            return(View());
        }