public config_equipment_model() { DBUtil dBUtil; string strSql = string.Empty; List <CDBContainer> Temp = new List <CDBContainer>(); Dictionary <string, object> keyValues = new Dictionary <string, object>(); try { dBUtil = new DBUtil(); strSql = "select * from config_equipment_model where equipment_model_id = @equipment_model_id"; keyValues.Add("@equipment_model_id", SANWA.Utility.Config.SystemConfig.Get().SystemMode); Temp = dBUtil.GetDataList(DBUtil.QueryContainer.DBEquipmentModel, strSql, keyValues).ToList(); if (Temp.Count == 0) { string msg = "[NO_DATA_FOUND] Table: config_equipment_model , Equipment_model_id: " + SANWA.Utility.Config.SystemConfig.Get().SystemMode; logger.Error(msg); //throw new Exception("This statement is the read config exception message."); throw new Exception(msg); } else { EquipmentModel = ((DBEquipmentModel)Temp[0]); } } catch (Exception ex) { logger.Error(ex.StackTrace, ex); throw new Exception(ex.ToString()); } }
public config_controllers() { DBUtil dBUtil; string strSql = string.Empty; List <CDBContainer> Temp = new List <CDBContainer>(); try { dBUtil = new DBUtil(); strSql = "select * from config_controller order by node_id asc "; Temp = dBUtil.GetDataList(DBUtil.QueryContainer.DBController, strSql, null).ToList(); if (Temp.Count == 0) { throw new Exception("This statement is the read config exception message."); } foreach (var item in Temp) { switch (((DBController)item).Node_id.ToString()) { case "Aligner01": Aligner01 = ((DBController)item); break; case "Aligner02": Aligner02 = ((DBController)item); break; case "LoadPort01": LoadPort01 = ((DBController)item); break; case "LoadPort02": LoadPort02 = ((DBController)item); break; case "LoadPort03": LoadPort03 = ((DBController)item); break; case "LoadPort04": LoadPort04 = ((DBController)item); break; case "LoadPort05": LoadPort05 = ((DBController)item); break; case "LoadPort06": LoadPort06 = ((DBController)item); break; case "LoadPort07": LoadPort07 = ((DBController)item); break; case "LoadPort08": LoadPort08 = ((DBController)item); break; case "Robot01": Robot01 = ((DBController)item); break; case "Robot02": Robot02 = ((DBController)item); break; case "OCR01": OCR01 = ((DBController)item); break; case "OCR02": OCR02 = ((DBController)item); break; } } } catch (Exception ex) { throw new Exception(ex.ToString()); } }