/// <summary>
        ///	Get Message
        /// </summary>
        /// <returns>message</returns>
        public string GetMessage()
        {
            int      AD_Message_ID = GetAD_Message_ID();
            MMessage msg           = MMessage.Get(GetCtx(), AD_Message_ID);

            return(msg.GetMsgText());
        }
示例#2
0
        /// <summary>
        /// Get Message (cached)
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="Value">message value</param>
        /// <returns>message</returns>
        public static MMessage Get(Ctx ctx, string value)
        {
            if (value == null || value.Length == 0)
            {
                return(null);
            }
            MMessage retValue = (MMessage)_cache[value];

            if (retValue == null)
            {
                string  sql = "SELECT * FROM AD_Message WHERE Value='" + value + "'";
                DataSet ds  = null;
                try
                {
                    ds = DataBase.DB.ExecuteDataset(sql, null, null);
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        DataRow dr = ds.Tables[0].Rows[i];
                        retValue = new MMessage(ctx, dr, null);
                    }
                    ds = null;
                }
                catch (Exception e)
                {
                    _log.Log(Level.SEVERE, "get", e);
                }

                if (retValue != null)
                {
                    _cache.Add(value, retValue);
                }
            }
            return(retValue);
        }
 /// <summary>
 /// New Constructor
 /// </summary>
 /// <param name="ctx">context</param>
 /// <param name="AD_MessageValue">message</param>
 /// <param name="AD_User_ID">targeteduser</param>
 /// <param name="AD_Client_ID">client</param>
 /// <param name="AD_Org_ID">org</param>
 /// <param name="trxName">transaction</param>
 public MNote(Ctx ctx, string AD_MessageValue, int AD_User_ID,
              int AD_Client_ID, int AD_Org_ID, Trx trxName)
     : this(ctx, MMessage.GetAD_Message_ID(ctx, AD_MessageValue), AD_User_ID, trxName)
 {
     SetClientOrg(AD_Client_ID, AD_Org_ID);
     // changes done by Bharat on 22 May 2018 to set Organization to * on Notification as discussed with Mukesh Sir.
     SetAD_Org_ID(0);
 }
示例#4
0
        /// <summary>
        ///Get Message ID (cached)
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="Value">message value</param>
        /// <returns>AD_Message_ID</returns>
        public static int GetAD_Message_ID(Ctx ctx, string value)
        {
            MMessage msg = Get(ctx, value);

            if (msg == null)
            {
                return(0);
            }
            return(msg.GetAD_Message_ID());
        }
 /// <summary>
 ///	Set AD_Message_ID.
 ///	Looks up No Message Found if 0
 /// </summary>
 /// <param name="AD_Message_ID">id</param>
 public new void SetAD_Message_ID(int AD_Message_ID)
 {
     if (AD_Message_ID == 0)
     {
         base.SetAD_Message_ID(MMessage.GetAD_Message_ID(GetCtx(), "NoMessageFound"));
     }
     else
     {
         base.SetAD_Message_ID(AD_Message_ID);
     }
 }
示例#6
0
        /// <summary>
        ///Get Message (cached)
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="AD_Message_ID">id</param>
        /// <returns>message</returns>
        public static MMessage Get(Ctx ctx, int AD_Message_ID)
        {
            string   key      = AD_Message_ID.ToString();
            MMessage retValue = (MMessage)_cache[key];

            if (retValue == null)
            {
                retValue = new MMessage(ctx, AD_Message_ID, null);
                _cache.Add(key, retValue);
            }
            return(retValue);
        }
示例#7
0
 /// <summary>
 /// New Mandatory Constructor
 /// </summary>
 /// <param name="ctx">context</param>
 /// <param name="AD_MessageValue">message</param>
 /// <param name="AD_User_ID">targeted user</param>
 /// <param name="trxName">transaction</param>
 public MNote(Ctx ctx, string AD_MessageValue, int AD_User_ID, Trx trxName)
     : this(ctx, MMessage.GetAD_Message_ID(ctx, AD_MessageValue), AD_User_ID, trxName)
 {
 }
示例#8
0
 /// <summary>
 /// New Constructor
 /// </summary>
 /// <param name="ctx">context</param>
 /// <param name="AD_MessageValue">message</param>
 /// <param name="AD_User_ID">targeteduser</param>
 /// <param name="AD_Client_ID">client</param>
 /// <param name="AD_Org_ID">org</param>
 /// <param name="trxName">transaction</param>
 public MNote(Ctx ctx, string AD_MessageValue, int AD_User_ID,
              int AD_Client_ID, int AD_Org_ID, Trx trxName)
     : this(ctx, MMessage.GetAD_Message_ID(ctx, AD_MessageValue), AD_User_ID, trxName)
 {
     SetClientOrg(AD_Client_ID, AD_Org_ID);
 }