protected void Page_Load(object sender, EventArgs e) { if (Session["amt"] != null) { nsdoc.clspur obj = new nsdoc.clspur(); nsdoc.clspurprp objprp = new nsdoc.clspurprp(); objprp.purdat = DateTime.Now; objprp.purusrcod = Convert.ToInt32(Session["cod"]); objprp.purdoccod = Convert.ToInt32(Session["dcod"]); obj.Save_Rec(objprp); String eml = User.Identity.Name; MailMessage mm = new MailMessage("*****@*****.**", eml, "Purchase Document", "Please find attached copy of your purchased document."); String fn = Server.MapPath("../docfil"); nsdoc.clsdoc obj1 = new nsdoc.clsdoc(); List <nsdoc.clsdocprp> k = obj1.find_rec (Convert.ToInt32(Session["dcod"])); fn += "//" + k[0].doccod + k[0].docfil; Attachment at = new Attachment(fn); mm.Attachments.Add(at); SmtpClient c = new SmtpClient("mail.connectzone.in", 25); c.Send(mm); Label1.Text = "Document has been sent on your registered email."; Session["dcod"] = null; Session["amt"] = null; } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Request.QueryString["dcod"] != null) { nsdoc.clsdoc obj = new nsdoc.clsdoc(); List <nsdoc.clsdocprp> k = obj.find_rec( Convert.ToInt32(Request.QueryString["dcod"])); Label1.Text = k[0].doctit; } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { nsdoc.clsdoc obj = new nsdoc.clsdoc(); List <nsdoc.clsdocprp> k = obj.find_rec(Convert.ToInt32(Request.QueryString["dcod"])); Label1.Text = k[0].doctit; Label2.Text = k[0].docupldat.ToShortDateString(); //Label3.Text = "share data"; Label4.Text = k[0].docdsc; if (k[0].docforsalsts == 'T') { Label5.Text = "Document on sale for Rs." + k[0].docprc.ToString(); } String path = "../docfil" + "//" + k[0].doccod.ToString() + k[0].docfil; Session["path"] = path; nsdoc.clslst obj1 = new nsdoc.clslst(); List <nsdoc.clslstprp> k1 = obj1.find_rec(k[0].doclstcod); if (k1[0].lstusrcod != Convert.ToInt32(Session["cod"])) { LinkButton1.Visible = false; } } }