Esempio n. 1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     MedicineDB db = new MedicineDB();
     Framework.Database.Medicine med = new Framework.Database.Medicine();
     med.Id = id;
     med.Name = txtName.Text;
     med.Price = Convert.ToDouble(txtPrice.Text);
     med.Stock = Convert.ToInt32(txtStock.Text);
     med.Description = txtDescription.Text;
     med.CategoryId = Convert.ToInt32(ddl_category.SelectedValue);
     db.UpdateMedicine(med);
     Response.Redirect("AddMedicine.aspx");
 }
Esempio n. 2
0
 // delete medicine record
 protected void GridViewResult_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     MedicineDB db = new MedicineDB();
     int id = Convert.ToInt32(gridView.Rows[e.RowIndex].Cells[1].Text);
     db.DeleteMedById(id);
     Response.Redirect("AddMedicine.aspx");
 }