private string SaveOperations(GetListOperationsOutput operationOutput, string program, DateTime startDate, DateTime endDate, ref Dictionary <int, string> errorMessage) { var outMessages = new StringBuilder(); if (operationOutput != null && operationOutput.returnCodes != null && operationOutput.returnCodes.Length > 0) { errorMessage.Add(operationOutput.returnCodes[0].code, operationOutput.returnCodes[0].message); } else if (operationOutput != null && operationOutput.listOperations != null && operationOutput.listOperations.Length > 0) { List <ListOperations> lstOperationOutput = operationOutput.listOperations.Where(o => string.Equals(o.codeAbattement, "0")).ToList(); try { //System.Diagnostics.Stopwatch sw2 = new System.Diagnostics.Stopwatch(); //sw2.Start(); using (operationBusiness = new OperationBusiness()) { HubFunctions.SendMessage($"start Save Operations..."); var outmsg = operationBusiness.SaveOperations(lstOperationOutput, program, startDate, endDate, out isSommeErrorsInOperations); outMessages.AppendLine(outmsg); HubFunctions.SendMessage($"End Save Operations..."); //calcul de l'exposure sur chaque opeartion par procedure stoqué HubFunctions.SendMessage($"start compute exposure by operation ..."); _dataContext.ExecuteStoreCommand("[compute]", new object[] { }); HubFunctions.SendMessage($"end compute exposure by operation ..."); } //sw2.Stop(); //Console.WriteLine("Temps traitement Operations." + (sw2.ElapsedMilliseconds / 1000).ToString() + "s" + " " + sw2.ElapsedMilliseconds.ToString() + "ms"); outMessages.AppendLine("mise à jour operations + contrats réussi"); } catch (Exception exp) { throw exp; } finally { if (operationBusiness != null) { ((IDisposable)operationBusiness).Dispose(); } } } return(outMessages.ToString()); }
public void Load(string operationNumber) { OperationContext = new OperationBusiness(); Globals.Rules.ApplyParentLogic(this, OperationContext); OperationContext.Load(operationNumber); ResultsMatrixContext = new ResultsMatrixBusiness(); Globals.Rules.ApplyParentLogic(this, ResultsMatrixContext); ResultsMatrixContext.Load(OperationContext); Url = new UrlHelper(IDBContext.Current.ContextRequestContext); VIS_TL = MasterDefinitions.GetValidationStage("VIS_TL"); VIS_REV = MasterDefinitions.GetValidationStage("VIS_REV"); VIS_DRAFY = MasterDefinitions.GetValidationStage("VIS_DRAFY"); VIS_READY = MasterDefinitions.GetValidationStage("VIS_READY"); VIS_COO = MasterDefinitions.GetValidationStage("VIS_COO"); LocationTypes = MasterDefinitions.GetMasterByType("VO_LOCATION_TYPE"); MediaSourceTypes = MasterDefinitions.GetMasterByType("MEDIA_SOURCE"); DeliveryStatusTypes = MasterDefinitions.GetMasterByType("VO_DELIVERY_STATUS") .OrderByDescending(a => a.Code).ToList(); Execute("Visualization.Load"); }
public void Load(OperationBusiness operation) { OperationContext = operation; }
public OperationsController() { _operationBusiness = new OperationBusiness(); }
protected void Page_Load(object sender, EventArgs e) { operationBusiness = new OperationBusiness(); }