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"; } }
// POST api/<controller> public HttpResponseMessage Post(TicketCancel f1) { try { db.TicketCancels.Add(f1); db.SaveChanges(); return(new HttpResponseMessage(HttpStatusCode.Created)); } catch { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
public DataTable CancelTicket(TicketCancel obj) { DBParams[] dbParams = new DBParams[6]; dbParams[0] = new DBParams("@TicketNo", obj.Ticketno, ParamType.String, ParamDirection.Input); dbParams[1] = new DBParams("@AccountHolderName", obj.AccountHolderName, ParamType.String, ParamDirection.Input); dbParams[2] = new DBParams("@BankAccountNo", obj.BankAccountNo, ParamType.String, ParamDirection.Input); dbParams[3] = new DBParams("@BankName", obj.BankName, ParamType.String, ParamDirection.Input); dbParams[4] = new DBParams("@Email_id", obj.Email_id, ParamType.String, ParamDirection.Input); dbParams[5] = new DBParams("@Mobile_no", obj.Mobile_no, ParamType.String, ParamDirection.Input); DataTable dt = DALHandler.GetDataTable(Constants.CancelTicket, dbParams); return(dt); }
public DataTable CancelTicket(TicketCancel obj) { try { DALSchedule objSch = new DALSchedule(); DataTable dt = objSch.CancelTicket(obj); return(dt); } catch (Exception) { throw; } }
// PUT api/<controller>/5 public HttpResponseMessage Put(int id, TicketCancel f1) { try { if (id == f1.ticketno) { db.Entry(f1).State = System.Data.Entity.EntityState.Modified; return(new HttpResponseMessage(HttpStatusCode.OK)); } else { return(new HttpResponseMessage(HttpStatusCode.NotFound)); } } catch (Exception ex) { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
// DELETE api/<controller>/5 public HttpResponseMessage Delete(int id) { try { TicketCancel f = db.TicketCancels.Find(id); if (f != null) { db.TicketCancels.Remove(f); db.SaveChanges(); return(new HttpResponseMessage(HttpStatusCode.OK)); } else { return(new HttpResponseMessage(HttpStatusCode.NotFound)); } } catch (Exception ex) { return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }