/// <summary> /// 根据抽检点设置变化变更车间和设备,车间的设备和这个抽检点的设备 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void luePoint_EditValueChanged(object sender, EventArgs e) { //1.按照车间绑定所有设备,group_Key ,equipment_key //2.如果,equipment_key有值则直接用需加车间,没有就根据group_key和车间 string strFactoryRoom = PropertyService.Get(PROPERTY_FIELDS.FACTORY_CODE); //strFactoryRoom = "C3C1"; EdcQuery edcQuery = new EdcQuery(); string equipmentKey = this.luePoint.GetColumnValue("EQUIPMENT_KEY").ToString(); string groupKey = this.luePoint.GetColumnValue("GROUP_KEY").ToString(); DataSet dsEMS = edcQuery.SearchEMS(strFactoryRoom, groupKey, equipmentKey); lueEqp.Properties.DataSource = dsEMS.Tables[0]; lueEqp.Properties.ValueMember = "EQUIPMENT_KEY"; lueEqp.Properties.DisplayMember = "EQUIPMENT_NAME"; // 3.根据选择的DEC_key获取 string edcKey = this.luePoint.GetColumnValue("EDC_KEY").ToString(); DataSet dsParma = edcQuery.SearchParam(edcKey); lueParam.Properties.DataSource = dsParma.Tables[0]; lueParam.Properties.ValueMember = "PARAM_KEY"; lueParam.Properties.DisplayMember = "PARAM_NAME"; }
/// <summary> /// 绑定所有抽检参数 /// </summary> private void BingEdcParam() { DataSet ds = new DataSet(); EdcQuery edcQuery = new EdcQuery(); ds = edcQuery.SearchParam(); lueParam.Properties.DataSource = ds.Tables[0]; lueParam.Properties.ValueMember = "PARAM_KEY"; lueParam.Properties.DisplayMember = "PARAM_NAME"; }
/// <summary> /// 所有抽检点 /// </summary> private void BingEdcPoint() { DataSet ds = new DataSet(); EdcQuery edcQuery = new EdcQuery(); ds = edcQuery.SearchEdcPoint(); //查询抽检点 luePoint.Properties.DataSource = ds.Tables[0]; luePoint.Properties.ValueMember = "GROUP_KEY"; luePoint.Properties.DisplayMember = "EDC_NAME"; }
/// <summary> /// 按照车间绑定所有设备 /// </summary> private void BingEdcEMS() { //车间 string strFactoryRoom = PropertyService.Get(PROPERTY_FIELDS.FACTORY_CODE); //strFactoryRoom="C3C1"; DataSet ds = new DataSet(); EdcQuery edcQuery = new EdcQuery(); ds = edcQuery.SearchEMS(strFactoryRoom); lueEqp.Properties.DataSource = ds.Tables[0]; lueEqp.Properties.ValueMember = "EQUIPMENT_KEY"; lueEqp.Properties.DisplayMember = "EQUIPMENT_NAME"; }
/// <summary> /// 根据条件查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbQuery_Click(object sender, EventArgs e) { Hashtable hashTable = new Hashtable(); if (luePoint.Text == string.Empty) { MessageBox.Show("请选择抽检抽点"); return; } string rowKey = this.luePoint.GetColumnValue("ROW_KEY").ToString(); //时间 hashTable.Add("ROW_KEY", rowKey); if (!string.IsNullOrEmpty(deStartDate.Text)) { hashTable.Add("START_DATE", deStartDate.Text); } if (!string.IsNullOrEmpty(deStartDate.Text)) { hashTable.Add("END_DATE", deEndDate.Text); } if (!string.IsNullOrEmpty(lueEqp.Text)) { hashTable.Add("EQUIPMENT_NAME", lueEqp.Text); } if (!string.IsNullOrEmpty(lueParam.Text)) { hashTable.Add("PARAM_NAME", lueParam.Text); } DataTable dtParams = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(hashTable); EdcQuery edcQuery = new EdcQuery(); DataSet ds = edcQuery.EDCValueQuery(dtParams); gcPointValue.MainView = gvPointValue; gcPointValue.DataSource = ds.Tables[0]; gvPointValue.BestFitColumns(); }