Exemplo n.º 1
0
 /// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="client">client</param>
 /// <param name="name">name</param>
 public MOrg(MClient client, String name)
     : this(client.GetCtx(), 0, client.Get_Trx())
 {
     SetAD_Client_ID(client.GetAD_Client_ID());
     SetValue(name);
     SetName(name);
 }
Exemplo n.º 2
0
        }       //	get

        /// <summary>
        ///	Get active Web Stores of Clieny
        /// </summary>
        /// <param name="client">client</param>
        /// <returns>array of web stores</returns>
        public static MStore[] GetOfClient(MClient client)
        {
            //ArrayList<MStore> list = new ArrayList<MStore>();
            List <MStore> list = new List <MStore>();
            String        sql  = "SELECT * FROM W_Store WHERE AD_Client_ID=@Param1 AND IsActive='Y'";

            SqlParameter[] Param = new SqlParameter[1];
            DataTable      dt    = null;
            IDataReader    idr   = null;

            try
            {
                Param[0] = new SqlParameter("@Param1", client.GetAD_Client_ID());
                idr      = DataBase.DB.ExecuteReader(sql, Param, client.Get_TrxName());
                dt       = new DataTable();
                dt.Load(idr);
                idr.Close();
                foreach (DataRow dr in dt.Rows)
                {
                    list.Add(new MStore(client.GetCtx(), dr, client.Get_TrxName()));
                }
            }
            //PreparedStatement pstmt = null;
            //try
            //{
            //    pstmt = DataBase.prepareStatement (sql, client.get_TrxName());
            //    pstmt.setInt (1, client.getAD_Client_ID());
            //    ResultSet rs = pstmt.executeQuery ();
            //    while (rs.next ())
            //        list.add (new MStore (client.getCtx(), rs, client.get_TrxName()));
            //    rs.close ();
            //    pstmt.close ();
            //    pstmt = null;
            //}
            catch (Exception e)
            {
                if (idr != null)
                {
                    idr.Close();
                }
                _log.Log(Level.SEVERE, sql, e);
            }
            finally
            {
                dt = null;
                if (idr != null)
                {
                    idr.Close();
                }
            }
            //
            MStore[] retValue = new MStore[list.Count];
            //list.toArray (retValue);
            retValue = list.ToArray();
            return(retValue);
        }       //	getOfClient
Exemplo n.º 3
0
        }       //	MClientInfo

        /// <summary>
        ///Parent Constructor
        /// </summary>
        /// <param name="client">client</param>
        /// <param name="AD_Tree_Org_ID">org tree</param>
        /// <param name="AD_Tree_BPartner_ID">bp tree</param>
        /// <param name="AD_Tree_Project_ID">project tree</param>
        /// <param name="AD_Tree_SalesRegion_ID">sr tree</param>
        /// <param name="AD_Tree_Product_ID">product tree</param>
        /// <param name="AD_Tree_Campaign_ID">campaign tree</param>
        /// <param name="AD_Tree_Activity_ID">activity tree</param>
        /// <param name="trxName">transaction</param>
        public MClientInfo(MClient client, int AD_Tree_Org_ID, int AD_Tree_BPartner_ID,
                           int AD_Tree_Project_ID, int AD_Tree_SalesRegion_ID, int AD_Tree_Product_ID,
                           int AD_Tree_Campaign_ID, int AD_Tree_Activity_ID, Trx trxName) : base(client.GetCtx(), 0, trxName)
        {
            //super(client.getCtx(), 0, trxName);
            SetAD_Client_ID(client.GetAD_Client_ID());  //	to make sure
            SetAD_Org_ID(0);
            SetIsDiscountLineAmt(false);
            //
            SetAD_Tree_Menu_ID(10);             //	HARDCODED
            //
            SetAD_Tree_Org_ID(AD_Tree_Org_ID);
            SetAD_Tree_BPartner_ID(AD_Tree_BPartner_ID);
            SetAD_Tree_Project_ID(AD_Tree_Project_ID);
            SetAD_Tree_SalesRegion_ID(AD_Tree_SalesRegion_ID);
            SetAD_Tree_Product_ID(AD_Tree_Product_ID);
            SetAD_Tree_Campaign_ID(AD_Tree_Campaign_ID);
            SetAD_Tree_Activity_ID(AD_Tree_Activity_ID);
            //
            SetMatchRequirementI(MATCHREQUIREMENTI_None);
            SetMatchRequirementR(MATCHREQUIREMENTR_None);
            _createNew = true;
        }