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(); 
 | 
        } 
 | 
    } 
 | 
} 
 |