Example #1
0
        /// <summary>
        /// 绑定管控代码
        /// </summary>
        /// <param name="locationkey"></param>
        /// <param name="stepkey"></param>
        private void BindContralPlan(string locationkey, string stepkey)
        {
            DataSet   ds = spcEntity.GetSPControlGridData();
            DataTable dt = new DataTable();

            dt = ds.Tables[0].Clone();
            string sql = string.Empty;

            if (!string.IsNullOrEmpty(stepkey) && !string.IsNullOrEmpty(locationkey))
            {
                sql += string.Format("WERKS='{0}' AND STEP_KEY='{1}'", locationkey, stepkey);
            }
            else
            {
                if (!string.IsNullOrEmpty(locationkey))
                {
                    sql += string.Format("WERKS='{0}'", locationkey);
                }

                if (!string.IsNullOrEmpty(stepkey))
                {
                    sql += string.Format("STEP_KEY='{0}'", stepkey);
                }
            }

            DataRow[] drs = ds.Tables[0].Select(string.Format("{0}", sql));
            foreach (DataRow dr in drs)
            {
                dt.ImportRow(dr);
            }
            lueControlCode.Properties.DisplayMember = SPC_CONTROL_PLAN_FIELD.FIELD_CONTROLCODE;
            lueControlCode.Properties.ValueMember   = SPC_CONTROL_PLAN_FIELD.FIELD_CONTROLPLANID;
            lueControlCode.Properties.DataSource    = dt;
        }
Example #2
0
 private void gvBind()
 {
     _dtCommon = null;
     _dtCommon = _spcEntity.GetSPControlGridData().Tables[0];
 }