public static bool DeleteDistributerBL(string deleteDistributerID) { bool distributerDeleted = false; try { Regex regex = new Regex("^[D][0-9][0-9][0-9]$"); bool b = regex.IsMatch(deleteDistributerID); if (b != true) { DistributerDAL distributerDAL = new DistributerDAL(); distributerDeleted = distributerDAL.DeleteDistributerDAL(deleteDistributerID); } else { throw new InventoryException("Invalid Distributer ID"); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(distributerDeleted); }
public static Distributer SearchDistributerBL(string searchDistributerID) { Distributer searchDistributer = null; try { DistributerDAL distributerDAL = new DistributerDAL(); searchDistributer = distributerDAL.SearchDistributerDAL(searchDistributerID); } catch (InventoryException ex) { throw ex; } catch (Exception ex) { throw ex; } return(searchDistributer); }
public static List <Distributer> GetAllDistributersBL() { List <Distributer> distributerList = null; try { DistributerDAL distributerDAL = new DistributerDAL(); distributerList = distributerDAL.GetAllDistributersDAL(); } catch (InventoryException ex) { throw ex; } catch (Exception ex) { throw ex; } return(distributerList); }
public static bool AddDistributerBL(Distributer newDistributer) { bool distributerAdded = false; try { if (ValidateDistributer(newDistributer)) { DistributerDAL distributerDAL = new DistributerDAL(); distributerAdded = distributerDAL.AddDistributerDAL(newDistributer); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(distributerAdded); }
public static bool UpdateDistributerBL(Distributer updateGuest) { bool distributerUpdated = false; try { if (ValidateDistributer(updateGuest)) { DistributerDAL guestDAL = new DistributerDAL(); distributerUpdated = guestDAL.UpdateDistributerDAL(updateGuest); } } catch (InventoryException) { throw; } catch (Exception ex) { throw ex; } return(distributerUpdated); }