/// <summary> /// Method to add retailstore details to the list /// </summary> /// <param name="retailstoreDetails">represents the details of retailstore eg</param> public static void AddRetailStore(Retailstore retailstoreDetails) { //condtion for checking wheather the retailstore id exists or not if (retailstoreDetails.RetailCustomerID != null) { _retailStoreList.Add(retailstoreDetails); // SaveIntoFile(); } else { throw new RetailstoreException("Already exists"); } }
/// <summary> /// method to Update the customername /// </summary> /// <param name="retailstore">represents retailstore object</param> public void UpdateRetailstoreByRetailCustomerID(Retailstore retailstore) { try { if (retailstore.RetailCustomerID != null) { _retailStoreDataAccessLayer.UpdateRetailstoreByRetailCustomerID(retailstore); } } catch (RetailstoreException ex) { throw new RetailstoreException(ex.Message); } }
/// <summary> /// Method to add retail store details /// </summary> /// <param name="r">represents the retail store object</param> public void AddRetailstore(Retailstore r) { try { //Retail customer id not be null if (r.RetailCustomerID != null) { //RetailStoreDataAccessLayer.AddRetailStore(r); } } catch (RetailstoreException ex) { throw new RetailstoreException(ex.Message); } }
/// <summary> /// Method to update the customername /// </summary> /// <param name="retailstore">Reprsents the retailstore object</param> public void UpdateRetailstoreByRetailCustomerID(Retailstore retailstore) { //if (_retailStoreList.Exists(r => r.RetailCustomerID == retailstore.RetailCustomerID)) Retailstore u = _retailStoreList.Find(r => r.RetailCustomerID == retailstore.RetailCustomerID); if (u != null) { u.CustomerName = retailstore.CustomerName; // SaveIntoFile(); } else { throw new RetailstoreException("Retailstore doesn't exist"); } }