Exemple #1
0
        public static List<LocalSupplier> GetCompleteSupplierList()
        {
            string RMDBLocation = Properties.Settings.Default.RMDBLocation;

               List<LocalSupplier> suppliers = new List<LocalSupplier>();

               try
               {
                    OleDbConnection RMDBconnection = null;
                    OleDbDataReader dbReader = null;

                    RMDBconnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; Password=; Data Source=" + RMDBLocation);
                    RMDBconnection.Open();

                    OleDbCommand SyncCmd = RMDBconnection.CreateCommand();
                    //Get customers.
                    string commandText = "SELECT supplier_id, supplier from Supplier";

                    SyncCmd.CommandText = commandText;

                    dbReader = SyncCmd.ExecuteReader();

                    if (dbReader.HasRows)
                    {
                         while (dbReader.Read())
                         {
                              LocalSupplier newSupplier = new LocalSupplier();
                              newSupplier.supplier_code = dbReader.GetValue(0).ToString();
                              newSupplier.name = dbReader.GetString(1);

                              suppliers.Add(newSupplier);
                         }
                    }

                    dbReader.Close();
                    RMDBconnection.Close();
               }
               catch (Exception ex)
               {
                    throw;
               }
               return suppliers;
        }
Exemple #2
0
 /// <remarks/>
 public void UpdateSuppliersAsync(int storeID, string password, LocalSupplier[] suppliers) {
     this.UpdateSuppliersAsync(storeID, password, suppliers, null);
 }
Exemple #3
0
 /// <remarks/>
 public void UpdateSuppliersAsync(int storeID, string password, LocalSupplier[] suppliers, object userState) {
     if ((this.UpdateSuppliersOperationCompleted == null)) {
         this.UpdateSuppliersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSuppliersOperationCompleted);
     }
     this.InvokeAsync("UpdateSuppliers", new object[] {
                 storeID,
                 password,
                 suppliers}, this.UpdateSuppliersOperationCompleted, userState);
 }
Exemple #4
0
 public ItemResponse UpdateSuppliers(int storeID, string password, LocalSupplier[] suppliers) {
     object[] results = this.Invoke("UpdateSuppliers", new object[] {
                 storeID,
                 password,
                 suppliers});
     return ((ItemResponse)(results[0]));
 }