Пример #1
0
 public override bool Save(object model, bool creating)
 {
     try
     {
         if (model != null)
         {
             var  wcf       = new WcfService.Service();
             var  obj       = (FatturaAcquistoDto)model;
             bool performed = false;
             if (creating)
             {
                 var newObj = wcf.CreateFatturaAcquisto(obj);
                 performed = (newObj != null);
                 if (performed)
                 {
                     Update(obj, newObj);
                 }
             }
             else //updating
             {
                 performed = wcf.UpdateFatturaAcquisto(obj);
             }
             return(performed);
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
     return(false);
 }