protected void viewSupplier_btn_Click(object sender, EventArgs e) { DataClassDataContext db = new DataClassDataContext(); supplierTable.DataSource = from SUPPLIER in db.SUPPLIERs select SUPPLIER; supplierTable.DataBind(); }
protected void loadShipment_btn_Click(object sender, EventArgs e) { DataClassDataContext db = new DataClassDataContext(); Shipement_Table.DataSource = from SHIPMENT in db.SHIPMENTs where SHIPMENT.Pno == snoSelect_dropDown.SelectedValue select SHIPMENT.Sno; Shipement_Table.DataBind(); }
protected void Updatebtn_Click(object sender, EventArgs e) { using (DataClassDataContext db = new DataClassDataContext()) { foreach (SUPPLIER x in db.SUPPLIERs) { x.Status = x.Status * 1.1; db.SubmitChanges(); } } }
protected void Insert2_btn_Click(object sender, EventArgs e) { using (DataClassDataContext db = new DataClassDataContext()) { SHIPMENT newShipment = new SHIPMENT { Sno = "s4", Pno = "p2", Qty = 100, Price = .005 }; try { db.SHIPMENTs.InsertOnSubmit(newShipment); db.SubmitChanges(); Response.Write("<script>alert('Success') </script>"); } catch { Response.Write("<script>alert('Fail') </script>"); } } }