static SalesNew() { dsAddSale = new EmmasDataSet(); receiptTableAdapter daReceipt = new receiptTableAdapter(); orderLineTableAdapter daOrderLine = new orderLineTableAdapter(); salesInvenTableAdapter daInventory = new salesInvenTableAdapter(); try { daReceipt.Fill(dsAddSale.receipt); daOrderLine.Fill(dsAddSale.orderLine); daInventory.Fill(dsAddSale.salesInven); } catch { } }
static salesUpdate() { //load data at the beginning of the session dsEmma = new EmmasDataSet(); receiptTableAdapter daReceipt = new receiptTableAdapter(); orderLineTableAdapter daOrderLine = new orderLineTableAdapter(); orderProductTableAdapter daInventory = new orderProductTableAdapter(); try { daReceipt.Fill(dsEmma.receipt); daOrderLine.Fill(dsEmma.orderLine); daInventory.Fill(dsEmma.orderProduct); } catch { } }
private void Save() { receiptTableAdapter daReceipt = new receiptTableAdapter(); orderLineTableAdapter daOrderLine = new orderLineTableAdapter(); try { daReceipt.Update(dsEmma.receipt); daOrderLine.Update(dsEmma.orderLine); dsEmma.AcceptChanges(); this.lblSave.Text = "Sale has been updated successfully."; } catch { dsEmma.RejectChanges(); this.lblSave.Text = "Unable to add sale - All changes have been rejected."; } }
private void Save() { receiptTableAdapter daReceipt = new receiptTableAdapter(); orderLineTableAdapter daOrderLine = new orderLineTableAdapter(); try { daReceipt.Update(dsAddSale.receipt); daOrderLine.Update(dsAddSale.orderLine); dsAddSale.AcceptChanges(); this.lblSave.Text = "Sale has been added successfully."; ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Sale has been added successfully." + "');", true); } catch { dsAddSale.RejectChanges(); this.lblSave.Text = "Unable to add sale - All changes have been rejected."; ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Unable to add sale - All changes have been rejected." + "');", true); } }