Пример #1
0
        private void ReadErrorStates()
        {
            try
            {
                string start = txt_startdate.Text;
                string end   = Convert.ToDateTime(txt_enddate.Text).AddDays(1).ToShortDateString();

                DataTable ErrorStateTable = StatusInfoHelper.getErrorStateByMachine(start, end);

                if (ErrorStateTable != null)
                {
                    for (int i = 0; i < ErrorStateTable.Rows.Count; i++)
                    {
                        DataRow row = ErrorStateTable.Rows[i];
                        ErrorStateTable.Rows[i].BeginEdit();

                        if (row["ERROR_STATE"].ToString() == "1")
                        {
                            ErrorStateTable.Rows[i]["ERROR_STATE"] = "N";
                        }
                        else
                        {
                            ErrorStateTable.Rows[i]["ERROR_STATE"] = "Y";
                        }

                        ErrorStateTable.Rows[i].EndEdit();
                    }
                    gridControl1.DataSource = ErrorStateTable;
                }
            }
            catch { }
        }
Пример #2
0
        private void ReadErrorStates()
        {
            try
            {
                string[]  MachinCodes;
                DataTable ErrorMachinesTable = StatusInfoHelper.getErrorMachineCount();
                if (ErrorMachinesTable.Rows.Count > 0)
                {
                    int RowCount = ErrorMachinesTable.Rows.Count;
                    MachinCodes = new string[RowCount];
                    for (int i = 0; i < RowCount; i++)
                    {
                        DataRow row = ErrorMachinesTable.Rows[i];
                        MachinCodes[i] = Convert.ToString(row["MACHINE_CODE"]);
                    }

                    string    today           = DateTime.Today.ToShortDateString();
                    DataTable ErrorStateTable = StatusInfoHelper.getErrorStateByMachine(MachinCodes, today);

                    if (ErrorStateTable != null)
                    {
                        gridControl1.DataSource = ErrorStateTable;
                    }
                }
                else
                {
                    //발생된 에러가 없을 때
                }
            }
            catch { }
        }