Beispiel #1
0
        private void lueControlCode_EditValueChanged(object sender, EventArgs e)
        {
            DataRow dr = dtControlPlan.Select(string.Format(@"CONTROLPLANID='{0}'", lueControlCode.EditValue.ToString()))[0];

            if (dr == null)
            {
                return;
            }

            betEquipment.Text = string.Empty;
            equipmentKeys     = string.Empty;
            string locationKey = string.Empty, stepKey = string.Empty;

            chartType = dr[SPC_CONTROL_PLAN_FIELD.FIELD_CONTROLTYPE].ToString();
            string strAnormalIDs = dr[SPC_CONTROL_PLAN_FIELD.FIELD_ABNORMALIDS].ToString();

            locationKey = dr[SPC_CONTROL_PLAN_FIELD.FIELD_WERKS].ToString();
            stepKey     = dr[SPC_CONTROL_PLAN_FIELD.FIELD_STEP_KEY].ToString();

            this.layoutControlItem12.Visibility = LayoutVisibility.Never;
            this.layoutControlItem7.Visibility  = LayoutVisibility.Never;

            string s = string.Empty;

            if (strAnormalIDs.Length > 0)
            {
                foreach (string str in strAnormalIDs.Split(','))
                {
                    s += "'" + str + "',";
                }

                if (string.IsNullOrEmpty(s))
                {
                    return;
                }
                s = s.TrimEnd(',');
            }
            try
            {
                DataTable dt01 = spcEntity.GetAbnormalRule().Tables[EDC_ABNORMAL_FIELDS.DATABASE_TABLE_NAME];
                string    s01  = string.Format(EDC_ABNORMAL_FIELDS.FIELD_ARULECODE + " IN ({0})", s);
                DataView  dv   = dt01.DefaultView;
                dv.RowFilter = s01;
                DataTable dt02 = dv.ToTable();
                cklRules.DataSource    = dt02;
                cklRules.DisplayMember = EDC_ABNORMAL_FIELDS.FIELD_ARULECODE;
                cklRules.ValueMember   = EDC_ABNORMAL_FIELDS.FIELD_ABNORMALID;
                cklRules.Enabled       = true;

                for (int i = 0; i < cklRules.Items.Count; i++)
                {
                    cklRules.Items[i].CheckState = CheckState.Checked;
                }

                cklRules.CheckAll();
            }
            catch //(Exception ex)
            { }
        }
Beispiel #2
0
        private void InitialData()
        {
            try
            {
                DataSet dataSet = spcEntity.GetAbnormalRule();

                if (spcEntity.ErrorMsg.Length > 0)
                {
                    MessageService.ShowError("get spc AbnormalRule error:" + spcEntity.ErrorMsg);
                }
                else
                {
                    DataTable dtMain = dataSet.Tables[EDC_ABNORMAL_FIELDS.DATABASE_TABLE_NAME];
                    dtMain.Columns.Add("isSelected", typeof(bool));

                    gridView1.Columns[EDC_ABNORMAL_FIELDS.FIELD_ABNORMALCOLOR].Visible = false;

                    if (dataSet != null && dataSet.Tables.Count > 0 && dataSet.Tables.Contains(EDC_ABNORMAL_FIELDS.DATABASE_TABLE_NAME))
                    {
                        this.gcMainAbnormal.DataSource = null;
                        this.gcMainAbnormal.DataSource = dataSet.Relations[0].ParentTable;

                        for (int i = 0; i < gridView1.DataRowCount; i++)
                        {
                            string _code = gridView1.GetRowCellValue(i, EDC_ABNORMAL_FIELDS.FIELD_ARULECODE).ToString();
                            if (lst.Contains(_code))
                            {
                                gridView1.SetRowCellValue(i, "isSelected", true);
                            }
                        }

                        if (!isAddColorField)
                        {
                            GridColumn unboundColumn = gridView1.Columns.AddField("Color");
                            unboundColumn.VisibleIndex = gridView1.Columns.Count;
                            unboundColumn.UnboundType  = DevExpress.Data.UnboundColumnType.Object;
                            RepositoryItemColorEdit ce = new RepositoryItemColorEdit();
                            ce.ShowCustomColors      = false;
                            unboundColumn.ColumnEdit = ce;
                            isAddColorField          = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(ex.Message);
            }
        }
Beispiel #3
0
        private void BindGv()
        {
            DataSet dataSet = spcEntity.GetAbnormalRule();

            InitialData(dataSet);
        }