Esempio n. 1
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
 /// <summary>
 ///
 /// </summary>
 /// <param name="client"></param>
 /// <param name="currency"></param>
 public MAcctSchema(MClient client, KeyNamePair currency)
     : this(client.GetCtx(), 0, client.Get_TrxName())
 {
     SetClientOrg(client);
     SetC_Currency_ID(currency.GetKey());
     SetName(client.GetName() + " " + GetGAAP() + "/" + Get_ColumnCount() + " " + currency.GetName());
 }       //	MAcctSchema
Esempio n. 3
0
 /// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="client">parent</param>
 /// <param name="Supervisor_ID">admin</param>
 public MAcctProcessor(MClient client, int Supervisor_ID)
     : this(client.GetCtx(), 0, client.Get_TrxName())
 {
     SetClientOrg(client);
     SetName(client.GetName() + " - "
             + Msg.Translate(GetCtx(), "C_AcctProcessor_ID"));
     SetSupervisor_ID(Supervisor_ID);
 }
 /// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="Supervisor_ID"></param>
 public MRequestProcessor(MClient parent, int Supervisor_ID)
     : this(parent.GetCtx(), 0, parent.Get_TrxName())
 {
     SetClientOrg(parent);
     SetName(parent.GetName() + " - "
             + Msg.Translate(GetCtx(), "R_RequestProcessor_ID"));
     SetSupervisor_ID(Supervisor_ID);
 }
Esempio n. 5
0
 /// <summary>
 ///Full Constructor
 /// </summary>
 /// <param name="client">client</param>
 /// <param name="Name">name</param>
 /// <param name="ElementType">type</param>
 /// <param name="AD_Tree_ID">tree</param>
 public MElement(MClient client, string name, string elementType, int AD_Tree_ID)
     : this(client.GetCtx(), 0, client.Get_TrxName())
 {
     SetClientOrg(client);
     SetName(name);
     SetElementType(elementType);        // A
     SetAD_Tree_ID(AD_Tree_ID);
     SetIsNaturalAccount(ELEMENTTYPE_Account.Equals(elementType));
 }
Esempio n. 6
0
 /// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="client">parent</param>
 public MCalendar(MClient client)
     : base(client.GetCtx(), 0, client.Get_TrxName())
 {
     SetClientOrg(client);
     SetName(client.GetName() + " " + Utility.Msg.Translate(client.GetCtx(), "C_Calendar_ID"));
 }