protected bool UpdateCashCoupon(string manabusrefNo, string emailID)
    {
        try
        {
            bool ress = false;
            ObjBAL = new ClsBAL();
            ObjBAL.manabusRefNo = manabusrefNo;
            _objDataSet = (DataSet)ObjBAL.GetUpdatedCouponDetails();

            if (_objDataSet != null)
            {

                if (_objDataSet.Tables[0].Rows.Count > 0)
                {
                    double amount = Convert.ToDouble(_objDataSet.Tables[0].Rows[0]["AmountAfterPG"].ToString());
                    if (amount > 0)
                    {
                        string couponcode = GenerateCashCoupon();

                        goto next;
                    next:
                        bool REs1 = AddCashCoupon(Convert.ToString(amount), couponcode, emailID);
                        if (REs1)
                        {
                            string body = "Dear Valued Customer, " + ",<br/><br/>" + "Thank you for using LoveJourney.in as your travel partner for booking your Bus Ticket. You can enter the cash coupon ID in the cash coupon box on the personal details page the next time you want to transact on LoveJourney.in and your amount will be adjusted against the fare.<br/><br/>"
                            + "Below are the cash coupon details of the cancelled ticket<br/><br/>Cash Coupon ID :" + couponcode + "<br/> Coupon Value: " + amount + "<br/>Expiry Date :" + DateTime.Now.AddMonths(6).ToString()
                            + "<br/><br/>Please save the cash coupon ID. This cash coupon can be used during your next transaction on LoveJourney.in. For more details about cash coupon, please visit the frequently asked questions page http://LoveJourney.in/FAQ." +
                            "<br/><br/>Best regards,<br/>Support Staff.<br/>LoveJourney.in";
                            Mailsender.SendEmail(emailID, "", "", "LoveJourney Cash Coupon Code", body);
                            lblMsg.Text = "Cash Coupon Code has been sent to your Email Id Please check";
                            ress = true;
                        }
                        else
                        {
                            goto next;

                        }
                    }
                    else if (amount == 0)
                    {
                        ress = true;
                    }
                }

            }
            return ress;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
Ejemplo n.º 2
0
    protected bool UpdateCashCoupon(string manabusrefNo, string emailID)
    {
        try
        {
            bool ress = false;
            ObjManbusBAL = new ClsBAL();
            ObjManbusBAL.manabusRefNo = manabusrefNo;
            _objDataSet = (DataSet)ObjManbusBAL.GetUpdatedCouponDetails();

            if (_objDataSet != null)
            {

                if (_objDataSet.Tables[0].Rows.Count > 0)
                {
                    double amount = Convert.ToDouble(_objDataSet.Tables[0].Rows[0]["AmountAfterPG"].ToString());
                    if (amount > 0)
                    {
                        string couponcode = GenerateCashCoupon();

                        goto next;
                    next:
                        bool REs1 = AddCashCoupon(Convert.ToString(amount), couponcode, emailID);
                        if (REs1)
                        {
                            string body = "HI " + ",<br/><br/>" + "Thanks for booking ticket. Your new cash coupon code is " + couponcode + " of amount <b>" + amount + "</b><br/>Note: This Coupon will expire with in 6 months." + "<br/><br/>Thanks & Regards,<br/>LoveJourney Team.";
                            Mailsender.SendEmail(emailID, "", "", "LoveJourney Cash Coupon Code", body);
                            lblMsg.Text = "Cash Coupon Code has been sent to your Email Id Please check";
                            ress = true;
                        }
                        else
                        {
                            goto next;

                        }
                    }
                    else if (amount == 0)
                    {
                        ress = true;
                    }
                }

            }
            return ress;
        }
        catch (Exception ex)
        {

            throw ex;
        }
        finally
        {

            if (_objDataSet != null)
            {
                _objDataSet = null;
            }
        }
    }