private string BookCarRental() { BLSchedule obj = new BLSchedule(); CarRentalEntity objCar = new CarRentalEntity(); ArrayList psgDetails = GetPassengerDeatils(); try { objCar.BookingID = ""; objCar.ScheduleID = Convert.ToInt32(Session["ScheduleID"].ToString()); objCar.CustName = psgDetails[0].ToString(); objCar.Gender = psgDetails[1].ToString(); objCar.Age = Convert.ToInt32(psgDetails[2].ToString()); objCar.EmailID = txtEmail.Text.ToString(); objCar.Mobile_no = txtMobile.Text.ToString(); objCar.Pickup_Address = txtAddress.Text.ToString(); objCar.Pickup_Date = Convert.ToDateTime(Session["PickupDate"].ToString()); objCar.Pickup_Time = Session["PickupTime"].ToString(); objCar.bookingBMET_amt = ViewState["payableAmount"] == null?Convert.ToInt32(ViewState["CustomerAmt"].ToString()) : Convert.ToInt32(ViewState["payableAmount"].ToString()); objCar.bookingFRAN_amt = Convert.ToInt32(ViewState["CustomerAmt"].ToString()); objCar.Fran_code = ViewState["FranCode"] == null ? "" : ViewState["FranCode"].ToString().Trim(); objCar.Fran_Markup = txtFranMarkup.Text == "" ? 0 : Convert.ToInt32(txtFranMarkup.Text); return(obj.AddCarRentalDetails(objCar).ToString()); } catch (Exception ex) { throw ex; } finally { objCar = null; obj = null; } }
//Event Section private string BookEvent() { BLSchedule obj = new BLSchedule(); ArrayList psgDetails = GetPassengerDeatils(); try { string CustName = psgDetails[0].ToString(); string Gender = psgDetails[1].ToString(); int Age = Convert.ToInt32(psgDetails[2].ToString()); string EmailID = txtEmail.Text.ToString(); string Mobile_no = txtMobile.Text.ToString(); string Address = txtAddress.Text.ToString(); int stagboy = Session["SingleBoyTicketCount"] == null ? 0 : Convert.ToInt32(Session["SingleBoyTicketCount"].ToString()); int staggirl = Session["SingleGirlTicketCount"] == null ? 0 : Convert.ToInt32(Session["SingleGirlTicketCount"].ToString()); int couple = Session["CoupleTicketCount"] == null ? 0 : Convert.ToInt32(Session["CoupleTicketCount"].ToString()); int child = Session["ChildTicketCount"] == null ? 0 : Convert.ToInt32(Session["ChildTicketCount"].ToString()); decimal bookingAmt = Convert.ToDecimal(Session["TotalTicketValue"].ToString()); return(obj.AddEventBookingDetails(CustName, Gender, Age, EmailID, Mobile_no, Address, stagboy, staggirl, couple, child, bookingAmt).ToString()); } catch (Exception ex) { throw ex; } finally { obj = null; } }
public static string GetBookSeatInfo(int s, string mode) { DataTable dt = null; BLSchedule obj = new BLSchedule(); DataSet ds = (DataSet)obj.GetScheduleInfo(s, mode); if (ds != null && ds.Tables.Count > 0) { dt = (DataTable)ds.Tables[0]; } string seatno = ""; if (dt != null && dt.Rows.Count >= 1) { for (int i = 0; i < dt.Rows.Count; i++) { seatno = seatno + (dt.Rows[i]["SeatNo"]) + ","; } } return(seatno); }
private DataTable GetCarRentalScheduleDetails(int session_id) { BLSchedule objsch = new BLSchedule(); DataTable dt = objsch.GetCarRentalScheduleDetails(session_id); return(dt); }
protected void bindDetails(string tranid, string mobno) { try { BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.GetTicketInfo(tranid, mobno); if (dt != null && dt.Rows.Count > 0) { lblmsg.Visible = false; lbltranid.Text = dt.Rows[0]["tranId"].ToString(); lblCuntName.Text = dt.Rows[0]["CounterName"].ToString(); lblFrom.Text = dt.Rows[0]["From"].ToString(); lblTo.Text = dt.Rows[0]["Usage"].ToString(); lblMode.Text = dt.Rows[0]["Mode"].ToString(); lblDateTime.Text = Convert.ToDateTime(dt.Rows[0]["TravelDate"].ToString()).ToString("dd/MM/yyyy") + " " + dt.Rows[0]["TravelTime"].ToString(); string[] custname = dt.Rows[0]["CustName"].ToString().Split('/'); string[] Gender = dt.Rows[0]["Gender"].ToString().Split('/'); string[] Age = dt.Rows[0]["Age"].ToString().Split('/'); for (int i = 0; i < custname.Length; i++) { if (i == custname.Length - 1) { lblCustName.Text = lblCustName.Text + custname[i] + "-" + Gender[i] + "-" + Age[i]; } else { lblCustName.Text = lblCustName.Text + custname[i] + "-" + Gender[i] + "-" + Age[i] + "/"; } } lblMobNo.Text = dt.Rows[0]["MobNo"].ToString(); lblemail.Text = dt.Rows[0]["EmailID"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblSeats.Text = dt.Rows[0]["SelectedVehicle"].ToString(); lblAmt.Text = "Rs." + dt.Rows[0]["BookingAmt"].ToString(); lblTotalFare.Text = "Rs." + dt.Rows[0]["total_fare"].ToString(); lblBalanceFare.Text = "Rs." + dt.Rows[0]["BalanceAmt"].ToString(); if (dt.Rows[0]["FranName"].ToString() != "") { lblFranname.Text = "<br>Franchisee :" + dt.Rows[0]["FranName"].ToString(); if (Convert.ToInt32(dt.Rows[0]["Fran_Markup"].ToString()) > 0) { lblFranname.Text += "<br>Franchisee Commision/processing charges Rs. " + dt.Rows[0]["Fran_Markup"].ToString() + "(Franchisee commission is not a part of total fare amount.)"; } } lttPolicy.Text = dt.Rows[0]["Policydescription"].ToString(); lblBookingdt.Text = Convert.ToDateTime(dt.Rows[0]["BookedOn"].ToString()).ToString("dd/MM/yyyy hh:mm tt"); } else { lblmsg.Visible = true; lblmsg.Text = "Ticket no./Mobileno is not found,please enter valid Ticket no. and mobile/phone no."; } } catch (Exception e) { throw e; } }
protected void Button1_Click(object sender, EventArgs e) { BLSchedule obj = new BLSchedule(); Vehicle vehicle = new Vehicle(); vehicle.cunt_id = Session["cuntid"] == null ? 0 : Convert.ToInt32(Session["cuntid"].ToString().Trim()); vehicle.vehi_state = TextBox2.Text; vehicle.vehi_number = TextBox3.Text; vehicle.own_name = TextBox4.Text; vehicle.own_address = TextBox5.Text; vehicle.own_phone = TextBox7.Text; vehicle.vehi_type = DropDownList1.SelectedItem.Text.ToString(); vehicle.vehi_layout = DropDownList2.SelectedItem.Text.ToString(); int i = obj.AddVehicle(vehicle); if (i > 0) { Response.Write("Vehicle information has been inserted successfully."); } else { Response.Write("Error occured"); } TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox7.Text = ""; DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; }
public static string GetBookSeatInfo(int s, string mode) { DataTable dt = null; BLSchedule obj = new BLSchedule(); // mode = (string)Session["Mode"].ToString(); // int ses = Convert.ToInt32(hid_session.Value); DataSet ds = (DataSet)obj.GetScheduleInfo(s, mode); if (ds != null && ds.Tables.Count > 0) { dt = (DataTable)ds.Tables[0]; } string seatno = ""; if (dt != null && dt.Rows.Count >= 1) { for (int i = 0; i < dt.Rows.Count; i++) { // opItem = new Option(ResultDataTable.Rows[i]['vccodedesc'],ResultDataTable.Rows[i]['chcode']); // ListBoxObject.options[ListBoxObject.length] = opItem; seatno = seatno + (dt.Rows[i]["SeatNo"]) + ","; } } return(seatno); //return seatno;//*/ // return "Hello"; }
public void Get_travellingInfodetails(string source, string destination, int s_id) { BLSchedule obj = new BLSchedule(); DataSet ds = obj.GetTravellingInfo(source, destination, s_id); if (ds.Tables[0].Rows.Count > 0 && ds != null) { lblSrc.Text = ds.Tables[0].Rows[0][1].ToString(); lblDes.Text = ds.Tables[0].Rows[0][2].ToString(); //lblVeh.Text = mode.ToString(); lbldis.Text = ds.Tables[0].Rows[0][3].ToString(); string Landmark = ds.Tables[0].Rows[0][4].ToString(); Char[] dmter = { ',' }; string[] LM = Landmark.Split(dmter); lblLM1.Text = Landmark.ToString(); //lblLM1.Text = LM[0].ToString(); //lblLM2.Text = LM[1].ToString(); //lblLM3.Text = LM[2].ToString(); lblTT.Text = ds.Tables[0].Rows[0][5].ToString(); } if (ds.Tables[1].Rows.Count > 0 && ds != null) { lblMode.Text = Session["Mode"].ToString();; lblVeh.Text = Session["Mode"].ToString();; //lbldate.Text = lbldate.Text + " " + ds.Tables[1].Rows[0][3].ToString(); lblCounter.Text = ds.Tables[1].Rows[0][0].ToString() + "<br> " + ds.Tables[1].Rows[0][2].ToString(); Session["CounterAddress"] = lblCounter.Text.ToString(); } }
protected void btnpay_Click(object sender, EventArgs e) { TicketCancel obj = new TicketCancel(); obj.Ticketno = ViewState["Ticketno"].ToString(); obj.AccountHolderName = txtAccholderName.Text.Trim(); obj.BankName = txtBankName.Text.Trim(); obj.BankAccountNo = txtAccountno.Text.Trim(); obj.Mobile_no = txtMobno.Text.Trim(); obj.Email_id = txtEmailID.Text.Trim(); BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.CancelTicket(obj); lblMsg.Visible = true; if (dt != null && dt.Rows.Count > 0) { lblMsg.ForeColor = System.Drawing.Color.Green; lblMsg.Text = "Your ticket has been cancelled and cancellation transaction ID is <b> " + dt.Rows[0]["TxnID"].ToString() + " </b>.Cancellation charges will be deducted as per BuyMyETicket refund/cancellation policy and refund amount will be deposited into your BMETWallet or bank A/c within 5-6 business days."; txtAccholderName.Text = ""; txtAccountno.Text = ""; txtBankName.Text = ""; txtEmailID.Text = ""; txtMobno.Text = ""; btnpay.Enabled = false; SendMailTicketConfirmation((DataTable)ViewState["dtTicketDeatils"], dt.Rows[0]["TxnID"].ToString()); } else { lblMsg.Text = "This ticket is not cancelled due to some reasons,please try again or call at +919435173561"; } }
protected void bindDetails(string tranid, string mobno) { try { BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.GetTicketInfo(tranid, mobno); if (dt != null && dt.Rows.Count > 0) { lblmsg.Visible = false; lbltranid.Text = dt.Rows[0]["Booking_ID"].ToString(); lblEventName.Text = "ELECTRO NIGHT, Guwahati "; lblEventVenue.Text = " Kaamaakaazi Floating Disco Restaurant"; lblDateTime.Text = "3rd March 2017 - 6 PM onwards"; lblCustName.Text = dt.Rows[0]["Customer_name"].ToString() + "-" + dt.Rows[0]["Gender"].ToString() + "-" + dt.Rows[0]["Age"].ToString(); lblMobNo.Text = dt.Rows[0]["Mobile_no"].ToString(); lblemail.Text = dt.Rows[0]["Email_id"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); string pass = ""; if (Convert.ToInt16(dt.Rows[0]["StagBoy"].ToString()) > 0) { pass = pass + "Stag Boy -" + dt.Rows[0]["StagBoy"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["StagGirl"].ToString()) > 0) { pass = pass + "Stag Girl -" + dt.Rows[0]["StagGirl"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["Couple"].ToString()) > 0) { pass = pass + "No. of persons -" + dt.Rows[0]["Couple"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["Child"].ToString()) > 0) { pass = pass + "Child -" + dt.Rows[0]["Child"].ToString() + "<br>"; } lblPersonCount.Text = pass; lblAmt.Text = "Rs." + dt.Rows[0]["bookingBMET_amt"].ToString(); lttPolicy.Text = "<h3><u>Terms & Conditions</u></h3><li>People under 18 not allowed to enter the event.</li>< li > Intoxicated persons are not allowed to enter the event.</li><li>Food, Beverage and liquor drinks are not allowed from outside.</li><li>Management will not be responsible for any injury/accident due to negligence of guests.</li><li>The management has the right to remove any person found miss behaving or with a misconduct.</li><li>Once sold pass can’t be returned or refund.</li><li>Any technical issues or defaults kindly cooperate.</li><li>Camera’s are not allowed in the event.</li> "; lblBookingdt.Text = Convert.ToDateTime(dt.Rows[0]["UpdationDateTime"].ToString()).ToString("dd/MM/yyyy hh:mm tt"); } else { lblmsg.Visible = true; lblmsg.Text = "Ticket no./Mobileno is not found,please enter valid Ticket no. and mobile/phone no."; } } catch (Exception e) { throw e; } }
private void fillboardingdropdown() { ddlBoardingPoints.Items.Clear(); BLSchedule obj = new BLSchedule(); DataSet ds = obj.GetBoardingPoints(Convert.ToInt32(ViewState["session_id"].ToString())); if (ds != null && ds.Tables[0].Rows.Count > 0) { ddlBoardingPoints.Items.Insert(0, new ListItem("----Boarding points----", "-1")); for (int i = 0; i < ds.Tables[0].Columns.Count; i++) { ddlBoardingPoints.Items.Add(ds.Tables[0].Rows[0][i].ToString()); } } ds = null; obj = null; }
protected void fillGrid() { BLSchedule obj = new BLSchedule(); DataTable dt = null; if (Session["CR_TravelType"].ToString().Trim() == "Outstation") { dt = obj.GetCarRentalSchedule(Session["CR_TravelType"].ToString().Trim(), Session["CR_SourceCity"].ToString().Trim(), Session["CR_DesCity"].ToString().Trim(), Session["CR_TravelMode"].ToString().Trim()); } else { dt = obj.GetCarRentalSchedule(Session["CR_TravelType"].ToString().Trim(), Session["CR_SourceCity"].ToString().Trim(), null, Session["CR_TravelMode"].ToString().Trim()); } Grd_CarRental.DataSource = dt; Grd_CarRental.DataBind(); }
public void Get_travellingInfodetails(string source, string destination, int s_id) { BLSchedule obj = new BLSchedule(); DataSet ds = obj.GetTravellingInfo(source, destination, s_id); if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null) { lblSource.Text = ds.Tables[0].Rows[0][1].ToString(); lblDestination.Text = ds.Tables[0].Rows[0][2].ToString(); lblDistance.Text = ds.Tables[0].Rows[0][3].ToString(); lblBPoints.Text = ds.Tables[0].Rows[0][4].ToString(); lblTravelTime.Text = ds.Tables[0].Rows[0][5].ToString(); } if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null) { lblMode.Text = ds.Tables[1].Rows[0][1].ToString(); lblCounter.Text = ds.Tables[1].Rows[0][0].ToString() + "<br> " + ds.Tables[1].Rows[0][2].ToString(); Session["CounterAddress"] = lblCounter.Text.ToString(); } }
private string BookSumoBusService() { BLSchedule obj = new BLSchedule(); CashDetails objCash = new CashDetails(); ArrayList psgDetails = GetPassengerDeatils(); try { objCash.CustName = psgDetails[0].ToString(); objCash.EmailID = txtEmail.Text.ToString(); objCash.Mobile_no = txtMobile.Text.ToString(); objCash.Address = txtAddress.Text.ToString(); objCash.Gender = psgDetails[1].ToString(); objCash.Age = psgDetails[2].ToString(); objCash.session_id = Convert.ToInt32(ViewState["session_id"].ToString()); objCash.total_seats = GetSeats(); objCash.total_amount = ViewState["payableAmount"] == null?Convert.ToInt32(ViewState["CustomerAmt"].ToString()) : Convert.ToInt32(ViewState["payableAmount"].ToString()); objCash.ActiveID = 0; if (Session["Mode"] != null) { objCash.Mode = Session["Mode"].ToString(); } objCash.FranCode = ViewState["FranCode"] == null ? "" : ViewState["FranCode"].ToString().Trim(); objCash.cust_amount = Convert.ToInt32(ViewState["CustomerAmt"].ToString()); objCash.BoardingPoint = ddlBoardingPoints.SelectedItem.Text.ToString(); objCash.tranid = ""; return(obj.AddCashDetails(objCash).ToString()); } catch (Exception ex) { throw ex; } finally { objCash = null; obj = null; } }
public void Get_travellingInfodetails(string source, string destination, int s_id) { BLSchedule obj = new BLSchedule(); DataSet ds = obj.GetTravellingInfo(source, destination, s_id); if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0] != null) { lblSource.Text = ds.Tables[0].Rows[0][1].ToString(); lblDestination.Text = ds.Tables[0].Rows[0][2].ToString(); lblDistance.Text = ds.Tables[0].Rows[0][3].ToString(); lblBPoints.Text = ds.Tables[0].Rows[0][4].ToString(); lblTravelTime.Text = ds.Tables[0].Rows[0][5].ToString(); } if (ds.Tables[1].Rows.Count > 0 && ds.Tables[1] != null) { lblMode.Text = ds.Tables[1].Rows[0][1].ToString(); //lblVeh.Text = ds.Tables[1].Rows[0][1].ToString(); //lbldate.Text = lbldate.Text + " " + ds.Tables[1].Rows[0][3].ToString(); lblCounter.Text = ds.Tables[1].Rows[0][0].ToString() + "<br> " + ds.Tables[1].Rows[0][2].ToString(); Session["CounterAddress"] = lblCounter.Text.ToString(); } //if (ds.Tables[2].Rows.Count > 0 && ds.Tables[2] != null) //{ // for (int i = 0; i < ds.Tables[2].Rows.Count; ++i) // { // if (i == (ds.Tables[2].Rows.Count - 1)) // { // lblBPoints.Text = lblBPoints.Text + ds.Tables[2].Rows[i][0].ToString() ; // } // else // { // lblBPoints.Text = lblBPoints.Text + ds.Tables[2].Rows[i][0].ToString() + ", "; // } // } //} }
protected void Button1_Click(object sender, EventArgs e) { String cn = ConfigurationManager.ConnectionStrings["DBCon"].ToString(); SqlConnection con = new SqlConnection(cn); con.Open(); /* * string time = Convert.ToString(ddlTime.SelectedValue) + " " + Convert.ToString(ddlHr.SelectedValue); * DateTime dt = Convert.ToDateTime(txtScheduleDate.Text); * int fare=Convert.ToInt32(TextBox3.Text); * string qry = "insert into tbl_schd(cunt_name,vehi_number,frm_city,to_city,mode,dtm_date,schd_time,tran_value) values('" + TextBox1.Text + "','" + DropDownList1.SelectedItem.ToString() + "','" + DropDownList2.SelectedItem.ToString() + "','" + DropDownList3.SelectedItem.ToString() + "','" + TextBox2.Text + "'," + Convert.ToDateTime(txtScheduleDate.Text) + ",'" + time + "'," + Convert.ToInt32(TextBox3.Text) + ")"; * SqlCommand cmd = new SqlCommand("insert into tbl_schd(cunt_name,vehi_number,frm_city,to_city,mode,dtm_date,schd_time,tran_value) values(@c,@vn,@frm_city,@to_city,@mode,@dtm_date,@schd_time,@tran_value)", con); * cmd.Parameters.Add(new SqlParameter("@c", SqlDbType.Text, 50, TextBox1.Text.ToString())); * cmd.Parameters.Add(new SqlParameter("@vn", SqlDbType.Text, 50, DropDownList1.SelectedItem.ToString())); * * cmd.Parameters.Add(new SqlParameter("@frm_city", SqlDbType.Text, 50, DropDownList2.SelectedItem.ToString())); * cmd.Parameters.Add(new SqlParameter("@to_city", SqlDbType.Text, 50, DropDownList3.SelectedItem.ToString())); * cmd.Parameters.Add(new SqlParameter("@mode", SqlDbType.Text, 50, TextBox2.Text)); * cmd.Parameters.Add(new SqlParameter("@dtm_date", SqlDbType.DateTime, 0, dt.ToString())); * cmd.Parameters.Add(new SqlParameter("@schd_time", SqlDbType.Text, 50, time.ToString())); * cmd.Parameters.Add(new SqlParameter("@tran_value", SqlDbType.Int, 8, fare.ToString())); * * * * cmd.ExecuteNonQuery(); * Response.Write("Vehicle information has been inserted successfully."); * SqlCommand cmd = new SqlCommand(qry, con); * int i = cmd.ExecuteNonQuery(); */ string time = Convert.ToString(ddlTime.SelectedValue) + " " + Convert.ToString(ddlHr.SelectedValue); BLSchedule obj = new BLSchedule(); Scheduling scheduling = new Scheduling(); scheduling.cunt_id = Session["cuntid"] == null ? 0 : Convert.ToInt32(Session["cuntid"].ToString().Trim()); scheduling.vehi_number = DropDownList1.SelectedItem.ToString(); scheduling.frm_city = DropDownList2.SelectedItem.ToString(); scheduling.to_city = DropDownList3.SelectedItem.ToString(); scheduling.mode = DropDownList4.SelectedItem.ToString(); //DateTime dt = Convert.ToDateTime(txtScheduleDate.Text.ToString()); //scheduling.dtm_date = Convert.ToDateTime("16-10-2011 00:00:00"); //scheduling.dtm_date = Convert.ToDateTime(DateTime.Now.ToShortDateString()); scheduling.dtm_date = Convert.ToDateTime(txtScheduleDate.Text); scheduling.schd_time = time.ToString(); scheduling.tran_value = Convert.ToInt32(TextBox3.Text); scheduling.cust_dis = Convert.ToInt32(txtcustdiscount.Text); scheduling.fran_dis = Convert.ToInt32(txtFrandiscount.Text); int i = obj.CreateSchedule(scheduling); if (i > 0) { SqlCommand cmd1 = new SqlCommand("Select max(session_id) from tbl_schd", con); SqlDataReader dr = cmd1.ExecuteReader(); dr.Read(); int sid = Convert.ToInt32(dr[0].ToString()); Response.Write(sid.ToString()); dr.Close(); if (scheduling.mode.ToString() == "Sumo") { int ctr = 1; Response.Write(ctr.ToString()); while (ctr <= 10) { string s = "insert into tbl_layout_sumo(vehi_number,session_id,seat_no,booked,booking_dt,pay_status) values('" + DropDownList1.SelectedItem.ToString() + "'," + sid + "," + ctr + ",'N',null,'N')"; SqlCommand c1 = new SqlCommand(s, con); c1.ExecuteNonQuery(); ctr++; } } if (scheduling.mode.ToString() == "Bus") { BLSchedule objBll = new BLSchedule(); DataSet ds = objBll.GetScheduleDetails(sid); string vchlayout = ""; if (ds != null && ds.Tables.Count > 0) { vchlayout = ds.Tables[0].Rows[0]["VehiLayout"].ToString().Trim(); } int ctr = 1; if (vchlayout == "2*2") { while (ctr <= 40) { string s = "insert into tbl_layout_bus(vehi_number,session_id,seat_no,booked,booking_dt,pay_status) values('" + DropDownList1.SelectedItem.ToString() + "'," + sid + "," + ctr + ",'N',null,'N')"; SqlCommand c1 = new SqlCommand(s, con); c1.ExecuteNonQuery(); ctr++; } } else if (vchlayout == "2*1") { while (ctr <= 35) { string s = "insert into tbl_layout_bus(vehi_number,session_id,seat_no,booked,booking_dt,pay_status) values('" + DropDownList1.SelectedItem.ToString() + "'," + sid + "," + ctr + ",'N',null,'N')"; SqlCommand c1 = new SqlCommand(s, con); c1.ExecuteNonQuery(); ctr++; } } } Response.Write("Schedule Created successfully"); } }
protected void btnVerify_Click(object sender, EventArgs e) { if (txtFranCode.Text == "") { lblFranName.Text = "Please Enter Franchisee Code."; lblFranName.ForeColor = System.Drawing.Color.Red; } else { lblFranName.ForeColor = System.Drawing.Color.Purple; BLSchedule objsch = new BLSchedule(); DataTable dt = null; int franticketvalue; double FranComm; if (Request.QueryString["mode"] != null && Request.QueryString["mode"].ToString() == "Rental") { dt = objsch.GetFranchiseeDetails(txtFranCode.Text.ToString().Trim(), 0, "Rental"); } else { dt = objsch.GetFranchiseeDetails(txtFranCode.Text.ToString().Trim(), Convert.ToInt32(ViewState["session_id"].ToString()), ""); } if (dt != null && dt.Rows.Count > 0) { tbl_BmetWallet.Visible = false; tbl_BmetWalletinfo.Visible = true; ViewState["BMETWalletpwd"] = dt.Rows[0]["BMETWalletPwd"].ToString(); if (Request.QueryString["mode"] != null && Request.QueryString["mode"].ToString() == "Rental") { FranComm = Convert.ToDouble(ViewState["FranDiscount"].ToString()); franticketvalue = Convert.ToInt32((Convert.ToInt32(ViewState["CarRentalfare"].ToString()) * (Convert.ToDouble(ViewState["BmetDiscount"].ToString()) - FranComm)) / 100); } else { string[] seatno = GetSeats().Split(','); FranComm = Convert.ToDouble(dt.Rows[0]["FranDis"].ToString()); int franprice = Convert.ToInt32(dt.Rows[0]["FranTicketPrice"].ToString()); franticketvalue = seatno.Length * franprice; } if (FranComm > 0) { lblFranName.Text = "<b> Welcome " + dt.Rows[0]["FranName"].ToString() + ", Your Commision is: " + FranComm + "%</b>"; } else { lblFranName.Text = "<b> Welcome " + dt.Rows[0]["FranName"].ToString() + "</b>"; } lblAmtPayable.Text = "Rs. " + franticketvalue.ToString(); ViewState["payableAmount"] = franticketvalue.ToString(); ViewState["FranCode"] = txtFranCode.Text.ToString().Trim(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "chkEnabled('Y');", true); txtFranCode.Enabled = false; btnVerify.Enabled = false; lblFranNameWallet.Text = dt.Rows[0]["FranName"].ToString(); lblBmetWallet.Text = "Rs. " + dt.Rows[0]["BMETWallet"].ToString(); if (Convert.ToInt64(dt.Rows[0]["BMETWallet"].ToString()) >= franticketvalue) { lblBMETWalletmsg.Visible = true; txtBMETWalletCode.Visible = true; btnBMETWallet.Visible = true; } else { lblBmetWallet.Text = lblBmetWallet.Text + " <br><font color='purple'> Please recharge your BMETWallet for availing benefits.</font>"; lblBmetWallet.ForeColor = System.Drawing.Color.Red; } } else { txtFranCode.Text = ""; lblFranName.Text = "Invalid Franchisee Code"; lblFranName.ForeColor = System.Drawing.Color.Red; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "chkEnabled('N');", true); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { COM.CheckSumResponseBean objCheckSumResponseBean = new COM.CheckSumResponseBean(); TPSLUtil1 objTPSLUtil1 = new TPSLUtil1(); //Response.Write("Originally Generated String===========>" + Convert.ToString(Session["myString"]) + "End String===========>"); //String strResponseMsg = "01|9892381157|16462992|NA|5.00|10|NA|NA|INR|NA|NA|NA|NA|19-04-2011 12:31:40|0399|NA|12345|100000001|NA|NA|NA|NA|NA|NA|NA|777629931425";//Request["msg"] == null ? "" : Request["msg"].Trim(); if (System.Configuration.ConfigurationManager.AppSettings["TestMode"].ToString() == "1") { strResponseMsg = "L2983|" + Request.QueryString["msg"].ToString().Trim() + "|90203896|1212225152|1|300|32858463|NA|INR|NA|NA|NA|NA|13-12-2013 10:51:56|0300|NA|L2983|1|NA|NA|NA|NA|NA|NA|NA|125848191442"; } else { strResponseMsg = Request["msg"] == null ? "" : Request["msg"].Trim(); } //if(Request["msg"]!=null) // Response.Write(" Request[msg]===========>" + Request["msg"].ToString()); //else // Response.Write(" Response string is null"); if (strResponseMsg == "" || strResponseMsg == string.Empty || strResponseMsg == null) { Response.Write("strResponseMsg===========>TPSL Response" + strResponseMsg); } else { String[] token = strResponseMsg.Split('|'); BLSchedule objSch = new BLSchedule(); if (token.Length == 26) { objCheckSumResponseBean.MSG = strResponseMsg; objCheckSumResponseBean.PropertyPath = HttpContext.Current.Server.MapPath("~/Property/MerchantDetails_sharedhosting.property"); string strCheckSumValue = objTPSLUtil1.transactionResponseMessage(objCheckSumResponseBean); ViewState["ResponseCheckSum"] = token[25].ToString(); ViewState["Authstatus"] = token[14].ToString(); ViewState["ResponseCheckSum"] = strCheckSumValue;//written for testing if (!strCheckSumValue.Equals("")) { if (!ViewState["ResponseCheckSum"].ToString().Equals(strCheckSumValue)) { Status = "F"; } else { if (ViewState["Authstatus"].ToString() == "0300") { Status = "Y"; } else { Status = "N"; } } } else { Status = "F"; } TPSLResponse objTpsl = new TPSLResponse(); objTpsl.MERCHANTID = token[0].ToString(); objTpsl.CustomerID = token[1].ToString(); objTpsl.TxnreferenceNo = token[2].ToString(); objTpsl.BankReferenceNo = token[3].ToString(); objTpsl.TxnAmount = token[4].ToString(); objTpsl.BankID = token[5].ToString(); objTpsl.BankMERCHANTID = token[6].ToString(); objTpsl.TxnType = token[7].ToString(); objTpsl.CurrencyName = token[8].ToString(); objTpsl.ItemCode = token[9].ToString(); objTpsl.SecurityType = token[10].ToString(); objTpsl.SecurityID = token[11].ToString(); objTpsl.SecurityPassword = token[12].ToString(); objTpsl.TxnDate = token[13].ToString(); objTpsl.AuthStatus = token[14].ToString(); objTpsl.SettlementType = token[15].ToString(); objTpsl.AdditionalInfo1 = token[16].ToString(); objTpsl.AdditionalInfo2 = token[17].ToString(); objTpsl.AdditionalInfo3 = token[18].ToString(); objTpsl.AdditionalInfo4 = token[19].ToString(); objTpsl.AdditionalInfo5 = token[20].ToString(); objTpsl.AdditionalInfo6 = token[21].ToString(); objTpsl.AdditionalInfo7 = token[22].ToString(); objTpsl.ErrorStatus = token[23].ToString(); objTpsl.ErrorDescription = token[24].ToString(); objTpsl.CheckSum = token[25].ToString(); objTpsl.Status = Status; ViewState["tranid"] = objTpsl.CustomerID.ToString(); DataTable dt = objSch.UpdateUserCashDetails(objTpsl); if (dt != null && dt.Rows.Count > 0) { if (dt.Rows[0][0].ToString() == "Success") { lblMsg.Text = "Great!!! Your bookings have been done.Please take a printout of your booking receipt."; tbl_details.Visible = true; btnPrint.Visible = true; bindDetails(objTpsl.CustomerID.ToString()); } else { lblMsg.Text = "Oops!!!, your bookings have not been done, if your payment has been deducted please call on +919435173561 else try again."; btnPrint.Visible = false; tbl_details.Visible = false; } } } else if (token.Length == 1) { ViewState["tranid"] = token[0].ToString(); Response.Write("strResponseMsg===========>Token 1 block" + strResponseMsg); Response.Write(" ViewState[tranid] " + ViewState["tranid"].ToString()); DataTable dt = objSch.PaymentUpdateBMETWallet(token[0].ToString()); if (dt != null && dt.Rows.Count > 0) { if (dt.Rows[0]["Status"].ToString() == "Success") { lblMsg.Text = "Great!!! Dear <b>" + dt.Rows[0]["FranName"].ToString() + "</b>, Your bookings have been done.<br><br> <b> Your BMETWallet Balance was Rs." + dt.Rows[0]["PreBMETWalletBal"].ToString() + "<br>Transaction Amt. Rs." + dt.Rows[0]["txnAmt"].ToString() + "<br>Available BMETWallet Balance Rs." + dt.Rows[0]["ActualBMETWalletBal"].ToString() + " </b><br><br>Please take printout of your booking receipt. BuyMyETicket wishes a very happy journey."; btnPrint.Visible = true; bindDetails(ViewState["tranid"].ToString()); } else { lblMsg.Text = "Oops!!! Franchisee your bookings have not been done, if your payment has been deducted please call on 9435173561 else try again."; btnPrint.Visible = false; tbl_details.Visible = false; } } } else { Response.Write("Inside ELSE of Response***********"); return; } } } }
protected void btnGetDetails_Click(object sender, EventArgs e) { try { //lblMsg.Text = "Dear Customer, Your tickets have been booked.Please take a printout.BuyMyETicket wishes a very happy journey."; BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.GetTicketInfo(txtticketno.Text.ToString().Trim(), txtMobile.Text.ToString().Trim()); if (dt != null && dt.Rows.Count > 0) { ViewState["dtTicketDeatils"] = dt; lbltranid.Text = dt.Rows[0]["tranId"].ToString(); ViewState["Ticketno"] = dt.Rows[0]["tranId"].ToString(); lblCuntName.Text = dt.Rows[0]["CounterName"].ToString(); lblFrom.Text = dt.Rows[0]["From"].ToString(); lblTo.Text = dt.Rows[0]["To"].ToString(); lblMode.Text = dt.Rows[0]["Mode"].ToString(); lblDateTime.Text = Convert.ToDateTime(dt.Rows[0]["TravelDate"].ToString()).ToString("dd/MM/yyyy") + " " + dt.Rows[0]["TravelTime"].ToString(); lblCustName.Text = dt.Rows[0]["CustName"].ToString(); lblMobNo.Text = dt.Rows[0]["MobNo"].ToString(); lblemail.Text = dt.Rows[0]["EmailID"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblSeats.Text = dt.Rows[0]["SeatBooked"].ToString(); lblAmt.Text = "Rs." + dt.Rows[0]["Amt"].ToString(); if (dt.Rows[0]["BoardingPoints"].ToString() != null) { lblBoardingPoints.Text = "Boarding Points :: " + dt.Rows[0]["BoardingPoints"].ToString(); } lblBookedOn.Text = "Booked on :" + Convert.ToDateTime(dt.Rows[0]["BookedOn"].ToString()).ToString("dd/MM/yyyy hh:mm tt"); string trdt = Convert.ToDateTime(dt.Rows[0]["TravelDate"].ToString()).ToString("MM/dd/yyyy"); DateTime schddt = Convert.ToDateTime(trdt + " " + dt.Rows[0]["TravelTime"].ToString()); TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE); //DateTime currectdt = DateTime.Now; TimeSpan ts = schddt - indianTime; double mins = ts.TotalMinutes; if (mins <= 360) { ts = TimeSpan.FromMinutes(mins); lblMsg.Visible = true; lblMsg.Text = "Only " + ts.Hours + "hrs " + ts.Minutes + " mins left in departure, as per BuyMyETicket cancellation policy this ticket cannot be cancelled online,for further query please contact at +919435173561."; //ScriptManager.RegisterStartupScript(this, GetType(), "Javascript", "javascript:showDiv('N'); ", true); tbl_BankInfo.Visible = false; tbl_details.Visible = true; } else { // ScriptManager.RegisterStartupScript(this, GetType(), "Javascript", "javascript:showDiv('Y'); ", true); tbl_BankInfo.Visible = true; tbl_details.Visible = true; lblMsg.Visible = false; lblMsg.Text = ""; } } else { // ScriptManager.RegisterStartupScript(this, GetType(), "Javascript", "javascript:showDiv('V'); ", true); tbl_BankInfo.Visible = false; tbl_details.Visible = false; lblMsg.Visible = true; lblMsg.Text = "Ticket no./Mobileno is not found,please enter valid Ticket no. and mobile/phone no."; txtticketno.Text = ""; txtMobile.Text = ""; } } catch (Exception ex) { throw ex; } }
public void filldata(int sessionid) { BLSchedule obj = new BLSchedule(); DataSet ds = obj.GetScheduleInfo(s_id, Session["VType"].ToString()); if (ds != null && ds.Tables[0].Rows.Count > 0) { if (Convert.ToInt32(ds.Tables[0].Rows[0][2]) == 1 && ds.Tables[0].Rows[0][3].ToString() == "Y") { Button1.BackColor = Color.Red; Button1.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[1][2]) == 2 && ds.Tables[0].Rows[1][3].ToString() == "Y") { Button2.BackColor = Color.Red; Button2.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[2][2]) == 3 && ds.Tables[0].Rows[2][3].ToString() == "Y") { Button3.BackColor = Color.Red; Button3.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[3][2]) == 4 && ds.Tables[0].Rows[3][3].ToString() == "Y") { Button4.BackColor = Color.Red; Button4.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[4][2]) == 5 && ds.Tables[0].Rows[4][3].ToString() == "Y") { Button5.BackColor = Color.Red; Button5.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[5][2]) == 6 && ds.Tables[0].Rows[5][3].ToString() == "Y") { Button6.BackColor = Color.Red; Button6.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[6][2]) == 7 && ds.Tables[0].Rows[6][3].ToString() == "Y") { Button7.BackColor = Color.Red; Button7.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[7][2]) == 8 && ds.Tables[0].Rows[7][3].ToString() == "Y") { Button8.BackColor = Color.Red; Button8.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[8][2]) == 9 && ds.Tables[0].Rows[8][3].ToString() == "Y") { Button9.BackColor = Color.Red; Button9.Enabled = false; } if (Convert.ToInt32(ds.Tables[0].Rows[9][2]) == 10 && ds.Tables[0].Rows[9][3].ToString() == "Y") { Button10.BackColor = Color.Red; Button10.Enabled = false; } } }
protected void bindDetails(string tranid, string mobno) { try { BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.GetTicketInfo(tranid, mobno); if (dt != null && dt.Rows.Count > 0) { lblmsg.Visible = false; lbltranid.Text = dt.Rows[0]["tranId"].ToString(); lblCuntName.Text = dt.Rows[0]["CounterName"].ToString(); lblFrom.Text = dt.Rows[0]["From"].ToString(); lblTo.Text = dt.Rows[0]["To"].ToString(); lblMode.Text = dt.Rows[0]["Mode"].ToString(); lblDateTime.Text = Convert.ToDateTime(dt.Rows[0]["TravelDate"].ToString()).ToString("dd/MM/yyyy") + " " + dt.Rows[0]["TravelTime"].ToString(); string[] custname = dt.Rows[0]["CustName"].ToString().Split('/'); string[] Gender = dt.Rows[0]["Gender"].ToString().Split('/'); string[] Age = dt.Rows[0]["Age"].ToString().Split('/'); for (int i = 0; i < custname.Length; i++) { if (i == custname.Length - 1) { lblCustName.Text = lblCustName.Text + custname[i] + "-" + Gender[i] + "-" + Age[i]; } else { lblCustName.Text = lblCustName.Text + custname[i] + "-" + Gender[i] + "-" + Age[i] + "/"; } } //lblCustName.Text = dt.Rows[0]["CustName"].ToString(); lblMobNo.Text = dt.Rows[0]["MobNo"].ToString(); lblemail.Text = dt.Rows[0]["EmailID"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblSeats.Text = dt.Rows[0]["SeatBooked"].ToString(); lblAmt.Text = "Rs." + dt.Rows[0]["Amt"].ToString(); //if (dt.Rows[0]["Gender"].ToString() != "") // lblGender.Text = dt.Rows[0]["Gender"].ToString(); //else // lblGender.Text = ""; //if (dt.Rows[0]["Age"].ToString() != "0" || dt.Rows[0]["Age"].ToString() != "") // lblAge.Text = dt.Rows[0]["Age"].ToString(); //else // lblAge.Text = ""; if (dt.Rows[0]["BoardingPoints"].ToString() != "") { lblBoardingPoints.Text = "<b>" + "Boarding Points :: " + dt.Rows[0]["BoardingPoints"].ToString() + "</b>"; } if (dt.Rows[0]["Ticketprice"].ToString() != "" && dt.Rows[0]["Cusdis"].ToString() != "") { //lblTicketAmt.Text = "Market Ticket price (per person) Rs." + dt.Rows[0]["Ticketprice"].ToString() + "<br><b> BuyMyETicket discount :" + dt.Rows[0]["Cusdis"].ToString() + "%</b> <br> Ticket Fare : Rs." + dt.Rows[0]["Amt"].ToString(); lblTicketAmt.Text = "Ticket Fare : Rs." + dt.Rows[0]["Amt"].ToString(); } if (dt.Rows[0]["FranName"].ToString() != "") { string[] strs = dt.Rows[0]["SeatBooked"].ToString().Trim().Split(','); int fran_processingfees = strs.Length * 20; lblBookingdt.Text = Convert.ToDateTime(dt.Rows[0]["BookedOn"].ToString()).ToString("dd/MM/yyyy hh:mm tt") + " <br> <b> Franchisee :" + dt.Rows[0]["FranName"].ToString() + "</b>"; int totAmt = Convert.ToInt32(dt.Rows[0]["Amt"].ToString()) + fran_processingfees; lblTicketAmt.Text = lblTicketAmt.Text + " + Rs." + fran_processingfees + "(Franchisee processing charges Rs.20 per seat)<br> Total Amount Paid : Rs." + totAmt; } else { lblBookingdt.Text = Convert.ToDateTime(dt.Rows[0]["BookedOn"].ToString()).ToString("dd/MM/yyyy hh:mm tt"); } } else { lblmsg.Visible = true; lblmsg.Text = "Ticket no./Mobileno is not found,please enter valid Ticket no. and mobile/phone no."; } } catch (Exception e) { throw e; } }
protected void bindDetails(string tranid) { try { BLSchedule objBLL = new BLSchedule(); DataTable dt = objBLL.GetTicketInfo(tranid, ""); if (dt != null && dt.Rows.Count > 0) { ViewState["tranidCarRental"] = tranid.ToString().Substring(0, 2); if (ViewState["tranidCarRental"].ToString() == "EV") { string pass = ""; tbl_details.Visible = false; tbl_Event.Visible = true; lblBookingno.Text = dt.Rows[0]["Booking_ID"].ToString(); lbleventname.Text = "ELECTRO NIGHT"; lblVenue.Text = "Kaamaakaazi Floating Disco Restaurant"; lbleventdatetime.Text = "3rd March 2017 - 6 PM onwards"; if (Convert.ToInt16(dt.Rows[0]["StagBoy"].ToString()) > 0) { pass = pass + "Stag Boy -" + dt.Rows[0]["StagBoy"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["StagGirl"].ToString()) > 0) { pass = pass + "Stag Girl -" + dt.Rows[0]["StagGirl"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["Couple"].ToString()) > 0) { pass = pass + "No. of persons -" + dt.Rows[0]["Couple"].ToString() + "<br>"; } if (Convert.ToInt16(dt.Rows[0]["Child"].ToString()) > 0) { pass = pass + "Child -" + dt.Rows[0]["Child"].ToString() + "<br>"; } lblpersonCount.Text = pass; lbleventAmt.Text = "Rs " + dt.Rows[0]["bookingBMET_amt"].ToString(); lblname.Text = dt.Rows[0]["Customer_name"].ToString(); lbleventuserMobno.Text = dt.Rows[0]["Mobile_no"].ToString(); lbl_email.Text = dt.Rows[0]["Email_id"].ToString(); lblAdd.Text = dt.Rows[0]["Address"].ToString(); //Uncomment below line while uploading on Live // SendSMSTicket(dt); SendMailTicketConfirmation(dt); } else { tbl_details.Visible = true; tbl_Event.Visible = false; if (ViewState["tranidCarRental"].ToString() == "CR") { lblDes.Text = "Usage"; lblDesDateTime.Text = "Pick-Up Date & Time"; lblDesAmt.Text = "Booking Amount"; lblBoardingPoints.Text = "<b> Balance Amount (Approx.) Rs." + dt.Rows[0]["BalanceAmt"].ToString();; lttPolicy.Text = dt.Rows[0]["Policydescription"].ToString(); lblTo.Text = dt.Rows[0]["Usage"].ToString(); lblSeats.Text = dt.Rows[0]["SelectedVehicle"].ToString(); lblAmt.Text = "Rs." + dt.Rows[0]["BookingAmt"].ToString(); //Uncomment below line while uploading on Live - car rental only email // SendMailTicketConfirmation(dt); } else { lblTo.Text = dt.Rows[0]["To"].ToString(); lblSeats.Text = dt.Rows[0]["SeatBooked"].ToString(); lblAmt.Text = "Rs." + dt.Rows[0]["Amt"].ToString(); if (dt.Rows[0]["BoardingPoints"].ToString() != null) { lblBoardingPoints.Text = "Boarding Points :: " + dt.Rows[0]["BoardingPoints"].ToString(); } //Uncomment below line while uploading on Live // SendSMSTicket(dt); // SendMailTicketConfirmation(dt); } lbltranid.Text = dt.Rows[0]["tranId"].ToString(); lblCuntName.Text = dt.Rows[0]["CounterName"].ToString(); lblFrom.Text = dt.Rows[0]["From"].ToString(); lblMode.Text = dt.Rows[0]["Mode"].ToString(); lblDateTime.Text = Convert.ToDateTime(dt.Rows[0]["TravelDate"].ToString()).ToString("dd/MM/yyyy") + " " + dt.Rows[0]["TravelTime"].ToString(); lblCustName.Text = dt.Rows[0]["CustName"].ToString(); lblMobNo.Text = dt.Rows[0]["MobNo"].ToString(); lblemail.Text = dt.Rows[0]["EmailID"].ToString(); lblAddress.Text = dt.Rows[0]["Address"].ToString(); lblBookedOn.Text = "Booked on :" + Convert.ToDateTime(dt.Rows[0]["BookedOn"].ToString()).ToString("dd/MM/yyyy hh:mm tt"); } } } catch (Exception e) { throw e; } }