コード例 #1
0
    protected void AddCancellation(int bookingId, int tentativeId, string seatNos, string emailId, string refundAmt, string CancelCharges, string APIName, int Hours)
    {
        try
        {
            objBAL = new ClsBAL();
            objBAL.bookingId = Convert.ToInt32(bookingId);
            objBAL.tentativeId = Convert.ToInt32(tentativeId);
            objBAL.cancelSeats = seatNos;
            objBAL.emailId = emailId;
            objBAL.refundAmount = refundAmt;
            objBAL.cancellationCharges = CancelCharges;

            objBAL.couponNo = lblCode.Text.ToString();
            objBAL.createdBy = Convert.ToInt32(Session["UserID"]);
            objBAL.APIName = APIName.ToString().ToUpper();
            objBAL.Hours = Hours;
            ObjDataset = (DataSet)objBAL.AddCancellation();
            if (ObjDataset != null)
            {
                if (ObjDataset.Tables.Count > 0)
                {
                    if (ObjDataset.Tables[0].Rows.Count > 0)
                    {
                        if (ObjDataset.Tables[0].Rows[0]["CouponNo"].ToString() == "Already Exists")
                        {
                            AddCancellation(bookingId, tentativeId, seatNos, emailId, refundAmt, CancelCharges, APIName, Hours);
                        }
                        else if (ObjDataset.Tables[0].Rows[0]["CouponNo"].ToString() == "Success")
                        {
                            lblMsg.Text = "Ticket cancelled successfully.";
                            lblMsg.ForeColor = System.Drawing.Color.Green;
                            if (ViewState["APIName"] != null)
                            {
                                if (ViewState["APIName"].ToString() == "Bitla")
                                {
                                    gvPartialCancellation.Visible = rbtnlstCancelType.Visible = btnConfrmCancel.Visible = false;
                                }
                                else if (ViewState["APIName"].ToString() == "Kesineni")
                                {
                                    gvPartialCancellation.Visible = rbtnlstCancelType.Visible = btnConfrmCancel.Visible = false;
                                }
                            }
                        }
                        else
                        {
                            lblMsg.Text = "Failed to insert.";
                        }
                    }
                    else
                    {
                        lblMsg.Text = "Failed to insert.";
                    }
                }
                else
                {
                    lblMsg.Text = "Failed to insert.";
                }
            }
            else
            {
                lblMsg.Text = "Failed to insert.";
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
コード例 #2
0
    protected void AddCancellation(int bookingId, int tentativeId, string seatNos, string emailId, string refundAmt, string CancelCharges)
    {
        try
        {
            objBAL = new ClsBAL();
            objBAL.bookingId = Convert.ToInt32(bookingId);
            objBAL.tentativeId = Convert.ToInt32(tentativeId);
            objBAL.cancelSeats = seatNos;
            objBAL.emailId = emailId;
            objBAL.refundAmount = refundAmt;
            objBAL.cancellationCharges = CancelCharges;
            lblCode.Text = "Can" + GeneratePromocode();
            objBAL.couponNo = lblCode.Text.ToString();
            objBAL.createdBy = Convert.ToInt32(Session["UserID"].ToString());
            ObjDataset = (DataSet)objBAL.AddCancellation();
            if (ObjDataset != null)
            {
                if (ObjDataset.Tables.Count > 0)
                {
                    if (ObjDataset.Tables[0].Rows.Count > 0)
                    {
                        if (ObjDataset.Tables[0].Rows[0]["CouponNo"].ToString() == "Already  Exists")
                        {
                            AddCancellation(bookingId, tentativeId, seatNos, emailId, refundAmt, CancelCharges);
                        }
                        else if (ObjDataset.Tables[0].Rows[0]["CouponNo"].ToString() == "Success")
                        {
                            lblMsg.Text = "Ticket cancelled successfully.Cash Coupon Code has been sent to your Email Id Please check";
                            lblMsg.ForeColor = System.Drawing.Color.Green;
                            txtEmailID.Text = txtMBRefNo.Text = "";
                            if (ViewState["APIName"] != null)
                            {
                                if (ViewState["APIName"].ToString() == "Bitla")
                                {
                                    gvPartialCancellation.Visible = rbtnlstCancelType.Visible = btnConfrmCancel.Visible = false;
                                }
                                else if (ViewState["APIName"].ToString() == "Kesineni")
                                {
                                    gvPartialCancellation.Visible = rbtnlstCancelType.Visible = btnConfrmCancel.Visible = false;
                                    txtEmailID.Text = txtMBRefNo.Text = "";
                                }
                            }
                            string body = "HI " + Session["NameMail"].ToString() + ",<br/><br/>" + "Ticket has been cancelled successfully. Your Cash coupon code is " + lblCode.Text.ToString() + "<br/>Note: This Coupon will expire with in 6 months." + "<br/><br/>Thanks & Regards,<br/>LoveJourney Team.";
                            Mailsender.SendEmail(Session["EmailIdMail"].ToString(), "", "", "LoveJourney Cash Coupon Code", body);
                            lblMsg.Text = "Ticket cancelled successfully.Cash Coupon Code has been sent to your Email Id Please check";
                        }
                        else
                        {
                            lblMsg.Text = "Failed to insert..Try Again";
                        }
                    }
                    else
                    {
                        lblMsg.Text = "Failed to insert..Try Again";
                    }
                }
                else
                {
                    lblMsg.Text = "Failed to insert..Try Again";
                }
            }
            else
            {
                lblMsg.Text = "Failed to insert..Try Again";
            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }