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 Button1_Click(object sender, EventArgs e) { nsdoc.clsdoc obj = new nsdoc.clsdoc(); nsdoc.clsdocprp objprp = new nsdoc.clsdocprp(); objprp.doctit = TextBox1.Text; objprp.docdsc = TextBox2.Text; objprp.doclstcod = Convert.ToInt32(DropDownList1.SelectedValue); objprp.docupldat = DateTime.Now; if (RadioButtonList1.SelectedIndex == 0) { objprp.docforsalsts = 'T'; objprp.docprc = Convert.ToSingle(TextBox3.Text); } else { objprp.docforsalsts = 'F'; objprp.docprc = 0; } String s = FileUpload1.PostedFile.FileName; if (s != "") { s = s.Substring(s.LastIndexOf('.')); } objprp.docfil = s; Int32 a = obj.Save_Rec(objprp); if (s != "") { FileUpload1.PostedFile.SaveAs(Server.MapPath("../docfil") + "//" + a.ToString() + s); } Response.Redirect("frmmydoc.aspx"); }
protected void DataList1_EditCommand(object source, DataListCommandEventArgs e) { nsdoc.clsdoc obj = new nsdoc.clsdoc(); GridView1.DataSource = obj.dspmydoc(Convert.ToInt32(Session["cod"]), Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex])); GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { nsdoc.clsdoc obj = new nsdoc.clsdoc(); GridView1.DataSource = obj.dspmydoc(Convert.ToInt32(Session["cod"]), 0); GridView1.DataBind(); } }
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; } } }