public override void Copy(ONInstance instance) { RevisionInstance linstance = instance as RevisionInstance; Oid = new RevisionOid(linstance.Oid); NombreRevisorAttr = new ONString(linstance.NombreRevisorAttr); FechaRevisionAttr = new ONDate(linstance.FechaRevisionAttr); Id_AeronaveAttr = new ONString(linstance.Id_AeronaveAttr); RevisionPasajeroRoleTemp = linstance.RevisionPasajeroRoleTemp; StateObj = new ONString(linstance.StateObj); base.Copy(instance); }
/// <summary> /// Creates XML elements from the data of the system. /// </summary> /// <param name="xmlWriter">Object with the XML message to add new information and return to client side</param> /// <param name="val">Value to be puted inside the XML message</param> /// <param name="dtdVersion">Version of the DTD that follows the XML message</param> /// <param name="xmlElement">Element of the XML that is checked</param> public static void ON2XML(XmlWriter xmlWriter, ONDate val, double dtdVersion, string xmlElement) { if (val == null) { if (xmlElement == ONXml.XMLTAG_V) { xmlWriter.WriteElementString(xmlElement, ""); } else { xmlWriter.WriteElementString(ONXml.XMLTAG_NULL, null); } } else { if (dtdVersion < 2.0) // Apply the locale format { if ((val.TypedValue.Hour == 0) && (val.TypedValue.Minute == 0) && (val.TypedValue.Second == 0)) { xmlWriter.WriteElementString(xmlElement, val.TypedValue.ToString("d")); } else { xmlWriter.WriteElementString(xmlElement, val.TypedValue.ToString()); } } else { xmlWriter.WriteStartElement(xmlElement); if (xmlElement == ONXml.XMLTAG_OIDFIELD && dtdVersion > 2.0) { xmlWriter.WriteAttributeString("Type", "date"); } xmlWriter.WriteString(val.TypedValue.ToString("yyyy-MM-dd")); xmlWriter.WriteEndElement(); } } }
public RevisionPasajeroLMDFilter(ONDate initDateVar, ONDate finalDateVar) : base("RevisionPasajero", "LMD") { InMemory = false; InData = true; }
public RevisionInstance Create_instanceServ( [ONInboundArgument("Clas_1348178542592347Ser_1Arg_1_Alias", RevisionClassText.Create_instance_P_atrid_RevisarAeronaveArgumentAlias, "autonumeric", "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, AllowsNull = false)] ONInt p_atrid_RevisarAeronaveArg, [ONInboundArgument("Clas_1348178542592347Ser_1Arg_3_Alias", RevisionClassText.Create_instance_P_atrFechaRevisionArgumentAlias, "date", "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, AllowsNull = false)] ONDate p_atrFechaRevisionArg, [ONInboundArgument("Clas_1348178542592347Ser_1Arg_4_Alias", RevisionClassText.Create_instance_P_atrNombreRevisorArgumentAlias, "string", "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, Length = 100, AllowsNull = false)] ONString p_atrNombreRevisorArg, [ONInboundArgument("Clas_1348178542592347Ser_1Arg_5_Alias", RevisionClassText.Create_instance_P_atrId_AeronaveArgumentAlias, "string", "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, Length = 100, AllowsNull = false)] ONString p_atrId_AeronaveArg) { try { RevisionData lData = new RevisionData(OnContext); #region Construct OID Instance.Oid = new RevisionOid(); Instance.Oid.Id_RevisarAeronaveAttr = new ONInt(p_atrid_RevisarAeronaveArg); #endregion Construct OID #region Argument initialization 'p_atrFechaRevision' (FechaRevision) Instance.FechaRevisionAttr = new ONDate(p_atrFechaRevisionArg); #endregion Argument initialization 'p_atrFechaRevision' (FechaRevision) #region Argument initialization 'p_atrNombreRevisor' (NombreRevisor) Instance.NombreRevisorAttr = new ONString(p_atrNombreRevisorArg); #endregion Argument initialization 'p_atrNombreRevisor' (NombreRevisor) #region Argument initialization 'p_atrId_Aeronave' (Id_Aeronave) Instance.Id_AeronaveAttr = new ONString(p_atrId_AeronaveArg); #endregion Argument initialization 'p_atrId_Aeronave' (Id_Aeronave) #region Autonumeric attribute 'id_RevisarAeronave' if (Instance.Id_RevisarAeronaveAttr < new ONInt(0)) { RevisionData lAutonumericData = new RevisionData(OnContext); lAutonumericData.ClassName = "Revision"; //Get Autonumeric Instance.Oid.Id_RevisarAeronaveAttr = lAutonumericData.GetAutonumericid_RevisarAeronave(); } #endregion Autonumeric attribute 'id_RevisarAeronave' //Search if instance exists if (lData.Exist(Instance.Oid, null)) { throw new ONInstanceExistException(null, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias); } //Update the new instance lData.UpdateAdded(Instance); } catch (Exception e) { if (e is ONException) { throw e; } else { string ltraceItem = "Definition class: Revision, Service: create_instance, Component: RevisionAction, Method: Create_instanceServ"; if (e is ONSystemException) { ONSystemException lException = e as ONSystemException; lException.addTraceInformation(ltraceItem); throw lException; } throw new ONSystemException(e, ltraceItem); } } return(Instance); }
public void CheckSTDiagram_create_instance(ONInt p_atrid_RevisarAeronaveArg, ONDate p_atrFechaRevisionArg, ONString p_atrNombreRevisorArg, ONString p_atrId_AeronaveArg) { Instance.StateObj = new ONString("Revisi0"); }
public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName) { // Process the service arguments ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias); lSInfo.AddDataValuedArgument("p_atrid_RevisarAeronave", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1348178542592347Ser_1Arg_1_Alias", RevisionClassText.Create_instance_P_atrid_RevisarAeronaveArgumentAlias); lSInfo.AddDataValuedArgument("p_atrFechaRevision", false, DataTypeEnumerator.Date, 0, "Clas_1348178542592347Ser_1Arg_3_Alias", RevisionClassText.Create_instance_P_atrFechaRevisionArgumentAlias); lSInfo.AddDataValuedArgument("p_atrNombreRevisor", false, DataTypeEnumerator.String, 100, "Clas_1348178542592347Ser_1Arg_4_Alias", RevisionClassText.Create_instance_P_atrNombreRevisorArgumentAlias); lSInfo.AddDataValuedArgument("p_atrId_Aeronave", false, DataTypeEnumerator.String, 100, "Clas_1348178542592347Ser_1Arg_5_Alias", RevisionClassText.Create_instance_P_atrId_AeronaveArgumentAlias); try { lSInfo.XML2ON(xmlReader, dtdVersion, true); } catch (Exception e) { throw new ONServiceArgumentsException(e, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias); } ONInt lP_atrid_RevisarAeronaveArg = (ONInt)((ONArgumentInfo)lSInfo.mArgumentList["p_atrid_RevisarAeronave"]).Value; ONDate lP_atrFechaRevisionArg = (ONDate)((ONArgumentInfo)lSInfo.mArgumentList["p_atrFechaRevision"]).Value; ONString lP_atrNombreRevisorArg = (ONString)((ONArgumentInfo)lSInfo.mArgumentList["p_atrNombreRevisor"]).Value; ONString lP_atrId_AeronaveArg = (ONString)((ONArgumentInfo)lSInfo.mArgumentList["p_atrId_Aeronave"]).Value; // Create Context ONServiceContext lOnContext = new ONServiceContext(); lOnContext.OidAgent = agentOid; // Execute Service RevisionInstance lInstance = null; try { using (RevisionServer lServer = new RevisionServer(lOnContext, null)) { lServer.Create_instanceServ(lP_atrid_RevisarAeronaveArg, lP_atrFechaRevisionArg, lP_atrNombreRevisorArg, lP_atrId_AeronaveArg); lInstance = lServer.Instance; } ticket = lOnContext.GetTicket(dtdVersion, clientName); } catch (SecurityException) { throw new ONAccessAgentValidationException(null); } catch { throw; } // Write Oid if (dtdVersion >= 3.1) { if (lInstance != null) { ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD); } } // Write Outbound Arguments xmlWriter.WriteStartElement("Arguments"); // Write Outbound Arguments xmlWriter.WriteEndElement(); // Arguments }
public RevisionInstance Create_instanceServ(ONInt p_atrid_RevisarAeronaveArg, ONDate p_atrFechaRevisionArg, ONString p_atrNombreRevisorArg, ONString p_atrId_AeronaveArg) { // Create new context using (ONServiceContext lOnContext = new ONServiceContext(OnContext)) { // Call Executive RevisionExecutive lExecutive = new RevisionExecutive(); lExecutive.OnContext = lOnContext; lExecutive.Instance = Instance; Instance = lExecutive.Create_instanceServ(p_atrid_RevisarAeronaveArg, p_atrFechaRevisionArg, p_atrNombreRevisorArg, p_atrId_AeronaveArg); } return(Instance); }
public PasajeroAeronaveLMDFilter(ONDate initDateVar, ONDate finalDateVar) : base("PasajeroAeronave", "LMD") { InMemory = false; InData = true; }
public NaveNodrizaLMDFilter(ONDate initDateVar, ONDate finalDateVar) : base("NaveNodriza", "LMD") { InMemory = false; InData = true; }
internal RevisionInstance Create_instanceServ(ONInt p_atrid_RevisarAeronaveArg, ONDate p_atrFechaRevisionArg, ONString p_atrNombreRevisorArg, ONString p_atrId_AeronaveArg) { if (Instance != null) { ONFilterList onfilt = new ONFilterList(); onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid)); Instance.Find(onfilt); } // Execute service RevisionAction lAction = new RevisionAction(OnContext); lAction.Instance = new RevisionInstance(OnContext); Instance = lAction.Create_instanceServ(p_atrid_RevisarAeronaveArg, p_atrFechaRevisionArg, p_atrNombreRevisorArg, p_atrId_AeronaveArg); OnContext.OperationStack.Pop(); OnContext.OperationStack.Push(Instance); return(Instance); }
public AdministradorLMDFilter(ONDate initDateVar, ONDate finalDateVar) : base("Administrador", "LMD") { InMemory = false; InData = true; }