示例#1
0
    public DataTable loadbookingDetails(string Packagename, int bookingId, int pax, string roomno, string paymentmethod, DateTime chekindate, DateTime chekoutdate, string packageid, int totpax, int roomcatid, int noOfnight)
    {
        decimal    amount  = 0;
        BALBooking booking = dlsr.GetBookingDetails(bookingId);
        DataTable  dt      = bindRoomRates(chekindate, packageid, totpax);
        DataView   dv      = new DataView(dt);

        dv = new DataView(dt, "roomcategoryid='" + roomcatid + "'", "roomcategoryid", DataViewRowState.CurrentRows);
        DataTable dt1   = dv.ToTable();
        DataTable dtNew = new DataTable();

        dtNew.Columns.Add("Packagename", typeof(string));
        dtNew.Columns.Add("BookingId", typeof(int));
        dtNew.Columns.Add("Totalguest", typeof(int));
        dtNew.Columns.Add("CheckInDate", typeof(string));
        dtNew.Columns.Add("CheckOutDate", typeof(String));
        dtNew.Columns.Add("NoOFNights", typeof(int));
        dtNew.Columns.Add("TotalPrice", typeof(Decimal));
        dtNew.Columns.Add("RoomType", typeof(String));
        dtNew.Columns.Add("Cabincategory", typeof(String));
        dtNew.Columns.Add("DefaultNoOfBed", typeof(string));
        if (dt1.Rows[0]["RmType"].ToString() == "Twin")
        {
            //string strContent = dt1.Rows[0]["Price Per Person on Twin Sharing inclusive of taxes"].ToString().Replace("INR", string.Empty);
            amount = Convert.ToDecimal(dt1.Rows[0]["Price Per Person on Twin Sharing inclusive of taxes"].ToString().Replace("INR", string.Empty)) * Convert.ToDecimal(totpax);
        }
        else if (dt1.Rows[0]["RmType"].ToString() == "Double")
        {
            amount = Convert.ToDecimal(dt1.Rows[0]["Price Per Person on Twin Sharing inclusive of taxes"].ToString().Replace("INR", string.Empty)) * Convert.ToDecimal(totpax);
        }
        dtNew.Rows.Add(Packagename, bookingId, pax, chekindate, chekoutdate, noOfnight, amount, dt1.Rows[0]["RmType"].ToString(), dt1.Rows[0]["Cabin Category"].ToString(), dt1.Rows[0]["DefaultNoOfBeds"].ToString());
        return(dtNew);
    }
