protected void hlnkReservationId_Click(object sender, EventArgs e)
 {
     ClearBinding();
     this.pnlSearchResult.Visible = false;
     if (!string.IsNullOrEmpty(this.txtSearchTerm.Text) && Utility.IsNumeric(this.txtSearchTerm.Text.Trim()))
     {
         KNET_Payments knet = GetKnetPaymentByReservationId(SqlInt32.Parse(this.txtSearchTerm.Text.Trim()));
         if (knet != null)
         {
             Reservations reservation = GetReservations(knet.Reservation_ID);
             Guests       guest       = GetGuest(reservation.Guest_ID);
             BindReservation(knet, reservation, guest);
             this.lblResult.Text          = "";
             this.pnlSearchResult.Visible = true;
         }
         else
         {
             this.lblResult.Text          = "No Records !!!";
             this.pnlSearchResult.Visible = false;
         }
     }
     else
     {
         this.lblResult.Text          = "Seach Term is invalid !!!";
         this.pnlSearchResult.Visible = false;
     }
 }
 protected void hlnkMobile_Click(object sender, EventArgs e)
 {
     ClearBinding();
     this.pnlSearchResult.Visible = false;
     if (!string.IsNullOrEmpty(this.txtSearchTerm.Text) && Utility.IsNumeric(this.txtSearchTerm.Text.Trim()))
     {
         tbl = Search(searchCriteria: "2", searchTerm: txtSearchTerm.Text.Trim());
         if (tbl.Rows.Count > 0)
         {
             SqlInt32      reservationId = (Int32)tbl.Rows[0]["Reservation_ID"];
             KNET_Payments knet          = GetKnetPaymentByReservationId(reservationId);
             Reservations  reservation   = GetReservations(knet.Reservation_ID);
             Guests        guest         = GetGuest(reservation.Guest_ID);
             BindReservation(knet, reservation, guest);
             this.lblResult.Text          = "";
             this.pnlSearchResult.Visible = true;
         }
         else
         {
             this.lblResult.Text          = "No Records !!!";
             this.pnlSearchResult.Visible = false;
         }
     }
     else
     {
         this.lblResult.Text          = "Seach Term is invalid !!!";
         this.pnlSearchResult.Visible = false;
     }
 }
Пример #3
0
    private void UpdateKNET(string knetPaymentId, string result, string auth, string Ref, string TranID, string TrackID)
    {
        KNET_Payments knet = new KNET_Payments();

        knet.KNET_Payment_ID = knetPaymentId;
        knet.SelectOne();
        knet.Result       = result;
        knet.Auth         = auth;
        knet.Ref          = Ref;
        knet.TransVal     = TranID;
        knet.Track_ID     = TrackID;
        knet.PaymentSatus = PaymentStatus.KNET_ERROR;
        knet.Remarks      = knet.Remarks + "- KNET ERROR";
        String status = "Error in KNET Payment !!!";

        if (result == "CANCELED")
        {
            knet.PaymentSatus = PaymentStatus.KNET_CANCELED;
            knet.Remarks      = knet.Remarks + "- KNET CANCELED";
            status            = "KNET Payment Canceled!!!";
        }
        if (knet.Update())
        {
            this.lblStatus.Text = status;
        }
        else
        {
            this.lblStatus.Text = "KNET Payment Error. Error in Saving it !!!";
        }
    }
    private KNET_Payments GetKnetPaymentByReservationId(SqlInt32 reservationId)
    {
        KNET_Payments knet = new KNET_Payments();

        knet.Reservation_ID = reservationId;
        knet.SelectByReservation();
        return(knet);
    }
    private KNET_Payments GetKnetPayment(string knetPaymentId)
    {
        KNET_Payments knet = new KNET_Payments();

        knet.KNET_Payment_ID = knetPaymentId;
        knet.SelectOne();
        return(knet);
    }
    private void BindKnetPayment(int reservationId)
    {
        //GetReservationPayments(reservationId, ref  paymentsTbl);
        KNET_Payments knet = new KNET_Payments();

        knet.Reservation_ID         = reservationId;
        knetPayTbl                  = knet.SelectByReservation();
        knetPaymentsGrid.DataSource = knetPayTbl;
        knetPaymentsGrid.DataBind();
    }
    private void UpdateKNET(string knetPaymentId, string result, string auth, string Ref, string TranID, string TrackID)
    {
        KNET_Payments knet = new KNET_Payments();

        knet.KNET_Payment_ID = knetPaymentId;
        knet.SelectOne();
        knet.Result       = result;
        knet.Auth         = auth;
        knet.Ref          = Ref;
        knet.TransVal     = TranID;
        knet.Track_ID     = TrackID;
        knet.PaymentSatus = PaymentStatus.KNET_SUCCESS;
        knet.Remarks      = knet.Remarks + "- KNET Success";
        if (knet.Update())
        {
            this.lblStatus.Text = "Successful Payment";
        }
        else
        {
            this.lblStatus.Text = "Successful Payment. Error in Saving it !!!";
        }
    }
