상속: System.Data.DataSet
예제 #1
0
        private EmailsDocumentCollection GetEmailsCollectionFromCustomer(Emails emails, DeleteHistoryDataset history, Token lastToken, string crmUser)
        {
            EmailsDocumentCollection emailCollection = new EmailsDocumentCollection();
            EmailDocument email;

            foreach (DeleteHistoryDataset.DeleteHistoryRow dr in history.DeleteHistory)
            {
                if (dr.DeleteUser == crmUser)
                    continue;
                if (dr.DeleteID <= lastToken.SequenceNumber)
                    continue;
                email = new EmailDocument();
                email.Id = dr.Identity;
                email.LogState = LogState.Deleted;
                emailCollection.Add(email);

            }

            int index = 0;
            foreach (Emails.CustomerEmailsRow er in emails.CustomerEmails)
            {
                email = new EmailDocument();
                if ((er.CreateUser != crmUser) && (er.CreateID > lastToken.SequenceNumber))
                    email.LogState = LogState.Created;
                else if ((er.ModifyUser != crmUser) && (er.ModifyID > lastToken.SequenceNumber))
                    email.LogState = LogState.Updated;

                email.Id = er.ID.ToString();
                try
                {

                    email.emailaddress.Value = er.Email;

                    if (index == 0)
                        email.type.Value = "Business";
                    if (index == 1)
                        email.type.Value = "Private";
                    index++;
                }
                catch (StrongTypingException)
                {
                    email.emailaddress.Value = null;
                }

                emailCollection.Add(email);

            }
            return emailCollection;
        }
 public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     DeleteHistoryDataset ds = new DeleteHistoryDataset();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "DeleteHistoryDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     return type;
 }
예제 #3
0
        private EmailsDocumentCollection GetEmailsCollectionFromCustomer(string customerId, Token lastToken, NorthwindConfig config)
        {
            int recordCount;
            Emails emails = new Emails();
            DeleteHistoryDataset history = new DeleteHistoryDataset();

            using (OleDbConnection connection = new OleDbConnection(config.ConnectionString))
            {
                Sage.Integration.Northwind.Application.Entities.Account.DataSets.EmailsTableAdapters.CustomerEmailsTableAdapter tableAdapter;
                tableAdapter = new Sage.Integration.Northwind.Application.Entities.Account.DataSets.EmailsTableAdapters.CustomerEmailsTableAdapter();
                tableAdapter.Connection = connection;
                recordCount = tableAdapter.FillByCustomerId(emails.CustomerEmails, customerId);

                DeleteHistoryTableAdapter tableAdapterDeleted;
                tableAdapterDeleted = new DeleteHistoryTableAdapter();
                tableAdapterDeleted.Connection = connection;
                recordCount += tableAdapterDeleted.FillCustomerEmailsBy(history.DeleteHistory, customerId.ToString());
            }

            if (recordCount == 0)
                return new EmailsDocumentCollection();

            return GetEmailsCollectionFromCustomer(emails, history, lastToken, config.CrmUser);
        }
 public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
     DeleteHistoryDataset ds = new DeleteHistoryDataset();
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     return type;
 }