public void calcamt(DataTable dts)
    {
        try
        {
            for (int j = 0; j < dts.Rows.Count; j++)
            {
                string[] arr = dts.Rows[j]["Total"].ToString().Split(' ');

                TotalPaybleAmt = TotalPaybleAmt + Convert.ToInt32(arr[1]);;
            }
            hdnfTotalPaybleAmt.Value = TotalPaybleAmt.ToString();

            txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
            Bookingdt       = SessionServices.RetrieveSession <DataTable>("Bookingdt");

            lbltotAmt.Text     = Bookingdt.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
            lblCurrency.Text   = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " ";
            txtPaidAmt.Text    = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##");
            hftxtpaidamt.Value = Convert.ToDouble(txtPaidAmt.Text).ToString("N2").Replace(",", "");

            lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + Math.Round((TotalPaybleAmt - Convert.ToDouble(txtPaidAmt.Text))).ToString();

            //   lbltotAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
        }

        catch
        {
        }
    }
    protected void btnCustLogin_Click(object sender, EventArgs e)
    {
        try
        {
            blcus.Email    = txtCustMailId.Text.Trim();
            blcus.Password = txtCustPass.Text.Trim();
            blcus.action   = "LoginCust";

            DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
            if (dtCustomer != null)
            {
                if (dtCustomer.Rows.Count > 0)
                {
                    Session["CustMailId"] = txtCustMailId.Text.Trim();


                    ViewState["Pass"]      = txtCustPass.Text.Trim();
                    lblBillingAddress.Text = dtCustomer.Rows[0]["BillingAddress"].ToString();


                    lblAgentName.Text     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lbPaymentMethod.Text  = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["PaymentMethod"].ToString());
                    hdnfPhoneNumber.Value = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Telephone"].ToString());

                    Session["CustId"]       = dtCustomer.Rows[0]["CustId"].ToString();
                    Session["CustomerCode"] = dtCustomer.Rows[0]["CustId"].ToString();

                    Session.Add("CustomerMailId", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Email"].ToString()));
                    Session.Add("CustPassword", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Password"].ToString()));
                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString()) + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Self";
                    ViewState["BookRef"] = BookRef;
                    lbPaymentMethod.Text = "N/A";


                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                    pnlBookButton.Visible           = true;
                    customerLogin.Visible           = false;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
            }
            //Bookingdt = Session["Bookingdt"] as DataTable;
            //  preparetables(Bookingdt);
        }
        catch
        {
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
        gdvSelectedRooms.DataSource = Bookingdt;
        gdvSelectedRooms.DataBind();
        lblArrvDate.Text   = Session["Chkin"].ToString();
        lblDepartDate.Text = Session["chkout"].ToString();;
        lblacm.Text        = lblAccomName.Text = Session["AccomName"].ToString();

        CalcAmount();
        getbalance();
    }
    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;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UserCode"] != null || Session["CustomerCode"] != null)
            {
                if (Session["UserCode"] != null)
                {
                    BookRef.Style.Remove("display");
                    ReqBookRef.Enabled = true;
                }
                else
                {
                    BookRef.Style.Add("display", "None");
                    ReqBookRef.Enabled = false;
                }
                lnkLogout.Visible = true;
            }
            else
            {
                BookRef.Style.Add("display", "None");

                ReqBookRef.Enabled = false;
                lnkLogout.Visible  = false;
            }
            this.pnlLogin.Visible           = false;
            this.pnlFullDetails.Visible     = false;
            pnlBookButton.Visible           = false;
            panelwithoutCreditAgent.Visible = false;
            Bookingdt     = new DataTable();
            Bookingdt     = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            bookingmealdt = new DataTable();
            bookingmealdt = SessionServices.RetrieveSession <DataTable>("BookinMealdt");
            gdvSelectedRooms.DataSource = Bookingdt;
            gdvSelectedRooms.DataBind();

            //lblChkin.Text = Session["Chkin"].ToString();
            //lblChkout.Text = Session["chkout"].ToString();

            calcamt(Bookingdt);
            LoadCountries();

            pnlCustReg.Visible    = false;
            customerLogin.Visible = false;
        }

        Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
        preparetables(Bookingdt);
    }
    public void calcamt(DataTable dts)
    {
        try
        {
            for (int j = 0; j < dts.Rows.Count; j++)
            {
                string[] arr = dts.Rows[j]["Total"].ToString().Split(' ');

                TotalPaybleAmt = TotalPaybleAmt + Convert.ToInt32(arr[1]);;
            }
            hdnfTotalPaybleAmt.Value = TotalPaybleAmt.ToString();

            Bookingdt        = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            lbltotAmt.Text   = Bookingdt.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
            lblCurrency.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " ";

            DateTime checkInDate = Convert.ToDateTime(Session["Chkin"]);
            double   paidAmt     = 0;
            if (checkInDate.AddDays(-30) < System.DateTime.Now)
            {
                //txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
                txtPaidAmt.Text = Math.Round(((100 * TotalPaybleAmt) / 100)).ToString("#.##");
                paidAmt         = Math.Round(((100 * TotalPaybleAmt) / 100));
            }
            else
            {
                //txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("N2");
                txtPaidAmt.Text = Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##") + " (25 % of total)";
                paidAmt         = Math.Round(((25 * TotalPaybleAmt) / 100));
            }

            hftxtpaidamt.Value = paidAmt.ToString("N2").Replace(",", "");
            double balanceAmt = Math.Round((TotalPaybleAmt - paidAmt));

            if (balanceAmt > 0)
            {
                lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + balanceAmt.ToString() + " (75% of total) to be paid prior to " + checkInDate.AddDays(-30).ToString("MMM-dd-yyyy");
            }
            else
            {
                lblBalanceAmt.Text = Bookingdt.Rows[0]["Currency"].ToString().ToString() + " " + balanceAmt.ToString();
            }
            //   lbltotAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + TotalPaybleAmt.ToString();
        }
        catch
        {
        }
    }
