Exemplo n.º 1
0
 /// <summary>
 /// Removes a ware. Returns true if the item was found and removed else false
 /// </summary>
 /// <param name="ID">The ID of the ware to remove</param>
 /// <returns>Returns true if the item was found and removed else false</returns>
 public static bool RemoveWare(string ID)
 {
     if (Support.Confirmation())
     {
         if (!SQLCode.SQLControl.DatabaseInUse)
         {
             return(WareInformation.RemoveWare(ID));
         }
         try {
             SQLCode.StoredProcedures.RunDeleteWareSP($"'{ID}'");
         }
         catch (Exception e)
         {
             Support.ErrorHandling(e, $"Failed at removing ware: {e.Message}");
             return(false);
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Used for unit testing
 /// </summary>
 /// <param name="ID"></param>
 public static void RemoveWareTesting(string ID)
 {
     WareInformation.RemoveWare(ID);
 }