Пример #1
0
    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";
        }
    }
Пример #2
0
 // 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));
     }
 }
Пример #3
0
        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);
        }
Пример #4
0
        public DataTable CancelTicket(TicketCancel obj)
        {
            try
            {
                DALSchedule objSch = new DALSchedule();

                DataTable dt = objSch.CancelTicket(obj);

                return(dt);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #5
0
 // 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));
     }
 }
Пример #6
0
 // 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));
     }
 }