Exemple #1
0
        public async Task <string> UpdateRecord(ShopBridgeVM shopBridgeVM)
        {
            try
            {
                if (!String.IsNullOrWhiteSpace(shopBridgeVM.Id))
                {
                    var shopBridgeItemDM = new ShopBridgeDM();
                    shopBridgeItemDM.Id          = Guid.Parse(shopBridgeVM.Id);
                    shopBridgeItemDM.Name        = shopBridgeVM.Name;
                    shopBridgeItemDM.Price       = shopBridgeVM.Price;
                    shopBridgeItemDM.Description = shopBridgeVM.Description;

                    return(await _shopBridgeDataAccess.UpdateRecord(shopBridgeItemDM));
                }
                return(null);
            }
            catch
            {
                throw;
            }
        }
Exemple #2
0
        public async Task <string> PostRecord(ShopBridgeVM shopBridgeVM)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(shopBridgeVM.Id))
                {
                    var shopBridgeItemDM = new ShopBridgeDM();
                    shopBridgeItemDM.Id          = new Guid();
                    shopBridgeItemDM.Name        = shopBridgeVM.Name;
                    shopBridgeItemDM.Price       = shopBridgeVM.Price;
                    shopBridgeItemDM.Description = shopBridgeVM.Description;

                    return(await _shopBridgeDataAccess.PostRecord(shopBridgeItemDM));
                }
                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }