Пример #1
0
        public void AddUpdateTissueBankProducts(DataTable tempTissueBankProduct_TissueBank, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();

            ProductBusinessRule productBusinessRule = new ProductBusinessRule(_productDataService);

            try
            {
                _productDataService.CreateSession();

                productBusinessRule.ValidateProductsDataTable(tempTissueBankProduct_TissueBank);

                if (productBusinessRule.ValidationStatus == true)
                {
                    _productDataService.AddUpdateTissueBankProducts(tempTissueBankProduct_TissueBank, out transaction);
                }
                else
                {
                    transaction.ReturnStatus     = productBusinessRule.ValidationStatus;
                    transaction.ReturnMessage    = productBusinessRule.ValidationMessage;
                    transaction.ValidationErrors = productBusinessRule.ValidationErrors;
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                _productDataService.CloseSession();
            }
        }
Пример #2
0
        public IEnumerable <sp_TissueBankProduct_TissueBank_GetTissueBankProductsByTissueBankProductMasterId_Result> GetTissueBankProductsByTissueBankProductMasterId(int TissueBankProductMasterId, int InfoId, string InfoType, out TransactionalInformation transaction)
        {
            transaction = new TransactionalInformation();

            IEnumerable <sp_TissueBankProduct_TissueBank_GetTissueBankProductsByTissueBankProductMasterId_Result> lstTbProducts = null;

            ProductBusinessRule productBusinessRule = new ProductBusinessRule(_productDataService);

            try
            {
                _productDataService.CreateSession();

                productBusinessRule.ValidTissueBankProductMasterRequest(TissueBankProductMasterId, InfoId, InfoType);

                if (productBusinessRule.ValidationStatus == true)
                {
                    _productDataService.CreateSession();
                    lstTbProducts = _productDataService.GetTissueBankProductsByTissueBankProductMasterId(TissueBankProductMasterId, out transaction);
                }
                else
                {
                    transaction.ReturnStatus     = productBusinessRule.ValidationStatus;
                    transaction.ReturnMessage    = productBusinessRule.ValidationMessage;
                    transaction.ValidationErrors = productBusinessRule.ValidationErrors;
                }
            }
            catch (Exception ex)
            {
                transaction.ReturnMessage = new List <string>();
                string errorMessage = ex.Message;
                transaction.ReturnStatus = false;
                transaction.ReturnMessage.Add(errorMessage);
            }
            finally
            {
                _productDataService.CloseSession();
            }
            return(lstTbProducts);
        }