示例#2
0
    public void InsertChildTableData(int bookingId, int pax, string roomno, string paymentmethod, DateTime chekindate, string packageid, int totpax, int roomcatid)
    {
        BALBooking blsr = new BALBooking();
        DALBooking dlsr = new DALBooking();

        BALBooking booking = dlsr.GetBookingDetails(bookingId);
        DataTable  dt      = bindRoomRates(chekindate, packageid, totpax);
        DataView   dv      = new DataView(dt);

        dv = new DataView(dt, "roomcategoryid='" + roomcatid + "'", "roomcategoryid", DataViewRowState.CurrentRows);
        DataTable dt1 = dv.ToTable();

        if (booking != null)
        {
            //DataTable GridRoomPaxDetail = SessionServices.RetrieveSession<DataTable>("BookedRooms");
            int LoopInsertStatus = 0;
            try
            {
                blsr._iBookingId = bookingId;

                blsr._iAccomId    = booking._iAccomId;
                blsr._dtStartDate = booking._dtStartDate;
                blsr._dtEndDate   = booking._dtEndDate;
                blsr._iPaxStaying = pax;
                if (dt1.Rows[0]["RmType"].ToString() == "Twin")
                {
                    blsr._bConvertTo_Double_Twin = dt1.Rows[0]["RmType"].ToString() == "Twin" ? true : false;
                    //string strContent = dt1.Rows[0]["Price Per Person on Twin Sharing inclusive of taxes"].ToString().Replace("INR", string.Empty);
                    blsr._Amt = Convert.ToDecimal(dt1.Rows[0]["Price Per Person on Twin Sharing inclusive of taxes"].ToString().Replace("INR", string.Empty)) * Convert.ToDecimal(totpax);
                }
                else if (dt1.Rows[0]["RmType"].ToString() == "Double")
                {
                    blsr._bConvertTo_Double_Twin = dt1.Rows[0]["RmType"].ToString() == "Double" ? true : false;
                }
                blsr._cRoomStatus = "B";
                blsr._sRoomNo     = roomno;
                blsr.action       = "AddPriceDetailsToo";
                string BookingPayId = paymentmethod.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                blsr.PaymentId = BookingPayId;
                //blsr._Amt = Convert.ToDecimal(GridRoomPaxDetail.Rows[LoopCounter]["Price"].ToString());

                int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
                if (GetQueryResponse > 0)
                {
                    LoopInsertStatus++;
                }
            }
            catch (Exception e)
            {
                throw;
            }
        }
    }
    private int InsertBookingTableData(int acmid, int acmtpid, int agid, string bkref, DateTime cin, DateTime cout)
    {
        try
        {
            BALBooking blsr = new BALBooking();
            DALBooking dlsr = new DALBooking();

            DataTable dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            blsr._sBookingRef = bkref;
            blsr._dtStartDate = cin;
            blsr._dtEndDate   = cout;

            if (Session["CustId"] != null && Session["UserCode"] == null)
            {
                blsr.CustomerId = Session["CustId"].ToString();
            }
            else
            {
                blsr.CustomerId = "0";
            }

            blsr._iAccomTypeId = acmtpid;
            blsr._iAccomId     = acmid;
            blsr._iAgentId     = agid;

            blsr._iNights         = Convert.ToInt32((cout - cin).TotalDays);
            blsr._iPersons        = Convert.ToInt32(dtbkdetails.Compute("SUM(Pax)", string.Empty));
            blsr._BookingStatusId = 1;
            blsr._SeriesId        = 0;
            blsr._proposedBooking = false;
            blsr._chartered       = false;
            blsr._BookingStatusId = (int)BookingStatusTypes.BOOKED;
            blsr._proposedBooking = true;

            int bookingId = dlsr.AddParentBookingDetail(blsr);

            var bookingDetails = dlsr.GetBookingDetails(bookingId);
            if (bookingDetails != null)
            {
                blsr.BookingCode = bookingDetails.BookingCode;
            }
            blsr._iBookingId = bookingId;

            //Session["tblBookingBAL"] = blsr;
            SessionServices.SaveSession <BALBooking>("tblBookingBAL", blsr);
            return(bookingId);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    private int InsertRoomBookingTableData(int bookingId, string bookingPaymentId)
    {
        try
        {
            BALBooking blsr = new BALBooking();
            DALBooking dlsr = new DALBooking();

            DataTable  dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            BALBooking booking     = dlsr.GetBookingDetails(bookingId);

            Session["maxBookId"] = bookingId;

            blsr._iBookingId = bookingId;
            blsr._iAccomId   = booking._iAccomId;
            blsr.PaymentId   = bookingPaymentId;

            //int LoopInsertStatus = 0;
            for (int LoopCounter = 0; LoopCounter < dtbkdetails.Rows.Count; LoopCounter++)
            {
                blsr._dtStartDate            = booking._dtStartDate;
                blsr._dtEndDate              = booking._dtEndDate;
                blsr._iPaxStaying            = booking._iPaxStaying;
                blsr._bConvertTo_Double_Twin = Convert.ToBoolean(dtbkdetails.Rows[LoopCounter]["ConvDouble"].ToString());
                blsr._cRoomStatus            = "B";

                blsr._sRoomNo    = dtbkdetails.Rows[LoopCounter][7].ToString();
                blsr._PaidAmount = Convert.ToDouble(Session["Paid"]);

                blsr.action = "AddPriceDetailsToo";
                string[] arr = dtbkdetails.Rows[LoopCounter]["Total"].ToString().Split(' ');
                blsr._Amt = Convert.ToDecimal(arr[1]);

                int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
            }
            return(1);
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('" + ex.Message.ToString() + "')", true);
            throw ex;
        }
    }