protected void btnCheckApproval_Click(object sender, EventArgs e)
    {
        lblSummMessage.Text = string.Empty;
        ifmAuth.Style.Add("display", "none");
        ClsTCUtilsUploadHash clsTCUtil = new ClsTCUtilsUploadHash();

        encrypt = new ClsEncryption();
        //clsGstr1 = new ClsGSTR1();
        string      doc_category = "OTHER";
        string      DownCs       = clsTCUtil.GetDownloadCS(ClsCommon.eSignAPIKEY, ClsCommon.uuid);
        var         response     = clsTCUtil.GetSignedStatus(ClsCommon.eSignDomain, doc_category, DownCs);
        XmlDocument xDoc         = new XmlDocument();
        string      status       = string.Empty;

        xDoc.LoadXml(response.ToString());
        var node = xDoc.SelectSingleNode("docstatus");

        if (node.ChildNodes.Count > 0)
        {
            foreach (XmlNode n in node.ChildNodes)
            {
                status = n.FirstChild.Value;
                break;
            }
        }
        if (status != "")
        {
            lblSummMessage.Text = "Data Successfully Signed.";
        }
    }
    protected void btnDSC_Click(object sender, EventArgs e)
    {
        lblSummMessage.Text = string.Empty;
        ifmAuth.Style.Add("display", "none");
        ClsTCUtilsUploadHash clsTCUtil = new ClsTCUtilsUploadHash();

        encrypt = new ClsEncryption();
        //clsGstr1 = new ClsGSTR1();

        string status = string.Empty;
        string msg    = string.Empty;
        string did    = string.Empty;

        string doc_category = "OTHER";
        string Email        = "*****@*****.**"; //"*****@*****.**";
        string SendMail     = "YES";

        if (ClsCommon.did != null)
        {
            var         response = clsTCUtil.MarkForSignCorpfileDSC(ClsCommon.uuid, ClsCommon.cheksum, doc_category, Email, SendMail);
            XmlDocument xDoc     = new XmlDocument();
            xDoc.LoadXml(response.ToString());
            var node = xDoc.SelectSingleNode("response");
            if (node.ChildNodes.Count > 0)
            {
                foreach (XmlNode n in node.ChildNodes)
                {
                    status = n.FirstChild.Value;
                    break;
                }
            }
            if (status == "0")
            {
                DSC = true;
                //string url = ClsCommon.URLForDownProduction + ClsCommon.DownDSCUpdater;
                ////string url = "https://files.truecopy.in/esign/deploy/DSCUpdaterQA.zip";
                //Response.Write("<script>window.open('" + url + "','_blank');</script>");
                lblSummMessage.Text    = "Data Mark Successfully For Dsc Signing.";
                divsuccessmsg.CssClass = "alert alert-success";
                divsuccessmsg.Visible  = true;
                divsuccessmsg.CssClass = "alert alert-success";
            }
        }
    }
    public void UploadForSigning()
    {
        lblSummMessage.Text = string.Empty;
        ClsTCUtilsUploadHash clsTCUtil = new ClsTCUtilsUploadHash();

        encrypt = new ClsEncryption();
        //clsGstr1 = new ClsGSTR1();

        byte[] encodeJson    = UTF8Encoding.UTF8.GetBytes(txtSummary.Text.Trim());
        string base64Payload = Convert.ToBase64String(encodeJson);

        var sha256_hash = clsTCUtil.sha256_hash(base64Payload);

        string email = "*****@*****.**";

        ClsCommon.uuid = "OSWA" + "180717" + ClsCommon.SBGSTINNO.Substring(0, 6) + ClsCommon.generateRandomNumber(16);

        var         json4  = clsTCUtil.uploadHash(ClsCommon.uuid, email, sha256_hash.ToString());
        XmlDocument xDoc   = new XmlDocument();
        string      status = string.Empty;

        xDoc.LoadXml(json4.ToString());
        var node = xDoc.SelectSingleNode("response");

        if (node.ChildNodes.Count > 0)
        {
            foreach (XmlNode n in node.ChildNodes)
            {
                status = n.FirstChild.Value;
                break;
            }
        }
        if (status == "0")
        {
            ClsCommon.did          = ClsCommon.uuid;
            lblSummMessage.Text    = "Summary Successfully Generated.";
            divsuccessmsg.Visible  = true;
            divsuccessmsg.CssClass = "alert alert-success";
        }
    }
    protected void btnDownloadSign_Click(object sender, EventArgs e)
    {
        lblSummMessage.Text = string.Empty;
        ClsTCUtilsUploadHash clsTCUtil = new ClsTCUtilsUploadHash();

        encrypt = new ClsEncryption();
//        clsGstr1 = new ClsGSTR1();

        string DownCs = clsTCUtil.GetDownloadCS(ClsCommon.eSignAPIKEY, ClsCommon.uuid);

        if (ClsCommon.uuid != null && ClsCommon.uuid != string.Empty)
        {
            var     response = clsTCUtil.GetDownloadSignedData(ClsCommon.eSignDomain, DownCs);
            JObject jobj     = JObject.Parse(response.ToString());
            if (jobj.GetValue("status") != null && jobj.GetValue("status").ToString() == "0")
            {
                ClsCommon.AadhaarNo    = jobj.GetValue("aadhaarno") == null ? "" : jobj.GetValue("aadhaarno").ToString();
                ClsCommon.SignedData   = jobj.GetValue("PKCS7").ToString();
                divsuccessmsg.Visible  = true;
                divsuccessmsg.CssClass = "alert alert-success";
                lblSummMessage.Text    = "Successfully download signed data.";
                txtSummary.Text        = ClsCommon.SignedData;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$(document).ready(function(){$('#viewsubmit').modal('show');});", true);
            }
            else
            {
                divsuccessmsg.Visible  = true;
                divsuccessmsg.CssClass = "alert alert-danger";
                lblSummMessage.Text    = "Error in downloading signed data.";
            }
        }
        else
        {
            divsuccessmsg.Visible  = true;
            divsuccessmsg.CssClass = "alert alert-danger";
            lblSummMessage.Text    = "Error: uuid is null or blank.";
        }
    }