public bool BillPayment(Bill_Payment_info BillPay) { bool billpaymentAdded = false; SqlConnection con = new SqlConnection(ConnectionString); string command = "BILL_PAYMENT_Details"; SqlCommand cmd = new SqlCommand(command, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@PaymentID", SqlDbType.UniqueIdentifier).Value = BillPay.PAYMENT_ID; cmd.Parameters.Add("@CustID", SqlDbType.UniqueIdentifier).Value = BillPay.CUST_ID; cmd.Parameters.Add("@TotalAmount", SqlDbType.Decimal).Value = BillPay.TOTAL_AMOUNT; cmd.Parameters.Add("@Advance", SqlDbType.Decimal).Value = BillPay.ADVANCE; cmd.Parameters.Add("@Balance", SqlDbType.Decimal).Value = BillPay.BALANCE; cmd.Parameters.Add("@reservationID", SqlDbType.UniqueIdentifier).Value = BillPay.RESERVE_ID; try { con.Open(); cmd.ExecuteNonQuery(); billpaymentAdded = true; } catch (Exception ex) { throw; } con.Close(); return(billpaymentAdded); }
// // GET: /BillPayment/ public ActionResult BillPayment_info(Guid reservationID) { Bill_Payment_info info = new Bill_Payment_info(); info.RESERVE_ID = reservationID; info.CUST_ID = SessionHandler.CurrentUser.UserID; return(View(info.BillPayment_info())); }
public ActionResult BillPayment_info(Bill_Payment_info info) { if ((info.ADVANCE) >= 2000) { if (info.Bill_Payment()) { ViewBag.Message = "Your Bill paid successfully !!"; } else { ViewBag.Message = "Error occured while updateing the you information." + "\n[BillPaymentController.BillPayment_info {POST} ]"; } } else { ViewBag.Message = "Pay minimum 2000 tk !!"; } return(View(info)); }
public Bill_Payment_info BillPayment_info(Guid reserveID, Guid custID) { SqlConnection con = new SqlConnection(ConnectionString); string command = "[dbo].[BILL_PAYMENT_info]"; SqlCommand cmd = new SqlCommand(command, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ReservationID", SqlDbType.UniqueIdentifier).Value = reserveID; cmd.Parameters.Add("@CustID", SqlDbType.UniqueIdentifier).Value = custID; SqlDataReader reader; Bill_Payment_info bill_paymentInfo = null; try { bill_paymentInfo = new Bill_Payment_info(); con.Open(); reader = cmd.ExecuteReader(); if (reader.Read()) { bill_paymentInfo.RESERVE_ID = new Guid(reader["RESERVE_ID"].ToString()); bill_paymentInfo.CUST_ID = new Guid(reader["CUST_ID"].ToString()); bill_paymentInfo.TOTAL_AMOUNT = Convert.ToDecimal(reader["ROOM_PRICE"].ToString()); } } catch { bill_paymentInfo = null; throw; } return(bill_paymentInfo); }