Beispiel #1
0
        public StoreDS GetStoreDetail(int companyID, string subStore)
        {
            //Get a list of store locations
            StoreDS stores = null;

            try {
                stores = new StoreDS();
                DataSet ds = fillDataset(USP_STORE, TBL_STORE, new object[] { companyID, null, subStore });
                if (ds.Tables[TBL_STORE].Rows.Count > 0)
                {
                    stores.Merge(ds);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading store locations.", ex); }
            return(stores);
        }
Beispiel #2
0
        public static Store GetStore(string clientNumber, string storeNumber)
        {
            //Create a store
            StoreDS store = null;

            try {
                store = new StoreDS();
                DataSet ds = App.Mediator.FillDataset(USP_STORE_DETAIL, TBL_STORE_DETAIL, new object[] { storeNumber, clientNumber });
                if (ds.Tables[TBL_STORE_DETAIL].Rows.Count == 0)
                {
                    throw new Exception("Store number " + storeNumber + " for client number " + clientNumber + " not found.");
                }
                else
                {
                    store.Merge(ds);
                }
            }
            catch (Exception ex) { throw ex; }
            return(new Store(store.StoreDetailTable[0]));
        }