Esempio n. 7
0
    private void InsertParentTableData()
    {
        try
        {
            if (Session["UserCode"] != null)
            {
                blsr._iAgentId = Convert.ToInt32(Session["UserCode"].ToString());
            }
            else
            {
                blsr._iAgentId = Convert.ToInt32(Session["CustId"].ToString());
            }


            blsr.action        = "GetDepartureDetails";
            blsr._iBookingId   = 0;
            blsr.PackageId     = Session["PackageId"].ToString();
            dtGetReturnedData  = dlsr.GetDepartureDetails(blsr);
            blsr._sBookingRef  = Session["BookingRef"].ToString();
            blsr._dtStartDate  = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckInDate"]);
            blsr._dtEndDate    = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckOutDate"]);
            blsr._iAccomTypeId = Convert.ToInt32(dtGetReturnedData.Rows[0]["AccomTypeId"]);
            blsr._iAccomId     = Convert.ToInt32(dtGetReturnedData.Rows[0]["AccomId"]);

            blsr._iNights = Convert.ToInt32(dtGetReturnedData.Rows[0]["NoOfNights"]);
            DataTable dtRoomBookingDetails = SessionServices.RetrieveSession <DataTable>("BookedRooms");
            blsr._iPersons        = Convert.ToInt32(dtRoomBookingDetails.Compute("SUM(Pax)", string.Empty));
            blsr._BookingStatusId = 1;
            blsr._SeriesId        = 0;
            blsr._proposedBooking = false;
            blsr._chartered       = false;
            Session.Add("tblBookingBAL", blsr);

            int iBRC = dlsr.GetBookingReferenceCount(blsr);

            if (iBRC > 0)
            {
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('The Booking Reference mentioned by you is not unique. Please enter a different reference number.');", true);

                return;
            }

            int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
        }
        catch
        {
        }
    }
Esempio n. 8
0
    protected void gdvSelectedRooms_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            try
            {
                retdt = SessionServices.RetrieveSession <DataTable>("RoomInfo");
                Label roomcatid = (Label)e.Row.FindControl("lblRoomCatId");

                DataView dv = new DataView(retdt);
                dv.RowFilter        = "RoomCategoryId='" + roomcatid.Text + "' ";
                e.Row.Cells[7].Text = dv.ToTable().Rows[0]["TaxPct"].ToString();
                e.Row.Cells[8].Text = ((Convert.ToDouble(e.Row.Cells[7].Text) * Convert.ToDouble(e.Row.Cells[6].Text)) / 100).ToString();
            }
            catch
            {
            }
        }
    }
    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;
        }
    }
Esempio n. 10
0
    private int InsertBookingTableData(int acmid, int acmtpid, int agid, string bkref, DateTime cin, DateTime cout, DataTable vsdetails)
    {
        try
        {
            dtbkdetails = SessionServices.RetrieveSession <DataTable>("Bookingdt");

            blsr._sBookingRef = bkref;
            blsr._dtStartDate = cin;
            blsr._dtEndDate   = cout;


            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;



            int GetQueryResponse = dlsr.AddParentBookingDetail(blsr);
            if (GetQueryResponse > 0)
            {
                return(1);
            }

            else
            {
                return(0);
            }
        }
        catch (Exception ex)
        {
            return(0);
        }
    }
    private void LoadBookedRoomDetails()
    {
        dtGetBookedRooms = SessionServices.RetrieveSession<DataTable>("BookedRooms");
        DataTable dtgroupedData = new DataTable();
        dtgroupedData.Columns.Add("categoryName");
        dtgroupedData.Columns.Add("Pax");
        dtgroupedData.Columns.Add("Price");
        DataTable dtUniqueCategories = dtGetBookedRooms.DefaultView.ToTable(true, "categoryName");

        #region Adding distict Room categories
        foreach (DataRow dr1 in dtUniqueCategories.Rows)
        {
            string categoryName = dr1["categoryName"].ToString();
            DataRow dr2 = dtgroupedData.NewRow();
            dr2["categoryName"] = categoryName;
            dtgroupedData.Rows.Add(dr2);
        }
        #endregion

        #region calculating values
        foreach (DataRow dr1 in dtgroupedData.Rows)
        {
            string category = dr1["categoryName"].ToString();
            DataView dv;
            dv = new DataView(dtGetBookedRooms, "categoryName='" + category + "'", "categoryName", DataViewRowState.CurrentRows);
            DataTable dtFiltered = dv.ToTable();
            int packs = 0;
            decimal price = 0;
            foreach (DataRow dr3 in dtFiltered.Rows)
            {
                packs = packs + Convert.ToInt32(dr3["Pax"].ToString());
                price = price + Convert.ToDecimal(dr3["Price"].ToString());
            }
            dr1["Pax"] = packs.ToString();


            dr1["Price"] = price.ToString();
        }
        dtGetBookedRooms = dtgroupedData;
        #endregion
    }
