Exemple #1
0
        protected void viewSupplier_btn_Click(object sender, EventArgs e)
        {
            DataClassDataContext db = new DataClassDataContext();

            supplierTable.DataSource = from SUPPLIER in db.SUPPLIERs
                                       select SUPPLIER;

            supplierTable.DataBind();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 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();
         }
     }
 }
Exemple #4
0
        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>");
                }
            }
        }