Esempio n. 1
0
        public TransactionStatusModel AddNewProduct(ProductDTO product)
        {
            TransactionStatusModel transStatus = new TransactionStatusModel();
            ProjectDataService     dataService = new ProjectDataService();

            using (TransactionScope tran = new TransactionScope())
            {
                try
                {
                    transStatus = dataService.AddNewProduct(product);
                } catch (Exception ex)
                {
                    transStatus.ReturnStatus = false;
                    transStatus.ReturnMessage.Add("Add Product Failed");
                    return(transStatus);
                }

                tran.Complete();
            }

            return(transStatus);
        }