Example #1
0
        public ArrayList CreateNodes()
        {
            const string      METHOD_NAME       = "CreatNodes()";
            int               intParent         = 0;
            int               intCurrent        = 1;
            int               intChild          = 1000;
            TableManagementBO boTableManagement = new TableManagementBO();
            ArrayList         arr = new ArrayList();

            try
            {
                ArrayList arrTable = boTableManagement.GetAllTable();
                ArrayList arrGroup = boTableManagement.GetAllGroup();
                ArrayList arrAnd   = boTableManagement.GetAllTableAndGroup();

                foreach (sys_TableGroupVO voTableGroup in arrGroup)
                {
                    TableNodes node = new TableNodes(intParent, intCurrent, voTableGroup);
                    arr.Add(node);
                    int index = 0;
                    foreach (sys_TableAndGroupVO voTableAndGroup in arrAnd)
                    {
                        if (voTableGroup.TableGroupID == voTableAndGroup.TableGroupID)
                        {
                            sys_TableVO voSysTable = (sys_TableVO)arrTable[index];
                            node = new TableNodes(intCurrent, intChild, voSysTable);
                            arr.Add(node);
                        }
                        intChild++;
                        index++;
                    }
                    intCurrent++;
                }
                return(arr);
            }
            catch (Exception ex)
            {
                throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
            }
        }
Example #2
0
        ///    <Description>
        ///       This method checks business rule and call AddAndReturnMaxID() method of DS class
        ///    </Description>
        ///    <Inputs>
        ///       Value object
        ///    </Inputs>
        ///    <Outputs>
        ///      N/A
        ///    </Outputs>
        ///    <Returns>
        ///      void
        ///    </Returns>
        ///    <Authors>
        ///       NgocHT
        ///    </Authors>
        ///    <History>
        ///     27-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public int AddTableAndReturnMaxID(object pobjObjectVO, int pintGroupID)
        {
//			try
//			{
            sys_TableVO         voSysTable      = (sys_TableVO)pobjObjectVO;
            sys_TableAndGroupVO voTableAndGroup = new sys_TableAndGroupVO();
            sys_TableDS         dsSysTable      = new sys_TableDS();

            voTableAndGroup.TableGroupID = pintGroupID;
            voTableAndGroup.TableID      = voSysTable.TableID;
            voTableAndGroup.TableOrder   = dsSysTable.MaxTableOrder(pintGroupID) + 1;

            return(dsSysTable.AddTableAndReturnMaxID(pobjObjectVO, pintGroupID));
//			}
//			catch(PCSDBException ex)
//			{
//				throw ex;
//			}
//			catch (Exception ex)
//			{
//				throw ex;
//			}
        }
Example #3
0
        ///    <Description>
        ///       This method checks business rule and call Add() method of DS class
        ///    </Description>
        ///    <Inputs>
        ///       Value object
        ///    </Inputs>
        ///    <Outputs>
        ///      N/A
        ///    </Outputs>
        ///    <Returns>
        ///      void
        ///    </Returns>
        ///    <Authors>
        ///       NgocHT
        ///    </Authors>
        ///    <History>
        ///     27-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        public void AddTable(object pobjObjectVO, int pintGroupID)
        {
            try
            {
                sys_TableVO         voSysTable      = (sys_TableVO)pobjObjectVO;
                sys_TableAndGroupVO voTableAndGroup = new sys_TableAndGroupVO();
                sys_TableDS         dsSysTable      = new sys_TableDS();

                voTableAndGroup.TableGroupID = pintGroupID;
                voTableAndGroup.TableID      = voSysTable.TableID;
                voTableAndGroup.TableOrder   = dsSysTable.MaxTableOrder(pintGroupID) + 1;

                dsSysTable.AddTable(pobjObjectVO, pintGroupID);
            }
            catch (PCSDBException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }