Exemple #1
0
    public void EnterPackagedetail()
    {
        try
        {
            package = new Package_BLogic();
            Package Newpackage = new Package();
            //Newpackage.Name = txtPackageName.Text;
            // Newpackage.Description = txtdescription.Text;
            Newpackage.NoOfMonth = Convert.ToInt32(txtmonth.Text);

            string packageavailablity = checkpackagename(txtPackageName.Text.Trim());

            if (packageavailablity.Trim().ToLower() == "false")
            {
                New_Package_ID            = package.InsertNewPackage(Newpackage);
                Session["New_Package_ID"] = New_Package_ID;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record inserted sucessfully') ;window.location ='PackageRegistration.aspx' </script>", false);
            }
            else
            {
                //lblAvailibility.Text = "Package already exist";
                txtPackageName.Text = "";
                txtdescription.Text = "";
                txtprice.Text       = "";

                //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "alert('This package alredy exist........')",true);
            }
        }
        catch (Exception ex)
        {
        }
    }
 public void InsertIntoRefundMaster(string merchantid, string txnid, string amount, string statuscode, string statusmessage)
 {
     try
     {
         Package_BLogic OPackage_Blogic = new Package_BLogic();
         Package_BLogic oPackageData    = new Package_BLogic();
         Package        Opackage        = new Package();
         Opackage.MerchantID    = merchantid;
         Opackage.TXNID         = txnid;
         Opackage.Amount        = amount;
         Opackage.StatusCode    = statuscode;
         Opackage.StatusMessage = statusmessage;
         int result = oPackageData.InsertRefundDetails(Opackage);
         if (result > 1)
         {
             WebMsg.Show("Refund done sucessfully");
         }
         else
         {
             WebMsg.Show("Refund not done sucessfully");
         }
     }
     catch (Exception)
     {
     }
 }
    protected void InsertIntoTransactionMaster(string Productid)
    {
        try
        {
            DataTable dt = (DataTable)Session["SelectedPackage"];
            Session["EndDate"] = dt.Rows[0]["ExpiryDate"].ToString();
            Package_BLogic OPackage_Blogic = new Package_BLogic();
            Package        Opackage        = new Package();
            string         packageID       = string.Empty;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                packageID += dt.Rows[i]["PackageID"].ToString() + ",";
            }
            Opackage.StudentID = Convert.ToInt32(AppSessions.StudentID);
            Opackage.PackgeID  = packageID.Substring(0, packageID.Length - 1);
            PackagePrice       = Convert.ToDecimal(Session["PackagePrice"].ToString().Trim());
            Opackage.Price     = PackagePrice;
            Opackage.Status    = "In Progress";

            Session["TransactionID"] = TransactionID.ToString();
            Opackage.TransactionID   = TransactionID.ToString().Trim();
            Opackage.BMSID           = AppSessions.BMSID;
            Opackage.BoardID         = AppSessions.BoardID;
            Opackage.MediumID        = AppSessions.MediumID;
            Opackage.StandardID      = AppSessions.StandardID;
            Opackage.ProductID       = Productid.ToString();


            OPackage_Blogic.InsertTransactionDetails(Opackage);
        }
        catch (Exception ex)
        {
        }
    }
 public void FillAllTansaction()
 {
     try
     {
         DataSet        dtAllTransaction = new DataSet();
         Package_BLogic oPackageData     = new Package_BLogic();
         dtAllTransaction            = oPackageData.GetAllTransaction();
         gvalltransaction.DataSource = dtAllTransaction;
         gvalltransaction.DataBind();
     }
     catch (Exception)
     {
     }
 }
    public static string CheckPackageExist(string res)
    {
        Package_BLogic package  = new Package_BLogic();
        bool           IsExists = package.CheckPackageAvailablity(res);

        if (IsExists)
        {
            return("True");
        }
        else
        {
            return("False");
        }
    }
Exemple #6
0
    public string checkpackagename(string packagename)
    {
        Package_BLogic package = new Package_BLogic();

        bool IsExists = package.CheckPackageAvailablity(packagename);

        if (IsExists)
        {
            return("True");
        }
        else
        {
            return("False");
        }
    }
