1
duhe
2023-09-18 00d2dab9f1367067b27906be93a43949beb43aa7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
namespace Kanban
{
    public partial class Sc_LEDInfoBoard : Form
    {
        public Sc_LEDInfoBoard()
        {
            InitializeComponent();
        }
        DAL.ClsSc_LEDInfoBoard dal = new DAL.ClsSc_LEDInfoBoard();
 
        //
        private void Sc_LEDInfoBoard_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
                this.Close();
            }
        }
 
        private void initGrid()
        {
            grdMain.SelectionMode = DataGridViewSelectionMode.CellSelect;        //选中模式--行选中
            grdMain.ColumnHeadersVisible = true;                                    //标题列显示--是
            grdMain.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;  //标题列尺寸模式--(自动调整,可调整)
            grdMain.RowTemplate.Height = 18;
            grdMain.RowTemplate.MinimumHeight = 18;
            grdMain.ColumnHeadersHeight = 35;          //标题行高
            grdMain.RowHeadersVisible = false;              //标题行可见--否
            grdMain.AllowUserToAddRows = false;             //是否允许自增--否
            grdMain.AllowUserToDeleteRows = false;          //是否允许删除--否
            grdMain.AllowUserToResizeColumns = true;         //允许调整列宽--是
            grdMain.AllowUserToResizeRows = false;           //允许调整行高--否
            grdMain.ReadOnly = true;                         //只读--是
            grdMain.BackgroundColor = Color.Black;
            grdMain.GridColor = Color.LightGray;
            grdMain.DefaultCellStyle.SelectionBackColor = Color.Black;
            grdMain.EnableHeadersVisualStyles = false;     //网格标题 样式
            grdMain.ColumnHeadersDefaultCellStyle.BackColor = Color.Black;
            grdMain.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            grdMain.RowTemplate.DefaultCellStyle.BackColor = Color.Black;
            grdMain.ForeColor = Color.White;
            
 
        }
 
        private void Display()
        {
            initGrid();
            //
            DataSet ds;
            ds = dal.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo);
            if (ds==null || ds.Tables[0].Rows.Count ==0)
            {
                return;
            }
            grdMain.DataSource = ds.Tables[0].DefaultView;
            DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
            string sSource = "";
            //将第一条变绿色
            for (int i = 0; i < grdMain.Rows.Count; i++)
            {
                if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[0].Value).Trim() != sSource)
                {
                    sSource = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[0].Value).Trim();
                    grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.SeaGreen;
                }
                else
                {
                    grdMain.Rows[i].DefaultCellStyle.ForeColor = Color.White;
                }
            }
            cmdDisplay.Focus();
            //
        }
 
        //刷新按钮
        private void cmdDisplay_Click(object sender, EventArgs e)
        {
            Display();
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            Display();
        }
 
        private void timer2_Tick(object sender, EventArgs e)
        {
            Display();
        }
 
        Sc_LEDInfoNote oSc_LEDInfoNote = new Sc_LEDInfoNote();
        private void cmdNote_Click(object sender, EventArgs e)
        {
            oSc_LEDInfoNote.ShowDialog();
        }
    }
}