Exemplo n.º 1
0
        public static void ShowLoggingMessageByModuleName(String strModuleName)
        {
            if (ABCLogging.LoggingDlg == null)
            {
                ABCLogging.LoggingDlg = new LoggingMessage();
            }

            DataSet ds = msgCtrl.GetAllMessageByModuleName(strModuleName);

            ABCLogging.ContentList.Clear();
            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataRow drow in ds.Tables[0].Rows)
                {
                    GELogMsgsInfo msgInfo = (GELogMsgsInfo)msgCtrl.GetObjectFromDataRow(drow);
                    if (msgInfo != null)
                    {
                        ABCLogging.ContentList.Insert(0, msgInfo);
                    }
                }
            }

            ABCLogging.LoggingDlg.RefreshMessageList();
            ABCLogging.LoggingDlg.Text = String.Format("Logging History of {0} Module ", strModuleName);
            ABCLogging.LoggingDlg.Show();
        }
Exemplo n.º 2
0
        public static void LogNewMessage(string strModuleName, String strUserName, String strAction, String strDesc, String strStatus)
        {
            try
            {
                ABCLogging.LoggingDlg.Text = String.Format("Logging History of {0} Module ", strModuleName);

                GELogMsgsInfo objGELogMsgsInfo = new GELogMsgsInfo();
                objGELogMsgsInfo.GELogMsgDate   = DateTime.Now;
                objGELogMsgsInfo.GELogMsgMdl    = strModuleName;
                objGELogMsgsInfo.GELogMsgUser   = strUserName;
                objGELogMsgsInfo.GELogMsgAction = strAction;
                objGELogMsgsInfo.GELogMsgDesc   = strDesc;
                objGELogMsgsInfo.GELogMsgStatus = strStatus;

                if (ABCLogging.IsLogToDatabase)
                {
                    objGELogMsgsInfo.GELogMsgID = msgCtrl.CreateObject(objGELogMsgsInfo);
                }

                ContentList.Add(objGELogMsgsInfo);
                if (ABCLogging.ContentList.Count > 0)
                {
                    if (ABCLogging.LoggingDlg == null)
                    {
                        ABCLogging.LoggingDlg = new LoggingMessage();
                    }

                    ABCLogging.LoggingDlg.RefreshMessageList();
                    ABCLogging.LoggingDlg.TopMost  = true;
                    ABCLogging.LoggingDlg.Location = new System.Drawing.Point(200, 200);
                    ABCLogging.LoggingDlg.Show();
                }
            }
            catch (Exception ex)
            {
                if (ABCLogging.LoggingDlg != null)
                {
                    ABCLogging.LoggingDlg.Dispose();
                }
            }
            Application.DoEvents();
        }