| | |
| | | using Yw; |
| | | using Yw.WinFrmUI; |
| | | |
| | | |
| | | namespace IBox.WinFrmUI |
| | | { |
| | | public partial class IBoxFormLog : DocumentPage |
| | | { |
| | | |
| | | |
| | | public IBoxFormLog() |
| | | { |
| | | this.PageTitle.Caption = "日志管理"; |
| | |
| | | public void HideButton() |
| | | { |
| | | //simpleButton1.Visible = simpleButton2.Visible = false; |
| | | layoutControlItem2.Visibility = layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | /*layoutControlItem2.Visibility =*/ |
| | | layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | } |
| | | |
| | | private void EboxFormLog_Load(object sender, EventArgs e) |
| | |
| | | |
| | | imageComboBoxEdit1.SelectedIndex = 0; |
| | | imageComboBoxEdit2.SelectedIndex = 0; |
| | | |
| | | } |
| | | |
| | | public event EventHandler<string> SendData; |
| | | |
| | | private void SendText(string content) |
| | | { |
| | | if (SendData != null) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var model = JsonHelper.Json2Object<List<IBoxLogViewModel>>(result); |
| | | BindData(model,false); |
| | | BindData(model, false); |
| | | } |
| | | break; |
| | | } |
| | |
| | | |
| | | private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) |
| | | { |
| | | |
| | | if (e.Column.FieldName == "LogResult") |
| | | { |
| | | var celValue = e.CellValue.ToString(); |
| | |
| | | celNewValue = "提示"; |
| | | e.Appearance.ForeColor = Color.Blue; |
| | | break; |
| | | |
| | | case "fail": |
| | | celNewValue = "失败"; |
| | | e.Appearance.ForeColor = Color.Coral; |
| | | break; |
| | | |
| | | case "error": |
| | | celNewValue = "异常"; |
| | | e.Appearance.ForeColor = Color.Red; |
| | | break; |
| | | |
| | | default: |
| | | celNewValue = "成功"; |
| | | e.Appearance.ForeColor = Color.Green; |
| | |
| | | |
| | | private Dictionary<string, string> GetDic() |
| | | { |
| | | |
| | | return new Dictionary<string, string> |
| | | { |
| | | { "controll", "智能控制" }, |
| | |
| | | { "datadocking", "数据采集" }, |
| | | }; |
| | | } |
| | | |
| | | private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) |
| | | { |
| | | if (e.Column.FieldName == "LogEvent") |
| | |
| | | case "info": |
| | | celNewValue = "提示"; |
| | | break; |
| | | |
| | | case "fail": |
| | | celNewValue = "失败"; |
| | | break; |
| | | |
| | | case "error": |
| | | celNewValue = "异常"; |
| | | break; |
| | | |
| | | default: |
| | | celNewValue = "成功"; |
| | | break; |
| | | } |
| | | e.DisplayText = celNewValue; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |