Exemple #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string vid = "";
        string hid = "";
        string hk  = "";

        FileInfo ff  = new FileInfo(imgname2 + ".png");
        string   fn2 = ff.DirectoryName + "_" + ff.Name;

        if (ct == "Pan Card")
        {
            dob = dttm.Day + "/" + dttm.Month + "/" + dttm.Year;
            vid = _Programs.GetCardVHID(10);
            Thread.Sleep(3000);
            hid = _Programs.GetCardVHID(10);

            //imgname2 = imgname2 + vid;
            CardTemp.createPan(name, fname, dob, vid, imgname, imgname2 + ".png");

            //Thread.Sleep(1000);
            //CryptUtility.HideHID(imgname2 + ".png", fn2, hid);
            //try
            //{
            //    if (File.Exists(imgname2 + ".png"))
            //        File.Delete(imgname2 + ".png");
            //}
            //catch (Exception ee) { }
        }
        else if (ct == "Id Card")
        {
            string[] month = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
            dob = dttm.Day + "th " + month[dttm.Month].ToUpper() + ", " + dttm.Year;
            vid = _Programs.GetCardVHID(4);
            Thread.Sleep(3000);
            hid = _Programs.GetCardVHID(4);
            CardTemp.createID(name, vid, dob, imgname, imgname2 + ".png");
        }
        else if (ct == "Passport")
        {
            string[] month = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
            dob = dttm.Day + " " + month[dttm.Month].ToUpper() + ", " + dttm.Year;
            vid = _Programs.GetPPNo(9);
            Thread.Sleep(3000);
            hid = _Programs.GetPPNo(9);
            DateTime dt1 = DateTime.Now;
            string   doi = dt1.Day + " " + month[dt1.Month].ToUpper() + ", " + dt1.Year;
            string   doe = dt1.Day + " " + month[dt1.Month].ToUpper() + ", " + (dt1.Year + 10);
            CardTemp.createPassport(lname, fname2, "indian", gender[0].ToString(), dob, doi, doe, city, vid, imgname, imgname2 + ".png");
        }

        Thread.Sleep(1000);
        byte[] bb = ImageMsg.createImageMsg(fname2, lname, gender, dob, vid, hid, un2);
        MyFile.UpdateFile(imgname2 + ".png", bb);
        Thread.Sleep(1000);
        hk = MyFile.GetHashKey(imgname2 + ".png");
        Thread.Sleep(1000);

        string ccdt = DateTime.Now.ToShortDateString();
        string qry  = "update userappinfo set appstatus='Done', ccdt=datevalue('" + ccdt + "') where appid='" + appid + "'";
        int    i    = _Database.NonSelectQuery(qry);

        if (i == 1)
        {
            qry = "insert into cardlist values('" + appid + "','" + un2 + "','" + ct + "','" + vid + "','" + hid + "','" + hk + "')";
            _Database.NonSelectQuery(qry);
            Response.Write("<script language='javascript'> alert('The Card has been generated successfully'); document.location='" + ResolveClientUrl("~/CardList.aspx") + "';</script>");
            // smsg.Text = "<b>The Card has been generated successfully</b>";
            //Response.Redirect("VerifiedList.aspx");
        }
        else
        {
            smsg.Text = "<b>Error: </b>" + _Database.LastError;
        }
    }