Example #1
0
        public async ValueTask <RequestResult <Lead> > AddOrUpdateLead(Lead dataModel)
        {
            var result = new RequestResult <Lead>();

            try
            {
                _leadStorage.TransactionStart();
                result.RequestData = await _leadStorage.LeadAddOrUpdate(dataModel);

                _leadStorage.TransactionCommit();
                result.IsOkay = true;
            }
            catch (Exception ex)
            {
                _leadStorage.TransactioRollBack();
                result.ExMessage = ex.Message;
            }
            return(result);
        }
Example #2
0
        public async ValueTask <RequestResult <Account> > AddAccount(Account dataModel)
        {
            var result = new RequestResult <Account>();

            try
            {
                _leadStorage.TransactionStart();
                result.RequestData = await _leadStorage.AccountAdd(dataModel);

                _leadStorage.TransactionCommit();
                result.IsOkay = true;
            }
            catch (Exception ex)
            {
                _leadStorage.TransactioRollBack();
                result.ExMessage = ex.Message;
            }
            return(result);
        }