Ejemplo n.º 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 { }
        }
Ejemplo n.º 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 { }
        }
 private void InitFirstMachine()
 {
     //초기 검색할 사출기 설정
     string[] MachineInfo = new string[2];
     MachineInfo      = StatusInfoHelper.getInitMachine();
     txt_machine.Tag  = MachineInfo[0]; // MACHINE_CODE
     txt_machine.Text = MachineInfo[1]; // MACHINE_NAME
 }
 private void ReadInjectStates()
 {
     try
     {
         string    MachineCode = Convert.ToString(txt_machine.Tag);
         string    start       = Convert.ToString(txt_startdate.Text);
         string    end         = Convert.ToString(txt_enddate.Text);
         DataTable StateTable  = StatusInfoHelper.getMachineState(MachineCode, start, end);
         gridControl1.DataSource = StateTable;
     }
     catch { }
 }