示例#1
0
        /*__________________________________________________________________________________________*/
        private void LoadClientData()
        {
            AssociationsDo associations = new AssociationsDo();
             string _francheseeId = "00000000000000080533_00000001219860847215_00001";

            //associations.ParentId =
            associations.Ids.Add( _francheseeId);
            associations.ParentGroup = "FRANCHESEE"; // parent
            associations.ChildGroup = "CLIENT";
            associations.IDType = (int)AssociationIdx.PARENTID;
            //associations = new AssociationsDo(parentgroup, parentid, childgroup, "parent");

            List<Association> ClientAssociation = associations.LoadData();
             associations.ReSet();

             associations.Ids.Add(ClientAssociation.FindLast(element => element.ParentId == _francheseeId).ChildId);

            associations.ParentGroup = "CLIENT"; // parent
            associations.ChildGroup = "CONTACT";
            associations.IDType = (int)AssociationIdx.PARENTID;
            //associations = new AssociationsDo(parentgroup, parentid, childgroup, "parent");
            List<Association > LoadClientContactData= associations.LoadData();

             NamesDo names = new NamesDo();
             names.Ids.Add(ClientAssociation.FindLast(element => element.ParentId == _francheseeId).ChildId);
             names.Group = "CLIENT";
             names.LoadData();
        }
示例#2
0
        /*__________________________________________________________________________________________*/
        public void testGroupIDCombos()
        {
            AssociationsDo associations = new AssociationsDo();
            string childid;
            string Id;
            string parentgroup;
            string childgroup ;
            string message;

            message = "FRANCHESEE/CLIENT";
            Id = "00000000000000080533_00000001219860847215_00001";
            parentgroup = "FRANCHESEE";   // parent
            childgroup = "CLIENT";
            associations.Ids.Add(Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> FranchessClientAssociation = associations.LoadData();
            associations.ReviewTestData(FranchessClientAssociation, message);
            associations.ReSet();

            message = "FRANCHESEE PARENT GROUP";
            parentgroup = "FRANCHESEE";   // parent
            associations.ParentGroup = parentgroup; // parent
            List<Association> FranchessAssociation = associations.LoadData();
            associations.ReviewTestData(FranchessAssociation, message);
            associations.ReSet();

            message = "FRANCHESEE CHILDGROUP"  ;
            childgroup = "FRANCHESEE";   // parent
            associations.ChildGroup = childgroup;
            List<Association> FranchessCHILDGROUPAssociation = associations.LoadData();
            associations.ReviewTestData(FranchessCHILDGROUPAssociation, message);
            associations.ReSet();

            message = "1-CLIENT/*BUY";
            Id = "00000000000000085967_00000001220429793929_03490";
            parentgroup = "CLIENT";      // parent
            childgroup = "BUY";
            associations.Ids.Add( Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> BuyClientAssociation = associations.LoadData();
            associations.ReviewTestData(BuyClientAssociation, message);
            associations.ReSet();

            message = "1-BUY/1-ITEM       // POST INVENTORY IN";
            Id = "00000000000000085967_00000001220429793973_03493";
            parentgroup = "BUY";      // parent
            childgroup = "ITEM";
            associations.Ids.Add( Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> BuyItemAssociation = associations.LoadData();
            associations.ReviewTestData(BuyItemAssociation, message);
            associations.ReSet();

            message = "1-TEM/1-SOLD     // POST INVENTORY OUT";
            Id = "00000000000000085967_00000001220429793929_01490";
            parentgroup = "ITEM";      // parent
            childgroup = "SOLD";
            associations.Ids.Add( Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> ItemsSoldAssociation = associations.LoadData();
            associations.ReviewTestData(ItemsSoldAssociation, message);
            associations.ReSet();

            //1-SOLD/1-CUSTOMER  // INVENTORY OUT DEBIT
            Id = "00000000000000085967_00000001220429793973_03493";
            parentgroup = "SOLD";      // parent
            childgroup = "CUSTOMER";
            associations.Ids.Add( Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> SoldCustomerAssociation = associations.LoadData();
            associations.ReviewTestData(SoldCustomerAssociation, message);
            associations.ReSet();

            message = "CUSTOMER/CONTACT";
            Id = "00000000000000102008_00000001220952018901_05207";
            parentgroup = "CUSTOMER";      // parent
            childgroup = "CONTACT";
            associations.Ids.Add( Id);
            associations.ParentGroup = parentgroup; // parent
            associations.ChildGroup = childgroup;
            associations.IDType = (int)AssociationIdx.PARENTID;
            List<Association> CustomerContactAssociation = associations.LoadData();
            associations.ReviewTestData(CustomerContactAssociation, message);
            associations.ReSet();

            associations.GetAll = true;
            associations.LoadData();

            var parentgrp = associations.GetUniqueParentGroups();
            var childgrp = associations.GetUniqueChildGroups();
            var pairedBuyClient  = associations.GetPairedParentGroupAndId(BuyClientAssociation);
            var quadBuyClient = associations.GetQuadDataList(BuyClientAssociation);
        }