public ActionResult PrintItineary(long?id)
        {
            HotelBookingRecordRepository _rep   = new HotelBookingRecordRepository();
            HotelItinearyModel           _model = new HotelItinearyModel();

            _model = _rep.Itineary(id);
            return(View(_model));
        }
        public ActionResult CancellationEmail(long?BookingRecordId)
        {
            HotelBookingRecordRepository _rep   = new HotelBookingRecordRepository();
            HotelItinearyModel           _model = new HotelItinearyModel();
            HotelMessageModel            _msg   = new HotelMessageModel();

            _model = _rep.CancelEmailFormat(BookingRecordId);
            return(View(_model));
        }
        public ActionResult Index(ExportModel Expmodel, HotelBookingRecordModel model, FormCollection frm, int?page)
        {
            HotelBookingRecordRepository _rep = new HotelBookingRecordRepository();
            HotelMessageModel            msg  = new HotelMessageModel();

            HotelGeneralRepository.SetRequestPageRow();

            model.TabularList = _rep.GetPagedList(page);
            GetExportTypeClicked(Expmodel, frm);

            if (Expmodel != null &&
                (Expmodel.ExportTypeExcel != null ||
                 Expmodel.ExportTypeWord != null ||
                 Expmodel.ExportTypeCSV != null ||
                 Expmodel.ExportTypePdf != null))
            {
                try
                {
                    if (Expmodel.ExportTypeExcel != null)
                    {
                        Expmodel.ExportTypeExcel = Expmodel.ExportTypeExcel;
                    }
                    else if (Expmodel.ExportTypeWord != null)
                    {
                        Expmodel.ExportTypeWord = Expmodel.ExportTypeWord;
                    }
                    else if (Expmodel.ExportTypePdf != null)
                    {
                        Expmodel.ExportTypePdf = Expmodel.ExportTypePdf;
                    }

                    var exportData = _rep.List().Select(m => new
                    {
                        SNo          = m.SNo,
                        GuestName    = m.GuestName,
                        Location     = m.CityName + "" + m.CountryName,
                        HotelDetails = m.HotelName,
                        Rooms        = m.NoOfRoom,
                        CheckIn      = m.CheckInDate.ToString("MM/dd/yyyy"),
                        CheckOut     = m.CheckOutDate.ToString("MM/dd/yyyy"),
                        BookingDate  = m.CreatedDate.ToString("MM/dd/yyyy"),
                        Status       = m.TicketStatus
                    });

                    App_Class.AppCollection.Export(Expmodel, exportData, "HotelBookingRecord");
                }
                catch (Exception ex)
                {
                    ATLTravelPortal.Utility.ErrorLogging.LogException(ex);
                }
            }
            return(View(model));
        }
        public ActionResult Index(int?page)
        {
            HotelBookingRecordModel      _model = new HotelBookingRecordModel();
            HotelBookingRecordRepository _rep   = new HotelBookingRecordRepository();
            HotelMessageModel            msg    = new HotelMessageModel();

            HotelGeneralRepository.SetRequestPageRow();
            _model.Message     = msg;
            _model.TabularList = _rep.GetPagedList(page);

            return(View(_model));
        }
        public ActionResult EmailCancel(long?id, string emal)
        {
            HotelBookingRecordRepository _rep   = new HotelBookingRecordRepository();
            HotelItinearyModel           _model = new HotelItinearyModel();
            HotelMessageModel            _msg   = new HotelMessageModel();

            if (ATLTravelPortal.Areas.Hotel.Repository.HotelGeneralRepository.ValidateEmail(emal) == false)
            {
                _msg.ActionMessage = "Invalid Email address.";
                _msg.MsgNumber     = 1001;
                _msg.MsgStatus     = true;
                _msg.MsgType       = 3;
                _model.Message     = _msg;
            }
            else
            {
                _model = _rep.CancelEmailFormat(id);
                if (_model.Message.MsgNumber == 1)
                {
                    List <string> emailList = new List <string>();
                    emailList.Add(emal);
                    if (_model.Itineary.GuestEmail != emal)
                    {
                        emailList.Add(_model.Itineary.GuestEmail);
                    }
                    string            body      = RenderPartialViewToString("VUC_CancellationEmail", _model);
                    GeneralRepository gProvider = new GeneralRepository();
                    //use ohter way to send email.
                    var    agent   = gProvider.GetAgentInfo(GeneralRepository.LoggedAgentId());
                    string emailId = agent.Email + "," + emal;
                    string subject = "Hotel Booking Cancellation #: " + _model.Itineary.HotelName + ", " + _model.Itineary.CityName + ", " + _model.Itineary.CountryName;
                    string HTML    = HotelGeneralRepository.sendQuotation(emailId, subject, body, "", false);
                    _msg.ActionMessage = "Booking Cancellation Email has been sent.";
                    _msg.MsgNumber     = 1;
                    _msg.MsgStatus     = true;
                    _msg.MsgType       = 0;
                    _model.Message     = _msg;
                }
            }
            return(PartialView("Utility/VUC_Message", _model.Message));
        }
        public ActionResult EmailItinerary(long?id, string emal)
        {
            HotelBookingRecordRepository _rep   = new HotelBookingRecordRepository();
            HotelItinearyModel           _model = new HotelItinearyModel();
            HotelMessageModel            _msg   = new HotelMessageModel();

            if (ATLTravelPortal.Areas.Hotel.Repository.HotelGeneralRepository.ValidateEmail(emal) == false)
            {
                _msg.ActionMessage = "Invalid Email address.";
                _msg.MsgNumber     = 1001;
                _msg.MsgStatus     = true;
                _msg.MsgType       = 3;
                _model.Message     = _msg;
            }
            else
            {
                _model = _rep.Itineary(id);
                if (_model.Message.MsgNumber == 1)
                {
                    List <string> emailList = new List <string>();
                    emailList.Add(emal);
                    if (_model.Itineary.GuestEmail != emal)
                    {
                        emailList.Add(_model.Itineary.GuestEmail);
                    }
                    string body = RenderPartialViewToString("Common/VUC_Itinerary", _model);
                    //use ohter way to send email.
                    string subject = "Hotel Booking Itinerary Ref No : " + _model.BookingRecordId + "#" + _model.Itineary.BookingId + "#" + _model.Itineary.ConfirmationNo + "# " + _model.Itineary.HotelName + ", " + _model.Itineary.CityName + ", " + _model.Itineary.CountryName;
                    HotelGeneralRepository.sendEmial(emal, "", "", subject, body, "HTML", "");
                    _msg.ActionMessage = "Itinerary has been sent.";
                    _msg.MsgNumber     = 1;
                    _msg.MsgStatus     = true;
                    _msg.MsgType       = 0;
                    _model.Message     = _msg;
                }
            }
            return(PartialView("Utility/VUC_Message", _model.Message));
        }