public TransactionRecord GetPromotionDetails(TransactionRecord tr) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID Response from PG " + tr.BookingID.ToString()); if (tr.BookingID.ToString().Substring(0, 2) == "31") { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(tr.BookingID); if (chkID.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID and Conter from March Promotion Table " + chkID.Rows[0][1].ToString() + "," + chkID.Rows[0][0].ToString()); if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { tr.BookingID = long.Parse(chkID.Rows[0][1].ToString()); } } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID after Switch " + tr.BookingID.ToString()); } DataTable dttransaction = TransactionBOL.Select_Temptransaction_transactionIDWise(tr.BookingID); if (dttransaction.Rows.Count > 0) { DataRow dr = dttransaction.Rows[0]; decimal DiscountPercentage = decimal.Parse(dr["DiscountPercentage"].ToString()); tr.PromotionCode = dr["PromotionCode"].ToString(); tr.DiscountPercentage = DiscountPercentage; tr.WebPromotionId = dr["WebPromotionId"].ToString(); } return(tr); }
public TransactionRecord GetRoyalCardDetails(TransactionRecord tr) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID Response from PG " + tr.BookingID.ToString()); if (tr.BookingID.ToString().Substring(0, 2) == "31") { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(tr.BookingID); if (chkID.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID and Conter from March Promotion Table " + chkID.Rows[0][1].ToString() + "," + chkID.Rows[0][0].ToString()); if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { tr.BookingID = long.Parse(chkID.Rows[0][1].ToString()); } } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID after Switch " + tr.BookingID.ToString()); } DataTable dttransaction = TransactionBOL.Select_Temptransaction_transactionIDWise(tr.BookingID); if (dttransaction.Rows.Count > 0) { DataRow dr = dttransaction.Rows[0]; string RegId = dr["RegId"].ToString(); if (!string.IsNullOrEmpty(RegId)) { tr.RegId = dr["RegId"].ToString(); if (dr["TopUpTransactionId"] != null) { tr.TopUpTransactionId = dr["TopUpTransactionId"].ToString(); } tr.AvailedAmount = Convert.ToDecimal(dr["AvailedAmount"]); tr.AvailedPoints = Convert.ToDecimal(dr["AvailedPoints"]); tr.TopUpAmount = Convert.ToDecimal(dr["TopUpAmount"]); tr.TotalAmount = Convert.ToDecimal(dr["TotalAmount"]); if (dr["Play"] != null) { tr.Play = Convert.ToString(dr["Play"]); } if (dr["MobileNo"] != null) { tr.MobileNo = Convert.ToString(dr["MobileNo"]); } tr.TotalSeats = Convert.ToInt32(dr["TotalSeats"]); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Reg Id is null"); } } return(tr); }
protected void btnGo_Click(object sender, EventArgs e) { if (txt_Name.Text == "" && txt_BookingDate.Text == "" && txt_bookingDateTo.Text == "" && txt_ShowDate.Text == "" && txt_ShowDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Enter Either The Name , Booking Dates or Show Dates !!"; txt_Name.Focus(); } else if (txt_BookingDate.Text != "" && txt_bookingDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Booking Date To !!"; txt_bookingDateTo.Focus(); } else if (txt_BookingDate.Text == "" && txt_bookingDateTo.Text != "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Booking Date From !!"; txt_BookingDate.Focus(); } else if (txt_ShowDate.Text == "" && txt_ShowDateTo.Text != "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Show Date From !!"; txt_ShowDate.Focus(); } else if (txt_ShowDate.Text != "" && txt_ShowDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Show Date To !!"; txt_ShowDateTo.Focus(); } else { //Defining the Values to the Object TransactionRecord tr = new TransactionRecord(); tr.BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; tr.ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; tr.DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; //location == bookingDate to tr.Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; tr.ShowDate = txt_ShowDate.Text.Length > 0 ? txt_ShowDate.Text : "0"; tr.MobileNo = txt_ShowDateTo.Text.Length > 0 ? txt_ShowDateTo.Text : "0"; tr.Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; tr.AgentCode = ddlAgent.SelectedValue; if (tr.BookingID != null || tr.BookingID.ToString() != "") { DataTable chkID1 = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(Convert.ToInt64(tr.BookingID.ToString())); if (chkID1 != null && chkID1.Rows.Count > 0) { tr.BookingID = long.Parse(chkID1.Rows[0][1].ToString()); } } DataSet ds = TransactionBOL.Select_Report_SearchFromTransactionsTemp_DS(tr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { btnPrint.Disabled = false; Btn_Excel.Enabled = true; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_IDWise(Convert.ToInt64(ds.Tables[0].Rows[i][1])); if (chkID.Rows.Count > 0) { if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { ds.Tables[0].Rows[i][1] = long.Parse(chkID.Rows[0][0].ToString()); } } if (ds.Tables[0].Rows[i][10].ToString() == "") { dis = Decimal.Parse(ds.Tables[0].Rows[i][8].ToString()); ds.Tables[0].Rows[i][10] = dis; ds.Tables[0].Rows[i][9] = "0.00"; } } gv_Report.DataSource = ds; lblMess.Text = ""; } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No records Found!"; } gv_Report.DataBind(); } }