Beispiel #1
0
        public void InitPackageBranches()
        {
            package_branches.Clear();

            CTable    o   = GetDbObject();
            ArrayList arr = o.GetChildArray("PACKAGE_BRANCH_ITEM");

            if (arr == null)
            {
                arr = new ArrayList();
                o.AddChildArray("PACKAGE_BRANCH_ITEM", arr);
            }

            Hashtable temp = new Hashtable();

            foreach (CTable t in arr)
            {
                MPackageBranch v = new MPackageBranch(t);

                package_branches.Add(v);
                temp[v.BranchId] = "dummy";

                v.ExtFlag = "I";

                v.Seq = internalSeq;
                internalSeq++;
            }

            if (!CMasterReference.IsMasterRefLoad(MasterRefEnum.MASTER_BRANCH))
            {
                CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetMasterRefList);
            }

            foreach (MMasterRef mr in CMasterReference.Instance.Branches)
            {
                if (mr.MasterID.Equals(""))
                {
                    continue;
                }

                if (temp.ContainsKey(mr.MasterID))
                {
                    continue;
                }

                MPackageBranch v = new MPackageBranch(new CTable(""));

                v.Code     = mr.Code;
                v.Name     = mr.Description;
                v.BranchId = mr.MasterID;
                v.ExtFlag  = "A";

                package_branches.Add(v);
                arr.Add(v.GetDbObject());

                v.Seq = internalSeq;
                internalSeq++;
            }
        }
Beispiel #2
0
        public void AddBranchItem(MPackageBranch vp)
        {
            CTable    o   = GetDbObject();
            ArrayList arr = o.GetChildArray("PACKAGE_BRANCH_ITEM");

            if (arr == null)
            {
                arr = new ArrayList();
                o.AddChildArray("PACKAGE_BRANCH_ITEM", arr);
            }

            arr.Add(vp.GetDbObject());
            package_branches.Add(vp);

            vp.Seq = internalSeq;
            internalSeq++;
        }
Beispiel #3
0
 public void RemoveBranchItem(MPackageBranch vp)
 {
     removeAssociateItems(vp, "PACKAGE_BRANCH_ITEM", "INTERNAL_SEQ", "PACKAGE_BRANCH_ID");
     package_branches.Remove(vp);
 }