Exemple #1
0
 public void ViewStoreStock(string storename)
 {
     try
     {
         _storeName = storename;
         MarketLog.Log("StoreCenter", "checking store stack");
         _shopper.ValidateCanBrowseMarket();
         MarketLog.Log("StoreCenter", "check if store exists");
         CheckIfStoreExists(storename);
         Store store = storeLogic.GetStorebyName(storename);
         LinkedList <string> result = new LinkedList <string>();
         var    IDS = storeLogic.GetAllStoreProductsID(store.SystemId);
         string info;
         foreach (string item in IDS)
         {
             info = GetProductStockInformation(item, false);
             if (info != "")
             {
                 result.AddLast(info);
             }
         }
         string[] resultArray = new string[result.Count];
         result.CopyTo(resultArray, 0);
         answer = new StoreAnswer(StoreEnum.Success, "", resultArray);
     }
     catch (StoreException e)
     {
         answer = new StoreAnswer((StoreEnum)e.Status, e.GetErrorMessage());
     }
     catch (DataException e)
     {
         answer = new StoreAnswer((StoreEnum)e.Status, e.GetErrorMessage());
     }
     catch (MarketException)
     {
         MarketLog.Log("StoreCenter", "no premission");
         answer = new StoreAnswer(StoreEnum.NoPermission,
                                  "User validation as valid customer has been failed . only valid users can browse market. Error message has been created!");
     }
 }