示例#1
0
    private void PopulateCFormReport(int bookingId)
    {
        BookingReportServices bookingReportManager;
        CFormReportDTO        cFormReportDto;
        Table tblTouristDetails;
        Table tblGroupDetails;

        #region Get Tourist List
        bookingReportManager = new BookingReportServices();
        if (CFormType.ToUpper() == "FN")
        {
            cFormReportDto = bookingReportManager.GetCFormDataForForeignNationals(bookingId);
        }
        else if (CFormType.ToUpper() == "IN")
        {
            cFormReportDto = bookingReportManager.GetCFormDataForIndianNationals(bookingId);
        }
        else
        {
            cFormReportDto = bookingReportManager.GetCFormData(bookingId);
        }
        #endregion

        #region Validate Tourist List
        if (cFormReportDto.BookingTouristDetails == null || cFormReportDto.BookingTouristDetails.Length == 0)
        {
            string msg = string.Empty;
            if (CFormType.ToUpper() == "FN")
            {
                msg = "Please add foreign national tourists in this booking, before generating the C-Form report.";
            }
            else if (CFormType.ToUpper() == "IN")
            {
                msg = "Please add indian national tourists in this booking, before generating the C-Form report.";
            }
            else
            {
                msg = "Please add tourists in this booking, before generating the C-Form report.";
            }
            base.DisplayAlert(msg);
            return;
        }
        #endregion

        #region Populate HTML Controls
        tblTouristDetails = PopulateTouristDetailsTable(cFormReportDto);
        pnlTouristDetails.Controls.Add(tblTouristDetails);

        tblGroupDetails = PopulateGroupDetailsTable(cFormReportDto);
        pnlGroupDetails.Controls.Add(tblGroupDetails);
        #endregion

        PopulateLabels(cFormReportDto);
    }
示例#2
0
    private void RefreshGrid()
    {
        BookingReportServices     bookingReportManager = new BookingReportServices();
        List <clsTouristCountDTO> touristCountDto = null;
        DateTime checkInDate, checkOutDate;

        DateTime.TryParse(txtStartDate.Text, out checkInDate);
        DateTime.TryParse(txtEndDate.Text, out checkOutDate);

        int AccomTypeId = 0;

        Int32.TryParse(ddlAccomType.SelectedValue.ToString(), out AccomTypeId);

        if (AccomTypeId <= 0)
        {
            AccomTypeId = 0;                   //To handle the -1 value of Choose option.
        }
        if (SessionServices.TouristCount_BookingData == null)
        {
            if (checkInDate != DateTime.MinValue && checkOutDate != DateTime.MinValue)
            {
                touristCountDto = bookingReportManager.GetTouristCount(checkInDate, checkOutDate, AccomTypeId, 0);
                SessionServices.TouristCount_BookingData = touristCountDto;
            }
        }
        else
        {
            touristCountDto = SessionServices.TouristCount_BookingData;
        }

        dgTouristCount.DataSource = null;
        dgTouristCount.DataBind();
        if (touristCountDto != null && touristCountDto.Count > 0)
        {
            dgTouristCount.DataSource = touristCountDto;
            dgTouristCount.DataBind();
        }
        else
        {
            dgTouristCount.DataSource = null;
            dgTouristCount.DataBind();
            if (IsPostBack)
            {
                base.DisplayAlert("Bookings are not found for the mentioned criteria.");
            }
        }

        bookingReportManager = null;
        touristCountDto      = null;
    }
    private void ShowOtherBookings(string RoomNo, DateTime StartDate, DateTime EndDate)
    {
        BookingRoomReportsDTO[] oBRRD = null;
        BookingReportServices   oBRM  = new BookingReportServices();

        oBRRD = oBRM.GetOtherBookingsOfThisRoom(RoomNo, StartDate, EndDate);
        if (oBRRD != null)
        {
            if (oBRRD.Length > 0)
            {
                PrepareBookingReport(oBRRD);
            }
        }
    }