예제 #1
0
        public override void Copy(object oid)
        {
            AdministradorOid lOid = oid as AdministradorOid;

            if (lOid != null)
            {
                Id_AdministradorAttr = new ONInt(lOid.Id_AdministradorAttr);
            }
            base.Copy(oid);
        }
예제 #2
0
 public AdministradorOid(AdministradorOid oid) : base("Administrador")
 {
     if (oid != null)
     {
         Id_AdministradorAttr = new ONInt(oid.Id_AdministradorAttr);
     }
     else
     {
         Id_AdministradorAttr = ONInt.Null;
     }
 }
예제 #3
0
 public AdministradorOid(AdministradorOid oid)
     : base("Administrador")
 {
     if (oid != null)
     {
         Id_AdministradorAttr = new ONInt(oid.Id_AdministradorAttr);
     }
     else
     {
         Id_AdministradorAttr = ONInt.Null;
     }
 }
 internal void Delete_instanceServ(AdministradorOid p_thisAdministradorArg)
 {
     if (Instance != null)
     {
         ONFilterList onfilt = new ONFilterList();
         onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
         Instance.Find(onfilt);
     }
     // Execute service
     AdministradorAction lAction = new AdministradorAction(OnContext);
     lAction.Instance = Instance;
     lAction.Delete_instanceServ(p_thisAdministradorArg);
 }
예제 #5
0
        /// <summary>
        /// Converts an OID into XML in order to put it in XML message response
        /// </summary>
        /// <param name="xmlWriter">XML with the response message</param>
        /// <param name="oid">OID that will be insert into XML message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        /// <param name="xmlElement">Element in the XML message in order to convert in the right form of the XML</param>
        public static void ON2XML(XmlWriter xmlWriter, AdministradorOid oid, double dtdVersion, string xmlElement)
        {
            if (oid == null)
                xmlWriter.WriteElementString(ONXml.XMLTAG_NULL, null);
            else
            {
                xmlWriter.WriteStartElement(ONXml.XMLTAG_OID);
                xmlWriter.WriteAttributeString(ONXml.XMLATT_CLASS, "Administrador");
                ONXmlAutonumeric.ON2XML(xmlWriter, oid.Id_AdministradorAttr, dtdVersion, xmlElement);

                xmlWriter.WriteEndElement(); // OID
            }
        }
예제 #6
0
        public override bool Equals(object oid)
        {
            AdministradorOid lOid = null;

            if (oid is AdministradorOid)
            {
                lOid = oid as AdministradorOid;
            }
            else if (oid is AdministradorInstance)
            {
                lOid = (oid as AdministradorInstance).Oid;
            }

            if ((object)lOid == null)
            {
                return(false);
            }

            return(lOid.Id_AdministradorAttr.Equals(Id_AdministradorAttr));
        }
        public void Delete_instanceServ(AdministradorOid p_thisAdministradorArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                AdministradorExecutive lExecutive = new AdministradorExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                lExecutive.Delete_instanceServ(p_thisAdministradorArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
        public void SetPasswordServ(AdministradorOid p_thisAdministradorArg, ONString p_NewPasswordArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                AdministradorExecutive lExecutive = new AdministradorExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                lExecutive.SetPasswordServ(p_thisAdministradorArg, p_NewPasswordArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
 public void MVAgentValidationServ(AdministradorOid agentOid, ONString passwordArg)
 {
     passwordArg.TypedValue = ONSecureControl.CipherPassword(passwordArg.TypedValue);
     ONString lPassword = new ONString((Instance.PassWordAttr));
     if (!((lPassword.TypedValue == passwordArg.TypedValue) && (string.Compare(agentOid.ClassName, "Administrador", true) == 0 )))
         throw new ONAgentValidationException(null);
     OnContext.OidAgent = agentOid;
 }
 internal void SetPasswordServ(AdministradorOid p_thisAdministradorArg, ONString p_NewPasswordArg)
 {
     if (Instance != null)
     {
         ONFilterList onfilt = new ONFilterList();
         onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
         Instance.Find(onfilt);
     }
     // Execute service
     AdministradorAction lAction = new AdministradorAction(OnContext);
     lAction.Instance = Instance;
     lAction.SetPasswordServ(p_thisAdministradorArg, p_NewPasswordArg);
 }
예제 #11
0
        /// <summary>
        /// Extracts the OID from the XML message and converts it in structures of the application
        /// </summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public static AdministradorOid XML2ON(XmlReader xmlReader, double dtdVersion)
        {
            try
            {
                if (xmlReader.IsStartElement(ONXml.XMLTAG_NULL))
                {
                    xmlReader.Skip();
                    return AdministradorXml.Null;
                }

                if (!xmlReader.IsStartElement(ONXml.XMLTAG_OID))
                    throw new ONXMLStructureException(null, ONXml.XMLTAG_OID);
            }
            catch(Exception e)
            {
                throw new ONXMLStructureException(e, ONXml.XMLTAG_OID);
            }

            string lClass = xmlReader.GetAttribute("Class");

            if (string.Compare(lClass, "Administrador", true) != 0)
                throw new ONXMLOIDWrongClassException(null, "Clas_1348605050880238_Alias", "Administrador", lClass);

            AdministradorOid lOid = new AdministradorOid();
            xmlReader.ReadStartElement(ONXml.XMLTAG_OID);

            string lFirstField = xmlReader.ReadElementString("OID.Field");
            if (!(xmlReader.IsStartElement("OID.Field")) && (string.Compare(lFirstField, "Debug", true) == 0))
                lOid = AdministradorOid.Null;
            else
            {
                try
                {
                    lOid.Id_AdministradorAttr = ONXmlAutonumeric.UnPack(lFirstField, dtdVersion);
                }
                catch(Exception e)
                {
                    throw new ONXMLOIDFieldException(e, "Clas_1348605050880238_Alias", "Administrador", "Clas_1348605050880238Atr_1_Alias", "id_Administrador");
                }

            }

            try
            {
                xmlReader.ReadEndElement();
            }
            catch
            {
                throw new ONXMLStructureException(null, ONXml.XMLTAG_OID);
            }

            return lOid;
        }
 /// <summary>Default Constructor</summary>
 public AdministradorInstance(ONContext onContext)
     : base(onContext, "Administrador", "Clas_1348605050880238_Alias")
 {
     Oid = new AdministradorOid();
     StateObjAttrTemp = null;
 }
        public override void Copy(ONInstance instance)
        {
            AdministradorInstance linstance = instance as AdministradorInstance;

            Oid = new AdministradorOid(linstance.Oid);

            PassWordAttr = linstance.PassWordAttr;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }