public BaseHeaderType()
 {
     this.sourceField = new List<TextType>();
     this.dataSetIDField = new List<string>();
     this.structureField = new List<PayloadStructureType>();
     this.nameField = new List<TextType>();
     this.receiverField = new List<PartyType>();
     this.senderField = new SenderType();
     this.testField = false;
 }
    private SDMXObjectModel.Message.StructureHeaderType Get_Appropriate_Header_Of_StructureHeaderType()
    {
        SDMXObjectModel.Message.StructureHeaderType RetVal;
        SenderType Sender;
        PartyType Receiver;

        Sender = new SenderType(DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderId, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderName, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Sender, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderDepartment, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderRole, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage));
        Sender.Contact[0].Items = new string[] { DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderTelephone, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderEmail, DevInfo.Lib.DI_LibSDMX.Constants.Header.SenderFax };
        Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        Receiver = new PartyType(DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverId, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverName, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Receiver, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverDepartment, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverRole, DevInfo.Lib.DI_LibSDMX.Constants.DefaultLanguage));
        Receiver.Contact[0].Items = new string[] { DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverTelephone, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverEmail, DevInfo.Lib.DI_LibSDMX.Constants.Header.ReceiverFax };
        Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        RetVal = new StructureHeaderType(DevInfo.Lib.DI_LibSDMX.Constants.Header.Id, true, DateTime.Now, Sender, Receiver);
        return RetVal;
    }
        public new SDMXObjectModel.Message.BasicHeaderType Get_Appropriate_Header()
        {
            SDMXObjectModel.Message.BasicHeaderType RetVal;
            SenderType Sender;
            PartyType Receiver;

            if (this.Header == null)
            {
                Sender = new SenderType(Constants.Header.SenderId, Constants.Header.SenderName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Sender, Constants.Header.SenderDepartment, Constants.Header.SenderRole, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { Constants.Header.SenderTelephone, Constants.Header.SenderEmail, Constants.Header.SenderFax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(Constants.Header.ReceiverId, Constants.Header.ReceiverName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Receiver, Constants.Header.ReceiverDepartment, Constants.Header.ReceiverRole, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { Constants.Header.ReceiverTelephone, Constants.Header.ReceiverEmail, Constants.Header.ReceiverFax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new BasicHeaderType(Constants.Header.Id, true, DateTime.Now, Sender, Receiver);
            }
            else
            {
                Sender = new SenderType(this.Header.Sender.ID, this.Header.Sender.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this.Header.Sender.Contact.Name, this.Header.Sender.Contact.Department, this.Header.Sender.Contact.Role, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { this.Header.Sender.Contact.Telephone, this.Header.Sender.Contact.Email, this.Header.Sender.Contact.Fax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(this.Header.Receiver.ID, this.Header.Receiver.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this.Header.Receiver.Contact.Name, this.Header.Receiver.Contact.Department, this.Header.Receiver.Contact.Role, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { this.Header.Receiver.Contact.Telephone, this.Header.Receiver.Contact.Email, this.Header.Receiver.Contact.Fax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new BasicHeaderType(this.Header.ID, true, DateTime.Now, Sender, Receiver);
            }

            return RetVal;
        }
 public StructureSpecificMetadataHeaderType()
 {
     this.sourceField = new List<TextType>();
     this.dataSetIDField = new List<string>();
     this.structureField = new List<StructureSpecificMetadataStructureType>();
     this.nameField = new List<TextType>();
     this.receiverField = new List<PartyType>();
     this.senderField = new SenderType();
     this.testField = false;
 }
        public StructureSpecificTimeSeriesDataHeaderType(string id, bool test, DateTime prepared, SenderType sender, PartyType receiver)
        {
            this.idField = id;
            this.testField = test;
            this.preparedField = prepared.ToString(Constants.DateFormat) + Constants.DateTimeSeparator + prepared.ToString(Constants.TimeFormat);
            this.senderField = sender;

            if (receiver != null)
            {
                this.receiverField = new List<PartyType>();
                this.receiverField.Add(receiver);
            }

            this.sourceField = new List<TextType>();
            this.dataSetIDField = new List<string>();
            this.structureField = new List<StructureSpecificDataTimeSeriesStructureType>();
            this.nameField = new List<TextType>();
        }
 public BasicHeaderType(string id, bool test, DateTime prepared, SenderType sender, PartyType receiver)
 {
     this.idField = id;
     this.testField = test;
     this.preparedField = prepared.ToString(Constants.DateFormat) + Constants.DateTimeSeparator + prepared.ToString(Constants.TimeFormat);
     this.senderField = sender;
     this.receiverField = receiver;
 }
        public GenericMetadataHeaderType(string id, bool test, DateTime prepared, SenderType sender, PartyType receiver)
        {
            this.idField = id;
            this.testField = test;
            this.preparedField = prepared.ToString(Constants.DateFormat) + Constants.DateTimeSeparator + prepared.ToString(Constants.TimeFormat);
            this.senderField = sender;

            if (receiver != null)
            {
                this.receiverField = new List<PartyType>();
                this.receiverField.Add(receiver);
            }
        }
        public SDMXObjectModel.Message.GenericMetadataHeaderType Get_Appropriate_Header(MetadataTypes metadataType)
        {
            SDMXObjectModel.Message.GenericMetadataHeaderType RetVal;
            SenderType Sender;
            PartyType Receiver;

            if (this._header == null)
            {
                Sender = new SenderType(Constants.Header.SenderId, Constants.Header.SenderName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Sender, Constants.Header.SenderDepartment, Constants.Header.SenderRole, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { Constants.Header.SenderTelephone, Constants.Header.SenderEmail, Constants.Header.SenderFax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(Constants.Header.ReceiverId, Constants.Header.ReceiverName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Receiver, Constants.Header.ReceiverDepartment, Constants.Header.ReceiverRole, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { Constants.Header.ReceiverTelephone, Constants.Header.ReceiverEmail, Constants.Header.ReceiverFax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new GenericMetadataHeaderType(Constants.Header.Id, true, DateTime.Now, Sender, Receiver);
            }
            else
            {
                Sender = new SenderType(this._header.Sender.ID, this._header.Sender.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this._header.Sender.Contact.Name, this._header.Sender.Contact.Department, this._header.Sender.Contact.Role, Constants.DefaultLanguage));
                Sender.Contact[0].Items = new string[] { this._header.Sender.Contact.Telephone, this._header.Sender.Contact.Email, this._header.Sender.Contact.Fax };
                Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                Receiver = new PartyType(this._header.Receiver.ID, this._header.Receiver.Name, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(this._header.Receiver.Contact.Name, this._header.Receiver.Contact.Department, this._header.Receiver.Contact.Role, Constants.DefaultLanguage));
                Receiver.Contact[0].Items = new string[] { this._header.Receiver.Contact.Telephone, this._header.Receiver.Contact.Email, this._header.Receiver.Contact.Fax };
                Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

                RetVal = new GenericMetadataHeaderType(this._header.ID, true, DateTime.Now, Sender, Receiver);
            }

            RetVal.Structure = new List<GenericMetadataStructureType>();
            RetVal.Structure.Add(new GenericMetadataStructureType());

            switch (metadataType)
            {
                case MetadataTypes.Area:
                    RetVal.Structure[0].structureID = Constants.MSD.Area.Id;
                    RetVal.Structure[0].Item = new MetadataStructureReferenceType();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items = new List<object>();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items.Add(new MetadataStructureRefType(Constants.MSD.Area.Id, this._agencyId, Constants.MSD.Area.Version));
                    break;
                case MetadataTypes.Indicator:
                    RetVal.Structure[0].structureID = Constants.MSD.Indicator.Id;
                    RetVal.Structure[0].Item = new MetadataStructureReferenceType();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items = new List<object>();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items.Add(new MetadataStructureRefType(Constants.MSD.Indicator.Id, this._agencyId, Constants.MSD.Indicator.Version));
                    break;
                case MetadataTypes.Source:
                    RetVal.Structure[0].structureID = Constants.MSD.Source.Id;
                    RetVal.Structure[0].Item = new MetadataStructureReferenceType();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items = new List<object>();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items.Add(new MetadataStructureRefType(Constants.MSD.Source.Id, this._agencyId, Constants.MSD.Source.Version));
                    break;
                case MetadataTypes.Layer:
                    RetVal.Structure[0].structureID = Constants.MSD.Area.Id;
                    RetVal.Structure[0].Item = new MetadataStructureReferenceType();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items = new List<object>();
                    ((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items.Add(new MetadataStructureRefType(Constants.MSD.Area.Id, this._agencyId, Constants.MSD.Area.Version));
                    break;
                default:
                    break;
            }

            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).local = false;
            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).localSpecified = true;

            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).@class = ObjectTypeCodelistType.MetadataStructure;
            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).classSpecified = true;

            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).package = PackageTypeCodelistType.metadatastructure;
            ((MetadataStructureRefType)((MetadataStructureReferenceType)RetVal.Structure[0].Item).Items[0]).packageSpecified = true;

            return RetVal;
        }
        private SDMXObjectModel.Message.GenericDataHeaderType Get_Appropriate_Header()
        {
            SDMXObjectModel.Message.GenericDataHeaderType RetVal;
            SenderType Sender;
            PartyType Receiver;

            Sender = new SenderType(Constants.Header.SenderId, Constants.Header.SenderName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Sender, Constants.Header.SenderDepartment, Constants.Header.SenderRole, Constants.DefaultLanguage));
            Sender.Contact[0].Items = new string[] { Constants.Header.SenderTelephone, Constants.Header.SenderEmail, Constants.Header.SenderFax };
            Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

            Receiver = new PartyType(Constants.Header.ReceiverId, Constants.Header.ReceiverName, Constants.DefaultLanguage, new SDMXObjectModel.Message.ContactType(Constants.Header.Receiver, Constants.Header.ReceiverDepartment, Constants.Header.ReceiverRole, Constants.DefaultLanguage));
            Receiver.Contact[0].Items = new string[] { Constants.Header.ReceiverTelephone, Constants.Header.ReceiverEmail, Constants.Header.ReceiverFax };
            Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

            RetVal = new GenericDataHeaderType(Constants.Header.Id, true, DateTime.Now, Sender, Receiver);

            return RetVal;
        }
Beispiel #10
0
    /// <summary>
    /// Sets header details to di structure header object and return object
    /// </summary>
    /// <param name="ObjHeaderDet">Class containg fields for header detail</param>
    /// <returns>Structure header object with fields initlized</returns>
    private SDMXObjectModel.Message.StructureHeaderType GetDiMessageHeaderStructure(HeaderDetailsTemplate ObjHeaderDet)
    {
        SDMXObjectModel.Message.StructureHeaderType ObjStructureHeader = null;
        SenderType Sender;
        PartyType Receiver;
        Sender = new SenderType(ObjHeaderDet.SenderId, ObjHeaderDet.SenderName, ObjHeaderDet.LanguageCode, new SDMXObjectModel.Message.ContactType(ObjHeaderDet.SenderContactName, ObjHeaderDet.SenderDepartment, ObjHeaderDet.SenderRole, ObjHeaderDet.LanguageCode));
        Sender.Contact[0].Items = new string[] { ObjHeaderDet.SenderTelephone, ObjHeaderDet.SenderEmail, ObjHeaderDet.SenderFax };
        Sender.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        Receiver = new PartyType(ObjHeaderDet.RecieverId, ObjHeaderDet.RecieverName, ObjHeaderDet.LanguageCode, new SDMXObjectModel.Message.ContactType(ObjHeaderDet.RecieverContactName, ObjHeaderDet.RecieverDepartment, ObjHeaderDet.RecieverRole, ObjHeaderDet.LanguageCode));
        Receiver.Contact[0].Items = new string[] { ObjHeaderDet.RecieverTelephone, ObjHeaderDet.RecieverEmail, ObjHeaderDet.RecieverFax };
        Receiver.Contact[0].ItemsElementName = new SDMXObjectModel.Message.ContactChoiceType[] { SDMXObjectModel.Message.ContactChoiceType.Telephone, SDMXObjectModel.Message.ContactChoiceType.Email, SDMXObjectModel.Message.ContactChoiceType.Fax };

        ObjStructureHeader = new StructureHeaderType(ObjHeaderDet.HeaderId, true, DateTime.Now, Sender, Receiver);
        return ObjStructureHeader;
    }