Esempio n. 12
0
    private int InsertRoomBookingTableData(DataTable dtbooking, DateTime cin, DateTime cout, int acmid)
    {
        try
        {
            dtbkdetails    = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            blsr._iAccomId = acmid;

            blsr.action = "getMaxBookId";
            DataTable dtmaxId = dlsr.GetMaxBookingId(blsr);

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

            Session["maxBookId"] = MaxBookingId;
            int LoopInsertStatus = 0;

            for (int LoopCounter = 0; LoopCounter < dtbkdetails.Rows.Count; LoopCounter++)
            {
                blsr._dtStartDate            = cin;
                blsr._dtEndDate              = cout;
                blsr._iPaxStaying            = Convert.ToInt32(dtbooking.Rows[LoopCounter][3].ToString());
                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]);


                blsr.PaymentId = Session["BookingPayId"].ToString();
                int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);

                if (GetQueryResponse > 0)
                {
                    LoopInsertStatus++;
                }
                else
                {
                }
            }

            DataTable Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
            //Response.Write(Bookingdt.Rows[0]["Total1"].ToString());

            //gdvSelectedRooms.DataSource = Bookingdt;
            //gdvSelectedRooms.DataBind();

            //gdvSelectedRooms.FooterRow.Cells[1].Text = "Total </br> Service Tax @ 4.50% </br> <b> Grand Total </b> ";

            //gdvSelectedRooms.FooterRow.Cells[3].Text = Math.Round(Convert.ToDouble(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0"))).ToString("#.##") + "</br> " + Math.Round((4.5 * (Convert.ToInt32(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0")) / 100))).ToString("#.##") + " </br> " + Math.Round((Convert.ToDouble(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0")) + (4.5 * (Convert.ToInt32(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0")) / 100)))).ToString("#.##");
            //Response.Write("def");

            //lbPax.Text = Convert.ToInt32(Bookingdt.Compute("SUM(Pax)", "[Pax] > 0")).ToString(); ;
            //lblTotAMt.Text = Math.Round((Convert.ToDouble(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0")) + (4.5 * (Convert.ToInt32(Bookingdt.Compute("SUM(Total1)", "[Total1] > 0")) / 100)))).ToString("#.##");

            //lblBalance.Text = Math.Round((Convert.ToDouble(lblTotAMt.Text) - Convert.ToDouble(lblTotPaid.Text))).ToString("#.##");
            //lbBalanceDueIn.Text = Convert.ToDateTime(lblArrvDate.Text).AddDays(-90).ToString("d MMMM, yyyy");
            //hfBookingId.Value = MaxBookingId.ToString();

            //lblArrvDate.Text = Session["Chkin"].ToString();
            //lblDepartDate.Text = Session["chkout"].ToString(); ;
            //lblacm.Text = "Accomodation Name: " + Session["AccomName"].ToString();

            if (LoopInsertStatus == dtbooking.Rows.Count)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('" + ex.Message.ToString() + "')", true);
            return(0);
        }
    }
Esempio n. 13
0
    public string CRCCode(String ClearString, String key, string TRANSACTIONSTATUS, string APTRANSACTIONID, string MESSAGE, string TRANSACTIONID, string AMOUNT)
    {
        try
        {
            Crc32  crc32   = new Crc32();
            String hash    = String.Empty;
            byte[] mybytes = Encoding.UTF8.GetBytes(ClearString);
            foreach (byte b in crc32.ComputeHash(mybytes))
            {
                hash += b.ToString("x2");
            }
            UInt32 Output  = UInt32.Parse(hash, System.Globalization.NumberStyles.HexNumber);
            UInt32 Output1 = UInt32.Parse(key);

            if (Output1 == Output)
            {
                if (Session["Hotel"] != null)
                {
                    lblTotPaid.Text = Convert.ToDouble(AMOUNT).ToString("#.##");

                    GenrateBill1(TRANSACTIONID);
                    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ReservationConnectionString"].ConnectionString);
                    con.Open();
                    SqlCommand cmd           = new SqlCommand("insert into tblTransactionDetails values('" + hfBookingId.Value + "', '" + TRANSACTIONID + "','" + APTRANSACTIONID + "' , '" + Convert.ToDecimal(AMOUNT) + "','" + TRANSACTIONSTATUS + "','" + System.DateTime.Now + "')", con);
                    int        QueryResponse = cmd.ExecuteNonQuery();

                    con.Close();
                    if (QueryResponse > 0)
                    {
                        // lbBookingNo.Text = TRANSACTIONID.ToString();
                        //FiilPackage();
                    }
                }
                else
                {
                    lblTotPaid.Text = Convert.ToDouble(AMOUNT).ToString("#.##");;

                    GenrateBill(TRANSACTIONID);
                    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ReservationConnectionString"].ConnectionString);
                    con.Open();
                    SqlCommand cmd           = new SqlCommand("insert into tblTransactionDetails values('" + hfBookingId.Value + "', '" + TRANSACTIONID + "','" + APTRANSACTIONID + "' , '" + Convert.ToDecimal(AMOUNT) + "','" + TRANSACTIONSTATUS + "','" + System.DateTime.Now + "')", con);
                    int        QueryResponse = cmd.ExecuteNonQuery();
                    con.Close();
                    if (QueryResponse > 0)
                    {
                        // lbBookingNo.Text = TRANSACTIONID.ToString();
                        FiilPackage();
                    }
                    DataTable GridRoomPaxDetail = SessionServices.RetrieveSession <DataTable>("BookedRooms");

                    gdvCruiseRooms.FooterRow.Cells[1].Text = "Total </br> Service Tax @ 4.50% </br> <b> Grand Total </b>";
                    gdvCruiseRooms.FooterRow.Cells[3].Text = Math.Round(Convert.ToDouble(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty))).ToString("#.##") + "</br> " + Math.Round((4.5 * (Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) / 100))).ToString("#.##") + " </br> " + Math.Round((Convert.ToDouble(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) + (4.5 * (Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) / 100)))).ToString("#.##");
                    lblTotAMt.Text      = Math.Round((Convert.ToDouble(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) + (4.5 * (Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) / 100)))).ToString("#.##");
                    lblBalance.Text     = Math.Round((Convert.ToDouble(lblTotAMt.Text) - Convert.ToDouble(lblTotPaid.Text))).ToString("#.##");
                    lbBalanceDueIn.Text = Convert.ToDateTime(lblArrvDate.Text).AddDays(-90).ToString("d MMMM, yyyy");

                    //gdvCruiseRooms.FooterRow.Cells[1].Text = "Total </br> Service Tax @ 4.50%";
                    //gdvCruiseRooms.FooterRow.Cells[3].Text = Convert.ToDouble(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)).ToString();
                    //lblTotAMt.Text = (Convert.ToDouble(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) + (4.5 * (Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)) / 100))).ToString();
                    //lblBalance.Text = (Convert.ToDouble(lblTotAMt.Text) - Convert.ToDouble(lblTotPaid.Text)).ToString();


                    Session["BookedRooms"] = null;
                    Session["PackageId"]   = null;
                    Session["BookingRef"]  = null;
                }
                lbRuppeeinwords.Text = GF.NumbersToWords(Convert.ToInt32(lblTotAMt.Text));
            }
            else
            {
                Response.Write("Secure Hash mismatch.");
            }
            return(hash);
        }
        catch
        {
            return(null);
        }
    }
