Пример #1
0
        public bool Put(SoW item)
        {
            if (item == null)
            {
                return(false);
            }

            SoW existingItem = _context.SoW.FirstOrDefault(s => s.SoWid == item.SoWid);

            if (existingItem != null)
            {
                existingItem.SupplierId            = item.SupplierId;
                existingItem.ServiceLine           = item.ServiceLine;
                existingItem.ContractId            = item.ContractId;
                existingItem.EffectiveDate         = item.EffectiveDate;
                existingItem.ExpirationDate        = item.ExpirationDate;
                existingItem.Msowner               = item.Msowner;
                existingItem.InfyOwner             = item.InfyOwner;
                existingItem.ServiceCatalogVersion = item.ServiceCatalogVersion;
                existingItem.PonumYear1            = item.PonumYear1;
                existingItem.SowamountYear1        = item.SowamountYear1;
                existingItem.SowamountYear2        = item.SowamountYear2;
                existingItem.SowamountYear3        = item.SowamountYear3;
                existingItem.SowamountYear4        = item.SowamountYear4;
                existingItem.IsCrest               = item.IsCrest;
                existingItem.Remarks               = item.Remarks;
                _context.SoW.Update(existingItem);
            }
            else
            {
                _context.SoW.Add(item);
            }

            _context.SaveChanges();
            return(true);
        }
Пример #2
0
 public bool PutSoW([FromBody] SoW item)
 {
     return(_sowRepository.Put(item));
 }