Ejemplo n.º 1
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            //分档代码,分档规则,功率上下线,是否存在子分档
            Hashtable hashTable = new Hashtable();

            if (!string.IsNullOrEmpty(teProPowerSetCode.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_PS_CODE] = teProPowerSetCode.Text.Trim();
            }
            if (!string.IsNullOrEmpty(teProPowerSetRule.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_PS_RULE] = teProPowerSetRule.Text.Trim();
            }

            DataSet dsDataBind = _powerSetEntity.GetPowerSetData(hashTable);

            if (_powerSetEntity.ErrorMsg.Equals(string.Empty))
            {
                _dtPowerSet              = dsDataBind.Tables[BASE_POWERSET.DATABASE_TABLE_NAME];
                _dtPowerSetSub           = dsDataBind.Tables[BASE_POWERSET_DETAIL.DATABASE_TABLE_NAME];
                _dtPowerSetColor         = dsDataBind.Tables[BASE_POWERSET_COLORATCNO.DATABASE_TABLE_NAME];
                gcProPowerSet.DataSource = _dtPowerSet;
            }
        }
Ejemplo n.º 2
0
        private void InitDataBind()
        {
            //分档代码,分档规则,功率上下线,是否存在子分档
            Hashtable hashTable = new Hashtable();

            if (!string.IsNullOrEmpty(txtPs_code.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_PS_CODE] = txtPs_code.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtPs_rule.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_PS_RULE] = txtPs_rule.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtPowerStart.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_P_MIN] = txtPowerStart.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtPowerEnd.Text.Trim()))
            {
                hashTable[BASE_POWERSET.FIELDS_P_MAX] = txtPowerEnd.Text.Trim();
            }
            if (chkLevel.Checked)
            {
                hashTable[BASE_POWERSET.FIELDS_SUB_PS_WAY] = "NULL";
            }


            DataSet dsDataBind = _powerSetEntity.GetPowerSetData(hashTable);

            if (_powerSetEntity.ErrorMsg.Equals(string.Empty))
            {
                dtPowerSetDtl                 = dsDataBind.Tables[BASE_POWERSET_DETAIL.DATABASE_TABLE_NAME];
                gcPowerSetDtl.DataSource      = null;
                dtPowerSetColorDtl            = dsDataBind.Tables[BASE_POWERSET_COLORATCNO.DATABASE_TABLE_NAME];
                gcPowerSetColorDtl.DataSource = null;

                dtPowerSet = dsDataBind.Tables[BASE_POWERSET.DATABASE_TABLE_NAME];
                this.gcPowerSet.MainView   = gvPowerSet;
                this.gcPowerSet.DataSource = dtPowerSet;
                this.gvPowerSet.BestFitColumns();

                if (!string.IsNullOrEmpty(_loadKey))
                {
                    for (int i = 0; i < gvPowerSet.RowCount; i++)
                    {
                        string sk = Convert.ToString(((DataRowView)(this.gvPowerSet.GetRow(i))).Row[BASE_POWERSET.FIELDS_POWERSET_KEY]);
                        if (_loadKey.Equals(sk.Trim()))
                        {
                            this.gvPowerSet.FocusedRowHandle = i;
                            break;
                        }
                    }
                }

                BindGvPowerSetDtl();
                BindGvPowerSetColorDtl();
            }
            else
            {
                MessageService.ShowMessage(_powerSetEntity.ErrorMsg);
            }
        }