public SiteProcessingMethodologyTotal SaveSiteProcessingMethodologyTotal(SiteProcessingMethodologyTotalItem item, string savedBy) { var processingTypeManager = this.container.GetInstance <ProcessingTypeManager>(); var totalManager = this.container.GetInstance <SiteProcessingMethodologyTotalManager>(); var processingType = processingTypeManager.GetByName(item.ProcessingType.Name); if (processingType == null) { throw new Exception("Cannot find data"); } var result = totalManager.Save(processingType, item.Id, item.SiteId, item.PlatformCount, item.ProtocolCount, Convert.ToDateTime(item.StartDate), Convert.ToDateTime(item.EndDate), savedBy); this.InvalidateCache(savedBy); return(result); }
public async Task <ServiceResponse <SiteProcessingMethodologyTotalItem> > SaveProcessingMethodologyTotal(SiteProcessingMethodologyTotalItem model) { DateTime startTime = DateTime.Now; var siteFacade = this.Container.GetInstance <SiteFacade>(); try { var item = await siteFacade.SaveSiteProcessingMethodologyTotalAsync(model, base.Email); base.LogMessage("SaveProcessingMethodologyTotal", DateTime.Now - startTime); if (!model.Id.HasValue) { item.ProcessingType = new ProcessingType { Name = model.ProcessingType.Name }; } this.SendInvalidation(); return(new ServiceResponse <SiteProcessingMethodologyTotalItem> { Item = ModelConversions.Convert(item) }); } catch (Exception ex) { return(base.HandleException <SiteProcessingMethodologyTotalItem>(ex)); } }