Ejemplo n.º 1
0
    //private int InsertBookingTableData()
    //{
    //    try
    //    {

    //        //  blsr._sBookingRef = txtBookRef.Text.Trim().ToString();
    //        blsr._dtStartDate = Convert.ToDateTime(txtChkin.Text.Trim());
    //        blsr._dtEndDate = Convert.ToDateTime(txtChkOut.Text.Trim());


    //        Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
    //        Int32.TryParse(Session["AccomTypeId"].ToString(), out iaccomtypeid);
    //        Int32.TryParse(Session["Agid"].ToString(), out iagentid);
    //        blsr._iAccomTypeId = iaccomtypeid;
    //        blsr._iAccomId = iAccomId;
    //        blsr._iAgentId = iagentid;
    //        //Convert.ToInt32(Session["UserCode"].ToString());
    //        blsr._iNights = Convert.ToInt32((Convert.ToDateTime(txtChkOut.Text.Trim()) - Convert.ToDateTime(txtChkin.Text.Trim())).TotalDays);
    //        DataTable dtRoomBookingDetails = ViewState["VsRoomDetails"] as DataTable;
    //        blsr._iPersons = Convert.ToInt32(dtRoomBookingDetails.Compute("SUM(Pax)", string.Empty));
    //        blsr._BookingStatusId = 1;
    //        blsr._SeriesId = 0;
    //        blsr._proposedBooking = false;
    //        blsr._chartered = false;
    //        int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
    //        if (GetQueryResponse > 0)
    //            return 1;
    //        else
    //            return 0;
    //    }
    //    catch
    //    {
    //        return 0;
    //    }
    //}



    //private int InsertRoomBookingTableData()
    //{



    //    Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
    //    blsr._iAccomId = iAccomId;

    //    blsr.action = "getMaxBookId";



    //    DataTable dtmaxId = dlsr.GetMaxBookingId(blsr);

    //    int MaxBookingId = Convert.ToInt32(dtmaxId.Rows[0].ItemArray[0].ToString());
    //    //  BookedId = MaxBookingId;
    //    blsr._iBookingId = MaxBookingId;
    //    int LoopInsertStatus = 0;
    //    try
    //    {

    //        for (int LoopCounter = 0; LoopCounter < gdvSelectedRooms.Rows.Count; LoopCounter++)
    //        {

    //            blsr._dtStartDate = Convert.ToDateTime(txtChkin.Text.Trim());
    //            blsr._dtEndDate = Convert.ToDateTime(txtChkOut.Text.Trim());
    //            blsr._iPaxStaying = Convert.ToInt32(gdvSelectedRooms.Rows[LoopCounter].Cells[3].Text);
    //            blsr._bConvertTo_Double_Twin = false;
    //            blsr._cRoomStatus = "B";
    //            HiddenField hfnrm = (HiddenField)gdvSelectedRooms.Rows[LoopCounter].FindControl("hdnRmno");


    //            blsr._sRoomNo = hfnrm.Value.ToString();
    //            //   blsr.action = "AddPriceDetailsToo";
    //            blsr._Amt = Convert.ToDecimal(gdvSelectedRooms.Rows[LoopCounter].Cells[4].Text);

    //            int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
    //            if (GetQueryResponse > 0)
    //                LoopInsertStatus++;
    //            else
    //            {
    //                //do nothing
    //            }


    //        }
    //        //   insertbookingMealData(MaxBookingId);
    //        if (LoopInsertStatus == gdvSelectedRooms.Rows.Count)
    //        {

    //            return 1;
    //        }
    //        else
    //            return
    //                0;



    //    }
    //    catch
    //    {
    //        return 0;
    //    }


    //}

    protected void Button2_Click(object sender, EventArgs e)
    {
        try
        {
            Session["HotelBokingUrl"] = Request.Url.ToString();


            Int32.TryParse(Session["AcId"].ToString(), out iAccomId);
            Int32.TryParse(Session["AccomTypeId"].ToString(), out iaccomtypeid);

            DataTable fg = ViewState["VsRoomDetails"] as DataTable;
            SessionServices.SaveSession <DataTable>("Bookingdt", fg);

            Session["Chkin"]  = Session["HCheckin"].ToString();
            Session["chkout"] = Session["HCheckout"].ToString();
            //   Session["BookRef"] = txtBookRef.Text.Trim();
            Session["AccomId"]      = iAccomId;
            Session["iAccomtypeId"] = iaccomtypeid;
            Session["AId"]          = Session["Agid"].ToString();
            if (Session["RedUrl"] == null)
            {
                string redurl = "AfterBookingDetails.aspx?AccomName=" + Request.QueryString["AccomName"].ToString() + "";
                Session["RedUrl"] = redurl;
            }

            Response.Redirect(Session["RedUrl"].ToString());
        }
        catch
        {
        }
    }
    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;
        }
    }
Ejemplo n.º 3
0
    private void bindRoomRates(int accmid, int Totpax, int agid, DateTime chkin, DateTime chkout, int norooms, int RtypeId)
    {
        try
        {
            if (Session["UserCode"] != null)
            {
                blht.action = "RoomRate";
            }
            else
            {
                blht.action = "RoomRateCust";
            }
            blht.Accomid      = accmid;
            blht.TotPax       = Totpax;
            blht.Reqnoofrooms = norooms;
            blht.checkin      = chkin;
            blht.Checkout     = chkout;
            blht.RoomTypeId   = RtypeId;

            blht.agentid = agid;
            Returndt     = dlht.GetHotelRates(blht);

            if (Returndt != null)
            {
                SessionServices.SaveSession <DataTable>("RoomInfo", Returndt);
                dv = new DataView(Returndt);
                //  dv.RowFilter = "ActualRoomTypeId<>0";

                if (dv.ToTable().Rows.Count > 0)
                {
                    gdvHotelRoomRates.DataSource = dv;
                    gdvHotelRoomRates.DataBind();
                    //avl.InnerHtml = "Available Rooms";
                }
                else
                {
                    //avl.InnerHtml = "No Rooms Available";
                    RemoveZeroes();
                }
                ViewState["Rrate"] = Returndt;
            }
        }
        catch
        {
        }
    }