예제 #1
0
        public OperationReturnModel <bool> DeleteItemNumberFromList(ListType type, long Id, string itemNumber)
        {
            OperationReturnModel <bool> ret = new OperationReturnModel <bool>();

            try {
                _listService.DeleteItem(AuthenticatedUser, SelectedUserContext, type,
                                        Id, itemNumber);

                var list = new ListModel()
                {
                    BranchId       = SelectedUserContext.BranchId,
                    CustomerNumber = SelectedUserContext.CustomerId,
                    Type           = type,
                    ListId         = Id
                };

                _cacheListLogic.RemoveSpecificCachedList(list);

                _cacheListLogic.ClearCustomersListCaches(this.AuthenticatedUser, this.SelectedUserContext, _listService.ReadUserList(this.AuthenticatedUser, this.SelectedUserContext, true));

                ret = new OperationReturnModel <bool>()
                {
                    SuccessResponse = true, IsSuccess = true
                };
            } catch (Exception ex) {
                ret.IsSuccess    = false;
                ret.ErrorMessage = ex.Message;
                _elRepo.WriteErrorLog("DeleteItemNumberFromList", ex);
            }
            return(ret);
        }