Example #1
0
        private void DMButton_Search_Click(object sender, RoutedEventArgs e)
        {
            runLogBase.RunLogList.Clear();
            List <WMS_Log_Model> list = new List <WMS_Log_Model>();
            DataTable            dt   = WMS_Log_Bll.Select_Log(" LogType = 'run' and LogTime like '%"
                                                               + SearchText_Time.Text + "%' and LogLocation like '%" + SearchText_Location.Text
                                                               + "%' and LogMessage like '%" + SearchText_Message.Text + "%' and LogLevel like '%"
                                                               + SearchText_Level.Text + "%'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Log_Model wMS_SysLog_Model = new WMS_Log_Model
                {
                    LogTime     = dt.Rows[i]["LogTime"].ToString(),
                    LogType     = dt.Rows[i]["LogType"].ToString(),
                    LogLocation = dt.Rows[i]["LogLocation"].ToString(),
                    LogMessage  = dt.Rows[i]["LogMessage"].ToString(),
                    LogLevel    = int.Parse(dt.Rows[i]["LogLevel"].ToString())
                };
                list.Add(wMS_SysLog_Model);
            }
            foreach (var model in list)
            {
                runLogBase.RunLogList.Add(model);
            }
            this.RunLogDataGrid.ItemsSource = runLogBase.RunLogList;
        }
Example #2
0
 /// <summary>
 /// 日志更新
 /// </summary>
 /// <param name="wMS_Log_Model"></param>
 /// <param name="condition"></param>
 /// <returns></returns>
 public static int Update_Log(WMS_Log_Model wMS_Log_Model, string condition)
 {
     using (var con = GetOpenConnection())
     {
         return(con.Execute(WMS_Log_Dal.Update_Log(wMS_Log_Model, condition)));
     }
 }
Example #3
0
 /// <summary>
 /// 日志插入
 /// </summary>
 /// <param name="wMS_Log_Model"></param>
 /// <returns></returns>
 public static int Inseert_Log(WMS_Log_Model wMS_Log_Model)
 {
     using (var con = GetOpenConnection())
     {
         return(con.Execute(WMS_Log_Dal.Inseert_Log(wMS_Log_Model)));
     }
 }
Example #4
0
        /// <summary>
        /// 日志插入
        /// </summary>
        /// <param name="wMS_Log_Model"></param>
        /// <returns></returns>
        public static string Inseert_Log(WMS_Log_Model wMS_Log_Model)
        {
            string _insertSql = "INSERT INTO [WMS].[dbo].[WMS_Log]"
                                + "([LogTime],[LogType],[LogLocation],[LogMessage],[LogLevel])"
                                + "VALUES('" + wMS_Log_Model.LogTime + "','" + wMS_Log_Model.LogType
                                + "','" + wMS_Log_Model.LogLocation + "','" + wMS_Log_Model.LogMessage
                                + "'," + wMS_Log_Model.LogLevel + ")";

            return(_insertSql);
        }
Example #5
0
        /// <summary>
        /// 日志更新
        /// </summary>
        /// <param name="wMS_Log_Model"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public static string Update_Log(WMS_Log_Model wMS_Log_Model, string condition)
        {
            string _updateSql = "UPDATE [WMS].[dbo].[WMS_Log]"
                                + "SET[LogTime] = '" + wMS_Log_Model.LogTime + "',[LogType] = '"
                                + wMS_Log_Model.LogType + "',[LogLocation] = '"
                                + wMS_Log_Model.LogLocation + "',[LogMessage] = '"
                                + wMS_Log_Model.LogMessage + "',[LogLevel] = "
                                + wMS_Log_Model.LogLevel + " WHERE " + condition;

            return(_updateSql);
        }
Example #6
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public static List <WMS_Log_Model> GetErrorLogList()
        {
            List <WMS_Log_Model> list = new List <WMS_Log_Model>();
            DataTable            dt   = WMS_Log_Bll.Select_Log(" LogType = 'run' and LogLevel = 2");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Log_Model wms_Log_Model = new WMS_Log_Model
                {
                    LogType     = dt.Rows[i]["LogType"].ToString(),
                    LogLocation = dt.Rows[i]["LogLocation"].ToString(),
                    LogMessage  = dt.Rows[i]["LogMessage"].ToString()
                };
                list.Add(wms_Log_Model);
            }
            return(list);
        }
Example #7
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public static List <WMS_Log_Model> GetLoginLogList()
        {
            List <WMS_Log_Model> list = new List <WMS_Log_Model>();
            DataTable            dt   = WMS_Log_Bll.Select_Log(" LogType = 'login'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Log_Model wms_Log_Model = new WMS_Log_Model
                {
                    LogTime     = dt.Rows[i]["LogTime"].ToString(),
                    LogType     = dt.Rows[i]["LogType"].ToString(),
                    LogLocation = dt.Rows[i]["LogLocation"].ToString(),
                    LogMessage  = dt.Rows[i]["LogMessage"].ToString(),
                    LogLevel    = int.Parse(dt.Rows[i]["LogLevel"].ToString())
                };
                list.Add(wms_Log_Model);
            }
            return(list);
        }
Example #8
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public static List <WMS_Log_Model> GetRunLogList()
        {
            List <WMS_Log_Model> list    = new List <WMS_Log_Model>();
            DataTable            totalDt = WMS_Log_Bll.Select_Log(" LogType = 'run'");

            totalPages = totalDt.Rows.Count % sizePage == 0 ? (totalDt.Rows.Count / sizePage) : (totalDt.Rows.Count / sizePage) + 1;

            DataTable dt = PagerHelper.PagerTable(page, sizePage, showColumn, tabName, strCondition, ascColumn, bitOrderType, pkColumn);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Log_Model wms_Log_Model = new WMS_Log_Model
                {
                    LogID       = int.Parse(dt.Rows[i]["LogID"].ToString()),
                    LogTime     = dt.Rows[i]["LogTime"].ToString(),
                    LogType     = dt.Rows[i]["LogType"].ToString(),
                    LogLocation = dt.Rows[i]["LogLocation"].ToString(),
                    LogMessage  = dt.Rows[i]["LogMessage"].ToString(),
                    LogLevel    = int.Parse(dt.Rows[i]["LogLevel"].ToString())
                };
                list.Add(wms_Log_Model);
            }
            return(list);
        }