コード例 #1
0
        /// <summary>
        /// Add vendor to the database
        /// </summary>
        public void AddVendorToDB()
        {
            // Create a vendor object
            Models.Vendors vendorToBeAdded = new Models.Vendors();

            // Fill vendor object
            vendorToBeAdded.VendorName = txtName.Text;

            // Write the data to the DB
            Connections.DataConnections.DataConnectionClass.VendorConn.AddVendor(vendorToBeAdded);
            Connections.DataConnections.DataConnectionClass.DataLists.Vendors.Add(Connections.DataConnections.DataConnectionClass.VendorConn.GetVendor(vendorToBeAdded.VendorId));
        }
コード例 #2
0
 public AddVendor(string message, object vendorToBeEdited)
 {
     InitializeComponent();
     this.message          = message;
     this.vendorToBeEdited = (Models.Vendors)vendorToBeEdited;
 }