Exemple #7
0
    //public bool CheckPasswordComplexcity()
    //{
    //    bool flag = false;
    //    BLogic_Student = new Student_DashBoard_BLogic();
    //    DataSet dsResult = new DataSet();
    //    dsResult = BLogic_Student.BAL_Select_PaymentPagesInfo("Password");

    //    string Complexcity = dsResult.Tables[0].Rows[0]["value"].ToString();

    //    if (txtPassword.Text.Length > 0)
    //    {
    //        if (System.Text.RegularExpressions.Regex.IsMatch(txtPassword.Text, Complexcity))
    //        {

    //            //WebMsg.Show("Valid Password");
    //            flag = true;
    //        }
    //        else
    //        {
    //            //WebMsg.Show("Invalid Password");
    //            flag = false;
    //        }
    //    }
    //    return flag;
    //}

    //public void InsertIntoStudentPackageDetails(int studentid)
    //{
    //    try
    //    {
    //        //Student = new Student();
    //        BAL_Student = new Student_BLogic();
    //        Package_BLogic Blogic_Package = new Package_BLogic();
    //        //Student.bmsid = Convert.ToInt32(ViewState["BMSID"]);
    //        int BMSID = Convert.ToInt32(ViewState["BMSID"]);
    //        DataSet dsPackageID = BAL_Student.BAL_Student_SelectPackageID(BMSID);

    //        if (dsPackageID != null && dsPackageID.Tables.Count > 0)
    //        {
    //            Package Opackage = new Package();

    //            Opackage.StudentID = studentid;
    //            Opackage.PackageFD_ID = Convert.ToInt64(dsPackageID.Tables[0].Rows[0]["PackageID"].ToString());
    //            int result = Blogic_Package.BAL_Student_TrialPackage_Insert(Opackage);
    //            if (result > 0)
    //            {
    //                string MailContent = DefaultEmailBody("yes");
    //                string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
    //                WebMsg.Show("Congratulation! You got free trial for 7 days");
    //            }
    //            else
    //            {
    //                string MailContent = DefaultEmailBody();
    //                string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
    //            }
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //    }
    //}

    public void InsertIntoStudentPackageDetails(int studentid)
    {
        try
        {
            //Student = new Student();
            BAL_Student = new Student_BLogic();
            Package_BLogic Blogic_Package = new Package_BLogic();
            //Student.bmsid = Convert.ToInt32(ViewState["BMSID"]);
            int     BMSID       = Convert.ToInt32(ViewState["BMSID"]);
            DataSet dsPackageID = BAL_Student.BAL_Student_SelectPackageID(BMSID);

            if (dsPackageID != null && dsPackageID.Tables.Count > 0)
            {
                if (dsPackageID.Tables[0].Rows.Count > 0)
                {
                    Session["dsTrailPAckage"] = dsPackageID.Tables[0];
                    Package Opackage = new Package();

                    Opackage.StudentID    = studentid;
                    Opackage.PackageFD_ID = Convert.ToInt64(dsPackageID.Tables[0].Rows[0]["PackageID"].ToString());
                    int result = Blogic_Package.BAL_Student_TrialPackage_Insert(Opackage);
                    if (result > 0)
                    {
                        string MailContent = DefaultEmailBody("yes");
                        string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
                        //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Your message.');window.open('AnotherPage.aspx','_self');", true);
                        //WebMsg.Show("Congratulation! You got free trial for 30 days");
                    }
                }
                else
                {
                    string MailContent = DefaultEmailBody();
                    string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemple #8
0
 protected void InsertIntoTransactionMaster()
 {
     try
     {
         DataTable      dt = (DataTable)Session["SelectedPackage"];
         Package_BLogic OPackage_Blogic = new Package_BLogic();
         Package        Opackage        = new Package();
         string         packageID       = string.Empty;
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             packageID += dt.Rows[i]["PackageID"].ToString() + ",";
         }
         Opackage.StudentID     = Convert.ToInt32(AppSessions.StudentID);
         Opackage.PackgeID      = packageID.Substring(0, packageID.Length - 1);
         Opackage.Price         = PackagePrice;
         Opackage.Status        = "In Progress";
         Opackage.TransactionID = TransactionID.ToString().Trim();
         OPackage_Blogic.InsertTransactionDetails(Opackage);
     }
     catch (Exception ex)
     {
     }
 }
    protected void Save(object sender, EventArgs e)
    {
        try
        {
            package = new Package_BLogic();
            Package Newpackage = new Package();
            Newpackage.PackageFD_ID       = Convert.ToInt64(ViewState["packageid"].ToString());
            Newpackage.PackageName        = txtpackagenameedit.Text;
            Newpackage.PackageDescription = txtpackagedecriptionedit.Text;
            Newpackage.NoOfMonth          = Convert.ToInt32(txtnoofmonthedit.Text);
            Newpackage.Price = Convert.ToDecimal(txtpriceedit.Text);

            DateTime expirydatetime;

            if (DateTime.TryParse(txtdateedit.Text, out expirydatetime))
            {
                Newpackage.EndDate = expirydatetime;
            }

            if (rbtrue.Checked)
            {
                Newpackage.IsActive = true;
            }
            else
            {
                Newpackage.IsActive = false;
            }

            New_Package_ID = package.UpdatePackageDetail(Newpackage);
            WebMsg.Show("Package Update Sucessfully");
            BindGrid();
            ClearFields();
        }
        catch (Exception ex)
        {
        }
    }
    protected void submit_Click(object sender, EventArgs e)
    {
        try
        {
            int subjectcount = 0;
            package = new Package_BLogic();
            Package Newpackage = new Package();

            string subjectid   = " ";
            string subjectname = " ";
            foreach (ListItem chk in clstSubject.Items)
            {
                if (chk.Selected == true)
                {
                    subjectid   += chk.Value.ToString() + ",";
                    subjectname += chk.Text.ToString() + ",";
                    subjectcount = subjectcount + 1;
                }
            }

            subjectid   = subjectid.Remove(subjectid.Length - 1);
            subjectname = subjectname.Remove(subjectname.Length - 1);

            Newpackage.PackageName        = txtPackageName.Text;
            Newpackage.PackageDescription = txtdescription.Text;
            Newpackage.BMSID     = Convert.ToInt32(ddlBoardMediumStandard.SelectedValue);
            Newpackage.SubjectID = subjectid;
            Newpackage.Subject   = subjectname;
            //Newpackage.ID = Convert.ToInt32(Session["New_Package_ID"].ToString());
            Newpackage.NoOfMonth = Convert.ToInt32(txtmonth.Text);
            Newpackage.Price     = Convert.ToDecimal(txtprice.Text);
            if (rbyes.Checked)
            {
                Newpackage.IsActive = true;
            }
            else
            {
                Newpackage.IsActive = false;
            }

            DateTime expirydatetime;

            if (DateTime.TryParse(txtdate.Text, out expirydatetime))
            {
                Newpackage.EndDate = expirydatetime;
            }

            if (subjectcount > 1)
            {
                Newpackage.PackageType = "Combo";
            }
            else
            {
                Newpackage.PackageType = "Single";
            }

            New_Package_ID = package.InsertPackageFeesDetail(Newpackage);
            WebMsg.Show("New Package insterted Sucessfully");
            BindGrid();
            ClearFields();
        }
        catch (Exception ex)
        {
            WebMsg.Show("New Package not insterted Sucessfully");
        }
        finally
        {
        }
    }
Exemple #11
0
    protected void submit_Click(object sender, EventArgs e)
    {
        try
        {
            package = new Package_BLogic();
            Package Newpackage = new Package();

            string subjectid   = " ";
            string subjectname = " ";
            foreach (ListItem chk in clstSubject.Items)
            {
                if (chk.Selected == true)
                {
                    subjectid   += chk.Value.ToString() + ",";
                    subjectname += chk.Text.ToString() + ",";
                }
            }

            subjectid   = subjectid.Remove(subjectid.Length - 1);
            subjectname = subjectname.Remove(subjectname.Length - 1);

            //foreach (ListItem chk in clstSubject.Items)
            //{
            //    if (chk.Selected == true)
            //    {
            Newpackage.PackageName        = txtPackageName.Text;
            Newpackage.PackageDescription = txtdescription.Text;
            Newpackage.BMSID     = Convert.ToInt32(ddlBoardMediumStandard.SelectedValue);
            Newpackage.SubjectID = subjectid;
            Newpackage.Subject   = subjectname;
            //Newpackage.ID = Convert.ToInt32(Session["New_Package_ID"].ToString());
            Newpackage.NoOfMonth = Convert.ToInt32(txtmonth.Text);
            Newpackage.Price     = Convert.ToDecimal(txtprice.Text);


            DateTime expirydatetime;

            if (DateTime.TryParse(txtdate.Text, out expirydatetime))
            {
                Newpackage.EndDate = expirydatetime;
            }

            //Newpackage.EndDate = Convert.ToDateTime(DateTime.Now);


            if (rbcombo.Checked)
            {
                Newpackage.PackageType = rbcombo.Text;
            }
            else
            {
                Newpackage.PackageType = rbsignle.Text;
            }

            New_Package_ID = package.InsertPackageFeesDetail(Newpackage);


            //    }
            //}

            WebMsg.Show("New Package insterted Sucessfully");
        }
        catch (Exception ex)
        {
            WebMsg.Show("New Package not insterted Sucessfully");
        }
        finally
        {
            // ddlpackage.SelectedIndex = 0;
            ddlBoardMediumStandard.SelectedIndex = 0;
            clstSubject.Items.Clear();
            txtprice.Text         = "";
            chkAllSubject.Checked = false;
        }
    }
Exemple #12
0
    protected void CCAvenueTransation()
    {
        try
        {
            DataSet dsSettings = new DataSet();
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("CCAvenue_Working_key");
            string CCAvenue_Working_key = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            string              Working_key = CCAvenue_Working_key;
            CCACrypto           ccaCrypto   = new CCACrypto();
            string              encResponse = ccaCrypto.Decrypt(Request.Form["encResp"], Working_key);
            NameValueCollection Params      = new NameValueCollection();
            string[]            segments    = encResponse.Split('&');
            foreach (string seg in segments)
            {
                string[] parts = seg.Split('=');
                if (parts.Length > 0)
                {
                    string Key   = parts[0].Trim();
                    string Value = parts[1].Trim();
                    Params.Add(Key, Value);
                }
            }

            string order_id         = Params["order_id"];
            string tracking_id      = Params["tracking_id"];
            string bank_ref_no      = Params["bank_ref_no"];
            string order_status     = Params["order_status"];
            string failure_message  = Params["failure_message"];
            string payment_mode     = Params["payment_mode"];
            string card_name        = Params["card_name"];
            string status_code      = Params["status_code"];
            string status_message   = Params["status_message"];
            string currency         = Params["currency"];
            string amount           = Params["amount"];
            string billing_name     = Params["billing_name"];
            string billing_address  = Params["billing_address"];
            string billing_city     = Params["billing_city"];
            string billing_state    = Params["billing_state"];
            string billing_zip      = Params["billing_zip"];
            string billing_country  = Params["billing_country"];
            string billing_tel      = Params["billing_tel"];
            string billing_email    = Params["billing_email"];
            string delivery_name    = Params["delivery_name"];
            string delivery_address = Params["delivery_address"];
            string delivery_city    = Params["delivery_city"];
            string delivery_state   = Params["delivery_state"];
            string delivery_zip     = Params["delivery_zip"];
            string delivery_country = Params["delivery_country"];
            string delivery_tel     = Params["delivery_tel"];
            string merchant_param1  = Params["merchant_param1"];
            string merchant_param2  = Params["merchant_param2"];
            string merchant_param3  = Params["merchant_param3"];
            string merchant_param4  = Params["merchant_param4"];
            string merchant_param5  = Params["merchant_param5"];
            string vault            = Params["vault"];
            string offer_type       = Params["offer_type"];
            string offer_code       = Params["offer_code"];
            string discount_value   = Params["discount_value"];
            string mer_amount       = Params["mer_amount"];
            string eci_value        = Params["eci_value"];
            string retry            = Params["retry"];
            string response_code    = Params["response_code"];
            PPackage = new Package();
            PPackage.TransactionID      = order_id;
            PPackage.PaymentGateway     = "CCAvenue";
            PPackage.PaymentMode        = payment_mode;
            PPackage.CardName           = card_name;
            PPackage.CCAvenueStatusCode = status_code;
            PPackage.Currency           = currency;
            PPackage.Country            = billing_country;
            PPackage.Vault          = vault;
            PPackage.OfferType      = offer_type;
            PPackage.OfferCode      = offer_code;
            PPackage.Discount       = Convert.ToDecimal(discount_value);
            PPackage.MerchantAmount = Convert.ToDecimal(mer_amount);
            PPackage.ECIValue       = eci_value;
            PPackage.Retry          = retry;
            PPackage.ResponseCode   = response_code;

            if (order_status.ToUpper().Trim() != "FAILURE" && order_status.ToUpper().Trim() != "ABORTED")
            {
                lblthankyou.Text          = " Thank You ";
                lblthankyou.ForeColor     = System.Drawing.Color.Black;
                lblmessage1.Text          = " Your Transaction is successfull Please note down your Transaction number for further use. ";
                lbltransactionnumber.Text = "Your Transaction Number is: " + order_id;
                order_id       = Session["TransactionID"].ToString();
                Blogic_Package = new Package_BLogic();
                PPackage       = new Package();
                DataTable dt = (DataTable)(Session["SelectedPackage"]);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    PPackage.PackageFD_ID          = Convert.ToInt64(dt.Rows[i]["PackageID"].ToString());
                    PPackage.StudentID             = AppSessions.StudentID;
                    PPackage.PackageActivationDate = Convert.ToDateTime(dt.Rows[i]["ActivateOn"].ToString());
                    PPackage.EndDate       = Convert.ToDateTime(dt.Rows[i]["ExpiryDate"].ToString());
                    PPackage.TransactionID = order_id.ToString();
                    Blogic_Package.BAL_Student_Package_Insert(PPackage);
                }

                PPackage = new Package();
                PPackage.TransactionID = order_id;
                PPackage.Status        = order_status;
                PPackage.InvoiceID     = GetInvoiceID();
                Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction is successfull", tracking_id, "CCAvenue", "", bank_ref_no, delivery_name, billing_email, billing_tel, billing_address, "", "", "");
                SendTransactionDetails(BuildEmailBody("Epathshala", delivery_name, billing_tel, billing_email, Convert.ToDecimal(amount), card_name, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), order_status.ToString(), order_id, tracking_id));
                Response.AddHeader("REFRESH", "10;URL=../Report/StudentPackageReport.aspx");
            }

            else if (order_status.ToUpper().Trim() == "ABORTED")
            {
                lblthankyou.ForeColor = System.Drawing.Color.Black;
                lblmessage1.Text      = " You have cancelled transaction.";

                Blogic_Package  = new Package_BLogic();
                PPackage.Status = order_status;
                Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction cancelled by user.", tracking_id, "CCAvenue", "", bank_ref_no, delivery_name, billing_email, billing_tel, billing_address, "", "", "");
                SendTransactionDetails(BuildEmailBody("Epathshala", AppSessions.UserName, Session["MobileNumber"].ToString(), AppSessions.LoginID, Convert.ToDecimal(amount), card_name, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), "Transaction cancelled by user.", order_id, tracking_id));
                RedirectPage();
                //Response.AddHeader("REFRESH", "10;URL=../Dashboard/StudentDashboard.aspx");
            }
            else
            {
                lblthankyou.Text       = " Sorry for inconvenience ";
                lblthankyou.ForeColor  = System.Drawing.Color.Red;
                lblmessage1.Text       = "Transaction is not successful please try again....";
                lblmessage1.ForeColor  = System.Drawing.Color.Red;
                Blogic_Package         = new Package_BLogic();
                PPackage.TransactionID = order_id;
                PPackage.Status        = order_status;

                //PPackage.InvoiceID = GetInvoiceID();
                Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction is not successful", tracking_id, "CCAvenue", "", bank_ref_no, delivery_name, billing_email, billing_tel, billing_address, "", "", "");
                SendTransactionDetails(BuildEmailBody("Epathshala", delivery_name, billing_tel, billing_email, Convert.ToDecimal(amount), card_name, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), "Fail", order_id, tracking_id));
                RedirectPage();
                //Response.AddHeader("REFRESH", "10;URL=SelectPackage.aspx");
            }
        }

        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", "alert(" + ex.Message.ToString() + ")", true);
        }
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                if (Session["country_name"] != null)
                {
                    if (Session["country_name"].ToString().ToLower() == "india")
                    {
                        string transactionid         = Session["TransactionID"].ToString();
                        NameValueCollection nvc      = Request.Form;
                        string mmp_Transaction       = nvc["mmp_txn"].ToString();
                        string PaymentStatus         = nvc["f_code"].ToString();
                        string MerchantTransactionId = Request.Form["mer_txn"];
                        string Amount            = Request.Form["amt"];
                        string Product           = Request.Form["prod"];
                        string TransactionDate   = Request.Form["date"];
                        string BankTransactionId = Request.Form["bank_txn"];
                        string ClientCode        = Request.Form["clientcode"]; // Encrypted User Information
                        string BankName          = Request.Form["bank_name"];

                        //User Details
                        string Udf1 = Request.Form["udf1"]; //First Name
                        string Udf2 = Request.Form["udf2"]; //Email
                        string Udf3 = Request.Form["udf3"]; //Mobile
                        string Udf4 = Request.Form["udf4"]; //Address
                        string Udf5 = Request.Form["udf5"]; //Bank Name
                        string Udf6 = Request.Form["udf6"]; //EMI Option

                        string strResponceIP = HttpContext.Current.Request.UserHostAddress;
                        //string strRemarks = "txnId:" + MerchantTransactionId + ", txnStatus:" + PaymentStatus + ", amount:" + Amount + ", pgTxnId:" + mmp_Transaction + ", BankTransactionId:" + BankTransactionId + ", Udf1:" + Udf1 + ", Udf2:" + Udf2 + ", Udf3:" + Udf3 + ", Udf4:" + Udf4 + ", Udf5:" + Udf5 + ", Udf6:" + Udf6;

                        DataSet dsSettings = new DataSet();
                        Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
                        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMPaymentIP");
                        string ATOMPaymentIP = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();
                        //Verify the Response Server
                        //if (Request.UrlReferrer.Host.Trim() != ATOMPaymentIP)
                        //{
                        //    lblthankyou.Text = " Sorry for inconvenience ";
                        //    lblthankyou.ForeColor = System.Drawing.Color.Red;

                        //    lblmessage1.Text = "Payment is not done sucessfully please try again....";
                        //    PPackage.TransactionID = transactionid;
                        //    PPackage.Status = "Fail";
                        //    Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Responce server is not verify", mmp_Transaction, Product, BankName, BankTransactionId, Udf1, Udf2, Udf3, Udf4, Udf5, Udf6, "");
                        //    Response.AddHeader("REFRESH", "10;URL=SelectPackage.aspx");
                        //}

                        // CHECK THE PAYMENT STATUS AND VALIDATE THE TRANSACTION ID

                        if (PaymentStatus.ToUpper().Trim() == "OK" && transactionid.Trim() == MerchantTransactionId.Trim())
                        {
                            lblthankyou.Text          = " Thank You ";
                            lblthankyou.ForeColor     = System.Drawing.Color.Black;
                            lblmessage1.Text          = " Your Transaction is successfull Please note down your Transaction number for further use. ";
                            lbltransactionnumber.Text = "Your Transaction Number is: " + transactionid;
                            transactionid             = Session["TransactionID"].ToString();
                            Blogic_Package            = new Package_BLogic();
                            PPackage = new Package();
                            DataTable dt = (DataTable)(Session["SelectedPackage"]);
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                PPackage.PackageFD_ID          = Convert.ToInt64(dt.Rows[i]["PackageID"].ToString());
                                PPackage.StudentID             = AppSessions.StudentID;
                                PPackage.PackageActivationDate = Convert.ToDateTime(dt.Rows[i]["ActivateOn"].ToString());
                                PPackage.EndDate       = Convert.ToDateTime(dt.Rows[i]["ExpiryDate"].ToString());
                                PPackage.TransactionID = transactionid.ToString();

                                Blogic_Package.BAL_Student_Package_Insert(PPackage);
                            }

                            PPackage = new Package();
                            PPackage.TransactionID = transactionid;
                            PPackage.Status        = "OK";
                            PPackage.InvoiceID     = GetInvoiceID();
                            PPackage.Currency      = "INR";
                            Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction Is Successfull", mmp_Transaction, Product, BankName, BankTransactionId, Udf1, Udf2, Udf3, Udf4, Udf5, Udf6, "");
                            SendTransactionDetails(BuildEmailBody("Epathshala", Udf1, Udf3, Udf2, Convert.ToDecimal(Amount), BankName, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), PaymentStatus, transactionid, mmp_Transaction));
                            Response.AddHeader("REFRESH", "10;URL=../Report/StudentPackageReport.aspx");
                        }

                        else if (PaymentStatus.ToUpper().Trim() == "C")
                        {
                            lblthankyou.ForeColor = System.Drawing.Color.Black;
                            lblmessage1.Text      = " You have cancelled transaction.";
                            PPackage               = new Package();
                            Blogic_Package         = new Package_BLogic();
                            PPackage.TransactionID = transactionid;
                            PPackage.Status        = "Cancel";
                            PPackage.Currency      = "INR";
                            Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction cancelled by user.", mmp_Transaction, Product, BankName, BankTransactionId, Udf1, Udf2, Udf3, Udf4, Udf5, Udf6, "");
                            SendTransactionDetails(BuildEmailBody("Epathshala", AppSessions.UserName, Session["MobileNumber"].ToString(), AppSessions.LoginID, Convert.ToDecimal(Amount), BankName, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), "Transaction cancelled by user.", transactionid, mmp_Transaction));
                            RedirectPage();
                            //Response.AddHeader("REFRESH", "10;URL=../Dashboard/StudentDashboard.aspx");
                        }
                        else
                        {
                            //lblmessage.Text = "PAYMENT STATUS IS NOT SUCCESS OR TRANSACTION ID IS NOT VERIFIED";
                            lblthankyou.Text      = " Sorry for inconvenience ";
                            lblthankyou.ForeColor = System.Drawing.Color.Red;
                            //lblmessage.ForeColor = System.Drawing.Color.Red;
                            lblmessage1.Text      = "Transaction not successful please try again....";
                            lblmessage1.ForeColor = System.Drawing.Color.Red;
                            PPackage               = new Package();
                            Blogic_Package         = new Package_BLogic();
                            PPackage.TransactionID = transactionid;
                            PPackage.Status        = "Fail";
                            PPackage.Currency      = "INR";
                            //PPackage.InvoiceID = GetInvoiceID();
                            Blogic_Package.BAL_Student_Package_Update_TransactionMaster(PPackage, "Transaction not successful or transaction ID not varified", mmp_Transaction, Product, BankName, BankTransactionId, Udf1, Udf2, Udf3, Udf4, Udf5, Udf6, "");
                            SendTransactionDetails(BuildEmailBody("Epathshala", Udf1, Udf3, Udf2, Convert.ToDecimal(Amount), BankName, DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"), "Fail", transactionid, mmp_Transaction));
                            RedirectPage();
                            //Response.AddHeader("REFRESH", "10;URL=SelectPackage.aspx");
                        }
                    }
                    else
                    {
                        CCAvenueTransation();
                    }
                }
                else
                {
                    Response.Redirect("StudentDashboard.aspx");
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected string GetTransactionID(string ProductID)
    {
        string NewTransactionID = string.Empty;

        //string CCavenueTransactionID = string.Empty;
        try
        {
            Package_BLogic OPackageBlogic  = new Package_BLogic();
            DataSet        dsTransactionID = new DataSet();

            dsTransactionID = OPackageBlogic.BAL_Select_TransactionID(ProductID);
            if (dsTransactionID != null)
            {
                if (dsTransactionID.Tables[0].Rows.Count > 0)
                {
                    if (ProductID.ToString().ToLower() == "ccavenue")
                    {
                        NewTransactionID = dsTransactionID.Tables[0].Rows[0]["TXNNO"].ToString();
                        if (NewTransactionID != string.Empty)
                        {
                            int NewTransactionNumber = Convert.ToInt32(NewTransactionID.Substring(6));
                            NewTransactionNumber = NewTransactionNumber + 1;

                            if (DateTime.Now.ToString("dd") == NewTransactionID.Substring(4, 2).ToString())
                            {
                                NewTransactionID = DateTime.Now.ToString("yy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + NewTransactionNumber.ToString().PadLeft(5, '0');
                            }
                            else
                            {
                                NewTransactionID = DateTime.Now.ToString("yy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + "00001";
                            }
                        }
                        else
                        {
                            NewTransactionID = DateTime.Now.ToString("yy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + "00001";
                        }
                    }
                    else
                    {
                        string strTransactionID = dsTransactionID.Tables[0].Rows[0]["TXNNO"].ToString();

                        if (strTransactionID.ToString().Trim() == string.Empty)
                        {
                            NewTransactionID = "TXN1";
                        }
                        else
                        {
                            int TransactionCount = Convert.ToInt32(strTransactionID);
                            TransactionCount = TransactionCount + 1;
                            NewTransactionID = "TXN" + TransactionCount.ToString().Trim();
                        }
                    }
                }
                else
                {
                    if (ProductID.ToString().ToLower() == "ccavenue")
                    {
                        NewTransactionID = DateTime.Now.ToString("yy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + "000001";
                    }
                    else
                    {
                        NewTransactionID = "TXN1";
                    }
                }
            }
            return(NewTransactionID);
        }
        catch (Exception ex)
        {
            return("");
        }
    }