private void RetrieveInstances(SellingPeriodFacade facade)
 {
     if (CurrentUserContext.IsAdmin || CurrentUserContext.IsEmployee)
     {
         CurrentInstances = facade.RetrieveAllSellingPeriod(new SellingPeriodConverter());
     }
 }
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         SellingPeriodFacade facade = new SellingPeriodFacade(uow);
         RetrieveInstances(facade);
     }
 }
        protected void ucIList_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e)
        {
            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                SellingPeriodFacade facade = new SellingPeriodFacade(uow);
                IFacadeUpdateResult <SellingPeriodData> result = facade.DeleteSellingPeriod(e.Instance.Id);
                e.IsSuccessful = result.IsSuccessful;

                if (result.IsSuccessful)
                {
                    // Refresh whole list
                    RetrieveInstances(facade);
                }
                else
                {
                    // Deal with Update result
                    ProcUpdateResult(result.ValidationResult, result.Exception);
                }
            }
        }