Пример #8
0
    private bool ProcessKNET(string knetPaymentId)
    {
        KNET_Payments knet = new KNET_Payments();

        knet.Payment_ID      = ((Reservation_Payments)Session["Reservation_Payments"]).Payment_ID; //(SqlInt32)Session["PaymentID"];
        knet.Reservation_ID  = ((Reservations)Session["Reservation"]).Reservation_ID;              //(SqlInt32)Session["ReservationID"];
        knet.Guest_ID        = ((Guests)Session["Guest"]).Guest_ID;                                //(SqlInt32)Session["GuestID"];
        knet.KNET_Payment_ID = knetPaymentId;
        knet.PaymentSatus    = PaymentStatus.KNET_PROCESSING;                                      //Purchase Initiation
        knet.CreatedDate     = Utility.GetSqlDateTimeFromDateTime(DateTime.Now);
        string remarks, rate, qty, total;                                                          // Declaration of variables

        remarks            = "Hotel Reservation for " + this.hidBookingDays.Value + " days";
        rate               = this.hidRate.Value;
        qty                = this.hidBookingDays.Value;
        total              = this.hidCostAfterDiscount.Value;
        knet.PaymentAmount = SqlMoney.Parse(this.hidCostAfterDiscount.Value);
        knet.Remarks       = remarks + "@ Rate" + this.hidRate.Value;
        knet.TransVal      = "0";
        knet.Track_ID      = "0";
        ClearSessionObjects();
        return(knet.Insert());
    }
    private void BindReservation(KNET_Payments knet, Reservations reservation, Guests guest)
    {
        this.lblKnetPaymentId.Text = knet.KNET_Payment_ID;
        this.lblKnetReference.Text = knet.Ref;

        Reservation_Payments payments = new Reservation_Payments();

        payments.Reservation_ID = knet.Reservation_ID;
        DataTable pays = payments.SelectAll();
        int       numKidsFerry = 0, numAdultsFerry = 0, numDays = 0;
        SqlMoney  roomCharges     = new SqlMoney(0.00);
        SqlMoney  ferryCharges    = new SqlMoney(0.00);
        SqlMoney  kidsFerryCost   = new SqlMoney(0.00);
        SqlMoney  adultsFerryCost = new SqlMoney(0.00);
        SqlMoney  totalCost       = new SqlMoney(0.00);

        if (pays.Rows.Count > 0)
        {
            foreach (DataRow r in pays.Rows)
            {
                if ((Int32)r["AvailedService_Type"] == PAYMENT_AVAILED_SERVICETYPES.FERRY_KIDS)
                {
                    numKidsFerry  = (Int32)r["UnitsConsumed"];
                    kidsFerryCost = (Decimal)r["Cost_After_Discount"];
                }
                if ((Int32)r["AvailedService_Type"] == PAYMENT_AVAILED_SERVICETYPES.FERRY_ADULTS)
                {
                    numAdultsFerry  = (Int32)r["UnitsConsumed"];
                    adultsFerryCost = (Decimal)r["Cost_After_Discount"];
                }
                if ((Int32)r["AvailedService_Type"] == PAYMENT_AVAILED_SERVICETYPES.RESERVATION)
                {
                    numDays     = (Int32)r["UnitsConsumed"];
                    roomCharges = (Decimal)r["Cost_After_Discount"];
                }
            }
        }
        ferryCharges              = (adultsFerryCost + kidsFerryCost);
        totalCost                 = (ferryCharges + roomCharges);
        this.lblRoomCharges.Text  = roomCharges.ToString();
        this.lblFerryCharges.Text = ferryCharges.ToString();
        this.lblTotalCharges.Text = totalCost.ToString();

        this.lblDays.Text        = numDays.ToString();
        this.lblFerryKids.Text   = numKidsFerry.ToString();
        this.lblFerryAdults.Text = numAdultsFerry.ToString();


        reservation.Reservation_ID = knet.Reservation_ID;
        reservation.SelectOne();
        this.lblFromDate.Text            = Utility.GetDateTimeFromSqlDateTime(reservation.FromDate).ToString("dd/MM/yyyy");
        this.lblToDate.Text              = Utility.GetDateTimeFromSqlDateTime(reservation.ToDate).ToString("dd/MM/yyyy");
        this.lblRoomType.Text            = reservation.RoomType_ID.ToString();
        this.lblFerryKidsValidity.Text   = Utility.GetDateTimeFromSqlDateTime(reservation.FromDate).ToString("dd/MM/yyyy");
        this.lblFerryAdultsValidity.Text = Utility.GetDateTimeFromSqlDateTime(reservation.FromDate).ToString("dd/MM/yyyy");
        this.lblDepartureTickets.Text    = (numKidsFerry + numAdultsFerry).ToString();
        this.lblDepartureDate.Text       = Utility.GetDateTimeFromSqlDateTime(reservation.ToDate).ToString("dd/MM/yyyy");


        this.lblGuestFirstName.Text  = guest.FirstName.ToString();
        this.lblGuestMiddleName.Text = guest.MiddleName.ToString();
        this.lblGuestLastName.Text   = guest.LastName.ToString();
        this.lblGuestEmail.Text      = guest.Email.ToString();
        this.lblGuestMobile.Text     = guest.MobileNumber.ToString();
        this.lblGuestCvd.Text        = guest.Civil_ID.ToString();
    }