Ejemplo n.º 1
0
 internal MachineInfo(int id, string name) : base(id, name)
 {
     c_MachineModels = null;
     c_MachineType   = null;
     c_IsAutomotive  = true;
     c_IsDisable     = false;
     c_Jobs          = null;
     c_MachineState  = null;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Class MachineInfo's constructor with datarow parameter
        /// </summary>
        /// <param name="machineInfo">Data row with specific column name [<int>Id,<string>Name,<int>MachineTypeId,<string>MachineType,<bool>IsAutomotive,<bool>IsDisable]</param>
        /// <param name="jobInfo">Data row with specific column name [<int>Id,<string>Name]</param>
        /// <param name="machineStateInfo">Data row with specific column name [<int>OnlineState,<int>RunState,<int>QcState]</param>
        internal MachineInfo(DataRow machineInfo, DataTable jobInfo, DataRow machineStateInfo) : base(machineInfo)
        {
            c_MachineModels = new MachineModelInfo(DBCONVERT.GetInt32(machineInfo, "MachineModelId"), DBCONVERT.GetString(machineInfo, "MachineModel"));
            c_MachineType   = DBCONVERT.GetString(machineInfo, "MachineType");
            c_IsAutomotive  = Convert.ToBoolean(DBCONVERT.GetByte(machineInfo, "IsAutomotive"));
            c_IsDisable     = Convert.ToBoolean(DBCONVERT.GetByte(machineInfo, "IsDisable"));
            c_Jobs          = new JobInfo[jobInfo.Rows.Count];

            if (jobInfo != null)
            {
                for (int i = 0; i < jobInfo.Rows.Count; i++)
                {
                    JobInfo c_tmps = new JobInfo(jobInfo.Rows[i]);
                    c_Jobs[i] = c_tmps;
                }
            }
            if (machineStateInfo != null)
            {
                c_MachineState = new MachineState(DBCONVERT.GetByte(machineStateInfo, "OnlineState"), DBCONVERT.GetByte(machineStateInfo, "RunState"), DBCONVERT.GetByte(machineStateInfo, "QcState"));
            }
        }