コード例 #1
0
    protected void GetTicketDetails()
    {
        try
        {
            if (Session["manabusrefno"] != null)
            {
                ObjBAL = new ClsBAL();
                ObjBAL.manabusRefNo = Session["manabusrefno"].ToString();
                _objDataSetBook = (DataSet)ObjBAL.GetTicketIdByManabusRefNo();
                if (_objDataSetBook != null)
                {
                    if (_objDataSetBook.Tables.Count > 0)
                    {
                        if (_objDataSetBook.Tables[0].Rows.Count > 0)
                        {
                            string travelName = _objDataSetBook.Tables[0].Rows[0]["TravelOPName"].ToString();
                            string api = _objDataSetBook.Tables[0].Rows[0]["APIName"].ToString();
                            lblNewcashcouponcode.Text = _objDataSetBook.Tables[0].Rows[0]["CouponNo"].ToString();
                            lblnewCouponAmount.Text = _objDataSetBook.Tables[0].Rows[0]["CashCouponAmount"].ToString();
                            gvView.DataSource = _objDataSetBook.Tables[0];
                            gvView.DataBind();
                            GetCancellationPolicy(travelName);
                            if (api == "Kesineni")
                            {
                                imgKesineni.Visible = true;
                            }
                            Mail();
                            #region SMS
                            Label lblManabusRefNo = (Label)gvView.Rows[0].FindControl("lblManabusRefNo");
                            Label lblDOJ = (Label)gvView.Rows[0].FindControl("lblDOJ");
                            Label lblTravelName = (Label)gvView.Rows[0].FindControl("lblTravelName");
                            Label lblSourceName = (Label)gvView.Rows[0].FindControl("lblSourceName");
                            Label lblDestinationName = (Label)gvView.Rows[0].FindControl("lblDestinationName");
                            Label lblBusType = (Label)gvView.Rows[0].FindControl("lblBusType");
                            Label lblBoardingPoint = (Label)gvView.Rows[0].FindControl("lblBoardingPoint");
                            Label lblEmailID = (Label)gvView.Rows[0].FindControl("lblEmailid");
                            Label lblContactNo = (Label)gvView.Rows[0].FindControl("lblContactNo");
                            Label lblBookedBy = (Label)gvView.Rows[0].FindControl("lblBookedBy");
                            string msg = "Hi " + lblBookedBy.Text + "Your Journey Details are" + System.Environment.NewLine + "Route : " + lblSourceName.Text + " to " + lblDestinationName.Text + System.Environment.NewLine + "Reference N0: " + lblManabusRefNo.Text + System.Environment.NewLine +
                                "Travel Name: " + lblTravelName.Text;
                            string msg1 = " DOJ: " + lblDOJ.Text + System.Environment.NewLine + System.Environment.NewLine + "Thanks & Regards," + System.Environment.NewLine + "LoveJourney team";

          //                  string strUrl = "http://sms.cheapgoogleads.com/WebServiceSMS.aspx?User=superbus&passwd=hyderabad&mobilenumber=" + lblContactNo.Text.ToString() +
          //"&message= " + msg.ToString();

          //                  string strUrl2 = "http://sms.cheapgoogleads.com/WebServiceSMS.aspx?User=superbus&passwd=hyderabad&mobilenumber=" + lblContactNo.Text.ToString() +
          //"&message= " + msg1.ToString();
          //                  SendSMS(strUrl);
          //                  SendSMS(strUrl2);
                            #endregion
                        }
                        else
                        {
                            pnlmail.Visible = false;
                        }
                    }
                }
            }

        }
        catch (System.Exception ex)
        {
            throw ex;
        }
        finally
        {
            if (_objDataSetBook != null)
            {
                _objDataSetBook = null;
            }
        }
    }