private void Btndelete_Click(object sender, EventArgs e) { detailorder detailOrder = new detailorder(); detailOrder = db.detailorders.Single(id => id.detailid == detailId); db.detailorders.DeleteOnSubmit(detailOrder); db.SubmitChanges(); loadTable(); txtqty.Enabled = true; }
private void BtnAdd_Click(object sender, EventArgs e) { detailorder detailOrder = new detailorder(); detailOrder.orderid = orderId; detailOrder.menuid = Convert.ToInt32(menuId); detailOrder.price = calc(Convert.ToInt32(txtqty.Value)); detailOrder.qty = Convert.ToInt32(txtqty.Value); detailOrder.status = "ordered"; db.detailorders.InsertOnSubmit(detailOrder); db.SubmitChanges(); loadTable(); btnOrder.Enabled = true; btndelete.Enabled = true; }
private void combo_SelectedIndexChanged(object sender, EventArgs e) { string oldProgress = combo.Text; DialogResult comboRes = MessageBox.Show("Simpan Prosses", "yakin?", MessageBoxButtons.YesNo); if (comboRes == DialogResult.Yes) { detailorder detailOrder = new detailorder(); detailOrder = db.detailorders.Single(id => id.detailid == detaiID); detailOrder.status = combo.Text; db.SubmitChanges(); progress = combo.Text; } else { combo.Text = progress; } }
partial void Deletedetailorder(detailorder instance);
partial void Updatedetailorder(detailorder instance);
partial void Insertdetailorder(detailorder instance);