private void btnUpdateSupplier_Click(object sender, EventArgs e) { Supplier updateSupplier = new Supplier(); updateSupplier.ID = Convert.ToInt32(txtSupId.Text); updateSupplier.SupplierName = txtSupName.Text; updateSupplier.Address = rtxtSupAddress.Text; updateSupplier.Tel = txtSupTelephoneNo.Text; updateSupplier.AccountNo = txtSupAccNo.Text; if (supMgr.Update(updateSupplier) == true) { MessageBox.Show(this, "Supplier Updated Sucessfully", "Suceed", MessageBoxButtons.OK, MessageBoxIcon.Information); clearScreen("update"); } }
private void btnAddSupplier_Click(object sender, EventArgs e) { // new supplier details from user inputs // need validation for user inputs Supplier supplier = new Supplier(); supplier.SupplierName = txtSupplierName.Text; supplier.Address = rtxtSupplierAddress.Text; supplier.Tel = txtSupplierTelephoneNo.Text; supplier.AccountNo = txtSupplierTelephoneNo.Text; // supplier email is not captured form user // check values added sucessfully - no exception handling in back end code if (supMgr.AddNew(supplier) == 1) { MessageBox.Show(this, "New Supplier Added Sucessfully", "Suceed", MessageBoxButtons.OK, MessageBoxIcon.Information); clearScreen("new"); } }
/// <summary> /// Deprecated Method for adding a new object to the Suppliers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSuppliers(Supplier supplier) { base.AddObject("Suppliers", supplier); }
/// <summary> /// Create a new Supplier object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="supplierName">Initial value of the SupplierName property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="tel">Initial value of the Tel property.</param> public static Supplier CreateSupplier(global::System.Int32 id, global::System.String supplierName, global::System.String address, global::System.String tel) { Supplier supplier = new Supplier(); supplier.ID = id; supplier.SupplierName = supplierName; supplier.Address = address; supplier.Tel = tel; return supplier; }