Esempio n. 14
0
    private void InsertChildTableData()
    {
        #region Fetching Departure Details
        blsr.action       = "GetDepartureDetails";
        blsr.PackageId    = Session["PackageId"].ToString();
        dtGetReturnedData = dlsr.GetDepartureDetails(blsr);
        blsr._iAccomId    = Convert.ToInt32(dtGetReturnedData.Rows[0]["AccomId"]);
        #endregion

        blsr.action = "getMaxBookId";
        DataTable dtmaxId = dlsr.GetMaxBookingId(blsr);

        if (dtGetReturnedData != null)
        {
            int MaxBookingId = Convert.ToInt32(dtmaxId.Rows[0].ItemArray[0].ToString());
            lbBookingNo.Text = dtmaxId.Rows[0].ItemArray[0].ToString();
            BookedId         = MaxBookingId;
            blsr._iBookingId = MaxBookingId;
            DataTable GridRoomPaxDetail = SessionServices.RetrieveSession <DataTable>("BookedRooms");

            gdvCruiseRooms.DataSource = GridRoomPaxDetail;
            gdvCruiseRooms.DataBind();

            lblacm.Text    = "M V Mahabaahu";
            lblVessel.Text = "Vessel: ";
            lbPax.Text     = Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Pax)", string.Empty)).ToString();
            //    lblTotoAmt.Text = Convert.ToInt32(GridRoomPaxDetail.Compute("SUM(Price)", string.Empty)).ToString();

            lblDepartDate.Text = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckOutDate"]).ToString("d MMMM, yyyy");
            lblArrvDate.Text   = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckInDate"]).ToString("d MMMM, yyyy");

            int LoopInsertStatus = 0;
            try
            {
                for (int LoopCounter = 0; LoopCounter < GridRoomPaxDetail.Rows.Count; LoopCounter++)
                {
                    blsr._dtStartDate = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckInDate"]);
                    blsr._dtEndDate   = Convert.ToDateTime(dtGetReturnedData.Rows[0]["CheckOutDate"]);
                    blsr._iPaxStaying = Convert.ToInt32(GridRoomPaxDetail.Rows[LoopCounter]["Pax"].ToString());

                    blsr._bConvertTo_Double_Twin = GridRoomPaxDetail.Rows[LoopCounter]["Convertable"].ToString() == "1" ? true : false;
                    blsr._cRoomStatus            = "B";
                    blsr._sRoomNo    = GridRoomPaxDetail.Rows[LoopCounter]["RoomNumber"].ToString();
                    blsr.action      = "AddPriceDetailsToo";
                    blsr._Amt        = Convert.ToDecimal(GridRoomPaxDetail.Rows[LoopCounter]["Price"].ToString());
                    blsr.PaymentId   = Session["BookingPayId"].ToString();
                    blsr._PaidAmount = Convert.ToDouble(Session["Paid"]);
                    int GetQueryResponse = dlsr.AddRoomBookingDetails(blsr);
                    if (GetQueryResponse > 0)
                    {
                        LoopInsertStatus++;
                    }
                    else
                    {
                        //do nothing
                    }
                }
                hfBookingId.Value = MaxBookingId.ToString();
            }
            catch
            {
            }
        }
        else
        {
        }
    }
    private int GetPax()
    {
        DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

        return(Convert.ToInt16(dtrpax.Compute("SUM(Pax)", string.Empty)));
    }
    private void loadall()
    {
        if (Session["UserCode"] != null)
        {
            try
            {
                blagentpayment._Action = "MailValidate";
                if (Session["AgentMailId"] != null && Session["Password"] != null)
                {
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();

                    DataTable dtAgent = dlagentpayment.BindControls(blagentpayment);
                    if (dtAgent.Rows.Count > 0)
                    {
                        lblAgentName.Text      = Session["UserName"].ToString();
                        lblBillingAddress.Text = dtAgent.Rows[0]["BillingAddress"].ToString();
                        lbPaymentMethod.Text   = dtAgent.Rows[0]["PaymentMethod"].ToString();
                        hdnfPhoneNumber.Value  = dtAgent.Rows[0]["Phone"].ToString();
                        hdnfCreditLimit.Value  = dtAgent.Rows[0]["CreditLimit"].ToString();
                        bool oncredit = Convert.ToBoolean(dtAgent.Rows[0]["ChkCredit"].ToString());
                        pnlFullDetails.Visible = true;
                        if (oncredit)
                        {
                            panelwithoutCreditAgent.Visible = false;
                            panelwithoutCreditAgent.Visible = true;
                        }
                        else
                        {
                            panelwithoutCreditAgent.Visible = true;
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Agent Payment Details Not found')", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('It seems you are not logged in')", true);
                }
            }
            catch (Exception sqe)
            {
            }
        }
        else if (Session["CustomerCode"] != null)
        {
            try
            {
                DataTable dtCustomer = new DataTable();
                blcus.Email = Session["CustMailId"].ToString();

                if (Session["guest"] != null)
                {
                    blcus.action = "getforguest";
                    dtCustomer   = dlcus.getforguest(blcus);
                }
                else
                {
                    blcus.Password          = Session["userpass"].ToString();
                    Session["CustPassword"] = Session["userpass"].ToString();
                    blcus.action            = "LoginCust";
                    dtCustomer = dlcus.checkDuplicateemail(blcus);
                }

                if (dtCustomer != null && dtCustomer.Rows.Count > 0)
                {
                    Session["CustomerMailId"] = Session["CustMailId"].ToString();
                    lblAgentName.Text         = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lblBillingAddress.Text    = dlcus.GetBillingAddress(dtCustomer.Rows[0]);
                    lbPaymentMethod.Text      = dtCustomer.Rows[0]["PaymentMethod"].ToString();
                    hdnfPhoneNumber.Value     = dtCustomer.Rows[0]["Telephone"].ToString();
                    Session["CustId"]         = dtCustomer.Rows[0]["CustId"].ToString();
                    DataTable dtrpax  = SessionServices.RetrieveSession <DataTable>("BookedRooms");
                    string    BookRef = dtCustomer.Rows[0]["FirstName"].ToString() + dtCustomer.Rows[0]["LastName"].ToString() + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Direct Client";
                    ViewState["BookRef"]            = BookRef;
                    lbPaymentMethod.Text            = "Online";
                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
    protected void btnPayProceed_Click(object sender, EventArgs e)
    {
        try
        {
            Session["Hotel"] = 1;
            if (btnPayProceed.Text == "Proceed For Payment")
            {
                if (Session["UserCode"] != null)
                {
                    //[email protected] [1:48:55 PM] Augurs  Technologies Pvt. Ltd.: 12345

                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = txtBookRef.Text + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString();

                    Session.Add("BookingRef", BookRef);
                    Session["Paid"]          = Convert.ToDouble(txtPaidAmt.Text.Trim() == "" ? "0" : txtPaidAmt.Text.Trim());
                    blagentpayment._Action   = "MailValidate";
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();
                    DataTable dtAgent = dlagentpayment.BindControls(blagentpayment);
                    if (dtAgent.Rows.Count > 0)
                    {
                        string BookingPayId   = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                        string Email          = Session["AgentMailId"].ToString();
                        string PhoneNumber    = hdnfPhoneNumber.Value.Trim().ToString();
                        string FirstName      = DataSecurityManager.Decrypt(dtAgent.Rows[0]["FirstName"].ToString());
                        string LastName       = DataSecurityManager.Decrypt(dtAgent.Rows[0]["LastName"].ToString());
                        string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                        string PaymentId      = BookingPayId.ToString();
                        string BillingAddress = lblBillingAddress.Text.Trim().ToString();
                        Session["BookingPayId"] = txtBookRef.Text.Trim();// BookingPayId;

                        Session["Address"] = BillingAddress;
                        Session["InvName"] = FirstName;

                        Session["SubInvName"] = FirstName;
                        //Response.Redirect("PaymentGatewayResponse.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //http://adventureresortscruises.in/Cruise/booking/sendtoairpay.aspx?BookedId=0&PackName=7N8D+Downstream+Cruise&NoOfNights=7&CheckinDate=12%2f4%2f2016&PackId=Pack4
                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                }
                else
                {
                    Session.Add("BookingRef", ViewState["BookRef"].ToString());

                    blcus.Email    = Session["CustomerMailId"].ToString();
                    blcus.Password = Session["CustPassword"].ToString();

                    blcus.action = "LoginCust";
                    DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
                    Session["Paid"] = Convert.ToDouble(txtPaidAmt.Text.Trim() == "" ? "0" : txtPaidAmt.Text.Trim());
                    if (dtCustomer.Rows.Count > 0)
                    {
                        Random rnd          = new Random();
                        string BookingPayId = rnd.Next(10000, 20000).ToString() + DateTime.Now.ToString("MMddhhmmssfff");
                        Session["BookingPayId"] = BookingPayId;
                        string Email = Session["CustomerMailId"].ToString();

                        string PhoneNumber    = hdnfPhoneNumber.Value.Trim().ToString();
                        string FirstName      = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString());
                        string LastName       = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                        string PaidAmt        = hftxtpaidamt.Value.Trim().ToString();
                        string PaymentId      = BookingPayId.ToString();
                        string BillingAddress = lblBillingAddress.Text.Trim().ToString();
                        Session["Address"]    = BillingAddress;
                        Session["InvName"]    = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Title"].ToString()) + " " + LastName;
                        Session["SubInvName"] = LastName + ", " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Title"].ToString()) + " " + FirstName;

                        Response.Redirect("~/Cruise/booking/sendtoairpay.aspx?BookingPayId=" + PaymentId + "&EmailId=" + Email.ToString() + "&PhoneNumber=" + PhoneNumber.ToString() + "&FirstName=" + FirstName.ToString() + "&LastName=" + LastName.ToString() + "&PaidAmt=" + PaidAmt.ToString() + "&BillingAddress=" + BillingAddress.ToString());

                        //http://localhost:1897/ResortManager/Cruise/booking/SummerisedDetails.aspx?BookedId=0&PackName=Ganges+Exclusive&NoOfNights=5&CheckinDate=5%2f1%2f2016

                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('not registered!!!')", true);
                    }
                }
            }
            else
            {
                if (Convert.ToDecimal(txtPaidAmt.Text) <= Convert.ToDecimal(hdnfCreditLimit.Value))
                {
                    string BookingPayId = lbPaymentMethod.Text.Trim().Substring(0, 2) + DateTime.Now.ToString("MMddhhmmssfff");
                    Session["BookingPayId"] = BookingPayId;
                    Session.Add("BookingRef", txtBookRef.Text.Trim().ToString());
                    Session["Paid"] = Convert.ToDouble(hftxtpaidamt.Value.Trim() == "" ? "0" : hftxtpaidamt.Value.Trim().ToString());

                    Session["InvName"] = Session["UserName"].ToString();
                    Session["Address"] = null;
                    Response.Redirect("PaymentGatewayResponse.aspx");
                }
                else
                {
                    lblPaymentErr.Text = "Payment Amount Exceeding Credit Limit";
                }
            }
        }
        catch
        {
        }
    }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //txtChkin.Attributes.Add("onchange", "return fillEndDate('" + txtChkin.ClientID + "','" + txtChkOut.ClientID + "');");
            if (!IsPostBack)
            {
                if (Session["UserCode"] != null)
                {
                    LinkButton1.Visible = true;
                }
                else
                {
                    LinkButton1.Visible = false;
                }

                if (SessionServices.RetrieveSession <DataTable>("Bookingdt") == null)
                {
                    Session["AcId"]        = Request.QueryString["AccomId"];
                    Session["Agid"]        = Request.QueryString["AId"];
                    Session["Hpax"]        = Request.QueryString["pax"];
                    Session["AccomTypeId"] = Request.QueryString["AccomTypeId"];
                    Session["HCheckin"]    = Request.QueryString["Checkin"];
                    Session["HCheckout"]   = Request.QueryString["Checkout"];
                    Session["HNoofrooms"]  = Request.QueryString["Noofrooms"];
                }


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

                DateTime.TryParse(Session["HCheckin"].ToString(), out chkin);
                DateTime.TryParse(Session["HCheckout"].ToString().ToString(), out chkout);

                Int32.TryParse(Session["HNoofrooms"].ToString().ToString(), out noofrooms);

                DataTable bookingDt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
                if (bookingDt != null)
                {
                    ViewState["VsRoomDetails"]  = bookingDt;
                    gdvSelectedRooms.DataSource = bookingDt;
                    gdvSelectedRooms.DataBind();
                    CalculateRoomRates();
                }

                if (gdvSelectedRooms.Rows.Count > 0)
                {
                    DivRmRate.Style.Remove("display");
                }
                else
                {
                    DivRmRate.Style.Add("display", "None");
                }
                this.bindRoomRates(iAccomId, Totpax, iagentid, chkin, chkout, noofrooms, 6);
                this.bindServiceRates(iAccomId);

                this.bindMealPlans(iAccomId, iagentid, Totpax);
                adddatestoddl(Convert.ToDateTime(Session["HCheckin"].ToString().ToString()), Convert.ToDateTime(Session["HCheckout"].ToString().ToString()));

                //  DivRmRate.Style.Add("display", "None");
            }
        }
        catch
        {
        }
    }
    private void LoadBookedRoomDetails()
    {
        try
        {
            dtGetBookedRooms = SessionServices.RetrieveSession <DataTable>("BookedRooms");
            DataTable dtgroupedData = new DataTable();
            dtgroupedData.Columns.Add("categoryName");
            dtgroupedData.Columns.Add("Pax");
            dtgroupedData.Columns.Add("Price");
            dtgroupedData.Columns.Add("Currency");
            DataTable dtUniqueCategories = dtGetBookedRooms.DefaultView.ToTable(true, "categoryName");
            #region Adding distict Room categories
            foreach (DataRow dr1 in dtUniqueCategories.Rows)
            {
                string  categoryName = dr1["categoryName"].ToString();
                DataRow dr2          = dtgroupedData.NewRow();
                dr2["categoryName"] = categoryName;
                dtgroupedData.Rows.Add(dr2);
            }
            #endregion
            #region calculating values
            decimal TotalPaybleAmt = 0;
            double  gettax1        = 0;
            foreach (DataRow dr1 in dtgroupedData.Rows)
            {
                string   category = dr1["categoryName"].ToString();
                DataView dv;
                dv = new DataView(dtGetBookedRooms, "categoryName='" + category + "'", "categoryName", DataViewRowState.CurrentRows);
                DataTable dtFiltered     = dv.ToTable();
                int       packs          = 0;
                decimal   price          = 0;
                decimal   discountamount = 0;
                foreach (DataRow dr3 in dtFiltered.Rows)
                {
                    packs = packs + Convert.ToInt32(dr3["Pax"].ToString());
                    price = price + Convert.ToDecimal(dr3["Totalprice"].ToString().Replace(",", ""));
                }
                dr1["Pax"]      = packs.ToString();
                dr1["Price"]    = price.ToString();
                dr1["Currency"] = dv.ToTable().Rows[0]["Currency"].ToString();

                double discount = 0;
                if (Session["getdiscountvalue"] != null)
                {
                    try
                    {
                        discount = Convert.ToDouble(Session["getdiscountvalue"].ToString());
                    }
                    catch { }
                }
                lblDiscountper.Text = Session["getdiscountvalue"].ToString() + "%";
                TotalPaybleAmt      = TotalPaybleAmt + Convert.ToDecimal(price);
                try
                {
                    gettax1 = Convert.ToDouble(Session["gettax"].ToString().Split('R')[1]);
                }
                catch
                {
                    gettax1 = Convert.ToDouble(Session["gettax"].ToString());
                }
            }
            double total         = 0;
            double gettax        = 0;
            double getalltotal   = 0;
            double totyadiscount = 0;
            double grosstotal    = 0;
            double taxableamt    = 0;
            for (int i = 0; i < dtGetBookedRooms.Rows.Count; i++)
            {
                taxableamt    = taxableamt + Convert.ToDouble(dtGetBookedRooms.Rows[i]["taxablepamt"].ToString());
                gettax        = gettax + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Tax1"].ToString()));
                total         = Convert.ToDouble(total) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["pricewithouttax"].ToString().Replace(",", "")) * Convert.ToDouble(dtGetBookedRooms.Rows[i]["Pax"].ToString()));
                getalltotal   = Convert.ToDouble(getalltotal) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["CRPrice"].ToString().Split('R')[1].ToString().Replace(",", "")));
                totyadiscount = Convert.ToDouble(totyadiscount) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Discountprice"].ToString().Replace(",", "")));
                grosstotal    = Convert.ToDouble(grosstotal) + (Convert.ToDouble(dtGetBookedRooms.Rows[i]["Totalprice"].ToString().Replace(",", "")));
            }
            Session["getcruisetax"]     = "INR" + ((Convert.ToDouble(dtGetBookedRooms.Rows[0]["pricewithouttax"].ToString()) * gettax1) / 100).ToString("##,0");
            lblTax.Text                 = "INR " + Convert.ToDouble(gettax.ToString()).ToString("##,0");
            Session["getcruiseinvoice"] = "INR " + Math.Round(gettax).ToString();
            lbltaxin.Text               = "INR " + taxableamt.ToString("##,0");
            if (lblDiscountper.Text != "0%")
            {
                lblDiscount.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + totyadiscount.ToString("##,0");
            }
            else
            {
                getdiscount.Visible = false;
            }
            lblalltotal.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + getalltotal.ToString("##,0");
            lbltotAmt.Text   = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + total.ToString("##,0");
            lblGross.Text    = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + Convert.ToDouble(grosstotal.ToString()).ToString("##,0");
            lblCurrency.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " ";
            if (Session["advanceamount"].ToString() == "")
            {
                txtPaidAmt.Text       = Convert.ToDouble(Math.Round(((100 * TotalPaybleAmt) / 100)).ToString("#.##")).ToString("##,0");
                lbl25.Text            = "";
                lblBalancedate.Text   = "N/A";
                trbalancedate.Visible = false;
            }
            else
            {
                txtPaidAmt.Text = Convert.ToDouble(Math.Round(((25 * TotalPaybleAmt) / 100)).ToString("#.##")).ToString("##,0");
                if (Session["Getcheckindate"] != null)
                {
                    lblBalancedate.Text = "(75% of total) to be paid prior to " + Convert.ToDateTime(Session["Getcheckindate"].ToString()).AddDays(-90).ToString("dddd, MMMM d, yyyy");
                }
                lbl25.Text         = "(25% of Total)";
                Session["get25"]   = 1;
                Session["getPaid"] = txtPaidAmt.Text;
            }

            lblBalanceAmt.Text = dtGetBookedRooms.Rows[0]["Currency"].ToString() + " " + Convert.ToDouble(Math.Round((TotalPaybleAmt - Convert.ToDecimal(txtPaidAmt.Text))).ToString()).ToString("##,0");
            if (lblBalanceAmt.Text == "INR 0")
            {
                trbalanceamount.Visible = false;
            }
            Session["getbalanceSummerlizede"] = Math.Round((TotalPaybleAmt - Convert.ToDecimal(txtPaidAmt.Text))).ToString();
            dtGetBookedRooms = dtgroupedData;
            #endregion
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnSmbt_Click(object sender, EventArgs e)
    {
        if (Session["UserCode"] != null)
        {
            //  pnlLogin.Visible = true;
            try
            {
                customerLogin.Visible = false;
                if (Session["AgentMailId"] != null && Session["Password"] != null)
                {
                    blagentpayment._Action   = "MailValidate";
                    blagentpayment._EmailId  = Session["AgentMailId"].ToString();
                    blagentpayment._Password = Session["Password"].ToString();
                    DataTable dtAgent = dlagentpayment.BindControls(blagentpayment);
                    if (dtAgent.Rows.Count > 0)
                    {
                        lblAgentName.Text      = Session["UserName"].ToString();
                        lblBillingAddress.Text = dtAgent.Rows[0]["BillingAddress"].ToString();
                        lbPaymentMethod.Text   = dtAgent.Rows[0]["PaymentMethod"].ToString();
                        hdnfPhoneNumber.Value  = dtAgent.Rows[0]["Phone"].ToString();
                        hdnfCreditLimit.Value  = dtAgent.Rows[0]["CreditLimit"].ToString();
                        bool oncredit = Convert.ToBoolean(dtAgent.Rows[0]["ChkCredit"].ToString());

                        pnlFullDetails.Visible = true;
                        pnlBookButton.Visible  = true;

                        if (oncredit)
                        {
                            panelwithoutCreditAgent.Visible = false;
                            btnPayProceed.Text = "Book";
                        }
                        else
                        {
                            panelwithoutCreditAgent.Visible = true;
                            btnPayProceed.Text = "Proceed For Payment";
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Agent Payment Details Not found')", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('It seems you are not logged in')", true);
                }
            }
            catch (Exception sqe)
            {
            }
        }
        else if (Session["CustomerCode"] != null)
        {
            try
            {
                blcus.Email    = Session["CustomerMailId"].ToString();;
                blcus.Password = Session["CustPassword"].ToString();
                blcus.action   = "LoginCust";

                DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
                if (dtCustomer != null)
                {
                    Session["CustMailId"] = Session["CustomerMailId"].ToString();

                    ViewState["Pass"]      = txtCustPass.Text.Trim();
                    lblBillingAddress.Text = dlcus.GetBillingAddress(dtCustomer.Rows[0]);


                    lblAgentName.Text     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lbPaymentMethod.Text  = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["PaymentMethod"].ToString());
                    hdnfPhoneNumber.Value = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Telephone"].ToString());
                    Session["CustId"]     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["CustId"].ToString());

                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString()) + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Self";
                    ViewState["BookRef"] = BookRef;
                    lbPaymentMethod.Text = "N/A";


                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                    pnlBookButton.Visible           = true;
                    customerLogin.Visible           = false;
                }
                Bookingdt = SessionServices.RetrieveSession <DataTable>("Bookingdt");
                // preparetables(Bookingdt);
            }
            catch
            {
            }
        }
        else
        {
            pnlLogin.Visible      = false;
            customerLogin.Visible = true;
        }

        //Bookingdt = Session["Bookingdt"] as DataTable;
        //preparetables(Bookingdt);
    }