Esempio n. 1
0
        private void BtnEditCommonPro_Click(object sender, EventArgs e)
        {
            bool isSelectRecord = true;

            if (this.dGVCommonProperties.RowCount <= 0)
            {
                isSelectRecord = false;
            }
            int rowIndex = this.dGVCommonProperties.CurrentRow.Index;

            if (rowIndex < 0)
            {
                isSelectRecord = false;
            }
            if (!isSelectRecord)
            {
                MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }

            PDM_Params temp = new PDM_Params();

            temp.MASTER_TABLE_NAME = "ALL";
            temp.PARAMS_DATA_TYPE  = this.dGVCommonProperties.CurrentRow.Cells["PARAMS_DATA_TYPE"].Value.ToString();
            temp.PARAMS_NAME       = this.dGVCommonProperties.CurrentRow.Cells["PARAMS_NAME"].Value.ToString();


            FrmAddNewProperties addpro = new FrmAddNewProperties(temp);

            if (addpro.ShowDialog() == DialogResult.OK)
            {
                sys.NewInstance.UpdateExtPro(temp, addpro.M_PDM_Params);
                this.dGVCommonProperties.DataSource = sys.NewInstance.GetDataTableForParams(DataType.RelationObjectType.ALL);
            }
        }
Esempio n. 2
0
        private void SaveColumnAndValue(PDM_Params p_params, String p_ProValue)
        {
            try {
                p_params.Save();
            }catch (Exception e1) {
                MessageBox.Show("添加属性失败!" + e1.Message);
            }

            /*
             *   StringBuilder values = new StringBuilder();
             *   values.Append(" '").Append(p_params.PARAMS_NAME).Append("','");
             *   values.Append(p_params.PARAMS_DATA_TYPE).Append("','");
             *   values.Append(p_params.TARGET_COLNAME).Append("','");
             *   values.Append(p_params.MASTER_TABLE_NAME).Append("'");
             *   String columns = "PARAMS_NAME,PARAMS_DATA_TYPE,TARGET_COLNAME,MASTER_TABLE_NAME";
             *   ObjectParams.SaveParamBySql(columns, values.ToString(), "PDM_Params");
             */
            TextBox t = new TextBox();

            t.Tag  = p_params.TARGET_COLNAME;
            t.Text = p_ProValue;
            textBoxList.Add(t);

            InsertOrUpDateExtPro();

            /*if (!isHaveValue)
             * {
             *  InsertExtPro();
             * }
             * else
             * {
             *  UpDateExtPro();
             * }*/
            MessageBox.Show("添加属性成功");
        }
Esempio n. 3
0
        //添加新属性按钮
        private void btnAddNewParams_Click(object sender, EventArgs e)
        {
            if (this.maxcolumns >= 30)
            {
                MessageBox.Show("最多只能添加30个属性");
                return;
            }

            FrmAddNewParams frmNew = new FrmAddNewParams(tableName, labelList);

            if (frmNew.ShowDialog() == DialogResult.OK)
            {
                PDM_Params t_params = frmNew.M_PDM_Params;

                maxcolumns = GetMaxCountForProperties();
                if (maxcolumns >= 30)
                {
                    MessageBox.Show("最多只能添加30个属性");
                    return;
                }
                t_params.TARGET_COLNAME = "C" + (maxcolumns + 1);
                SaveColumnAndValue(t_params, frmNew.M_ProValue);

                CreateParams(pnlIsHasParams);
            }
        }
Esempio n. 4
0
 public FrmAddNewProperties(PDM_Params p_PDM_Params)
 {
     InitializeComponent();
     this.CenterToParent();
     isEditModel = true;
     InitControl(p_PDM_Params);
 }
Esempio n. 5
0
 public FrmAddNewProperties(PDM_Params p_PDM_Params)
 {
     InitializeComponent();
     this.CenterToParent();
     isEditModel = true;
     InitControl(p_PDM_Params);
 }
Esempio n. 6
0
 private void InitControl(PDM_Params p_PDM_Params)
 {
     this.txtParamsColName.Text = p_PDM_Params.PARAMS_NAME;
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.Text.ToString()))
     {
         this.btnTxtValue.Checked = true; this.btnNumberValue.Enabled = false; this.btnDateTime.Enabled = false;
     }
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.Number.ToString()))
     {
         this.btnNumberValue.Checked = true; this.btnDateTime.Enabled = false;
     }
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.DateTime.ToString()))
     {
         this.btnDateTime.Checked = true; this.btnNumberValue.Enabled = false;
     }
 }
Esempio n. 7
0
        private void BtnEditObjectPro_Click(object sender, EventArgs e)
        {
            if (this.tSCombPObject.Text.Trim() != "")
            {
                bool isSelectRecord = true;
                if (this.dGVObjectProperties.RowCount <= 0) { isSelectRecord = false; }
                int rowIndex = this.dGVObjectProperties.CurrentCell.RowIndex;
                if (rowIndex < 0) { isSelectRecord = false; }
                if (!isSelectRecord) { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }

                PDM_Params temp = new PDM_Params();

                DataType.RelationObjectType obj = GetRelationType(this.tSCombPObject.Text.Trim());
                temp.MASTER_TABLE_NAME = sys.NewInstance.GetTableName(obj);
                temp.PARAMS_DATA_TYPE = this.dGVObjectProperties.CurrentRow.Cells["PARAMS_DATA_TYPE1"].Value.ToString();
                temp.PARAMS_NAME = this.dGVObjectProperties.CurrentRow.Cells["PARAMS_NAME1"].Value.ToString();

                FrmAddNewProperties addpro = new FrmAddNewProperties(temp);
                if (addpro.ShowDialog() == DialogResult.OK)
                {
                    sys.NewInstance.UpdateExtPro(temp, addpro.M_PDM_Params);
                    this.dGVObjectProperties.DataSource = sys.NewInstance.GetDataTableForParams(GetRelationType(this.tSCombPObject.Text.Trim()));
                }
            }
        }
Esempio n. 8
0
 private void InitControl(PDM_Params p_PDM_Params)
 {
     this.txtParamsColName.Text = p_PDM_Params.PARAMS_NAME;
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.Text.ToString())) { this.btnTxtValue.Checked = true; this.btnNumberValue.Enabled = false; this.btnDateTime.Enabled = false; }
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.Number.ToString())) { this.btnNumberValue.Checked = true; this.btnDateTime.Enabled = false; }
     if (p_PDM_Params.PARAMS_DATA_TYPE.Equals(DataType.DataColumnType.DateTime.ToString())) { this.btnDateTime.Checked = true; this.btnNumberValue.Enabled = false; }
 }
Esempio n. 9
0
        private void SaveColumnAndValue(PDM_Params p_params,String p_ProValue)
        {
            try {
                     p_params.Save();
                 }catch(Exception e1){
                     MessageBox.Show("添加属性失败!"+e1.Message);
             }
            /*
                 StringBuilder values = new StringBuilder();
                 values.Append(" '").Append(p_params.PARAMS_NAME).Append("','");
                 values.Append(p_params.PARAMS_DATA_TYPE).Append("','");
                 values.Append(p_params.TARGET_COLNAME).Append("','");
                 values.Append(p_params.MASTER_TABLE_NAME).Append("'");
                 String columns = "PARAMS_NAME,PARAMS_DATA_TYPE,TARGET_COLNAME,MASTER_TABLE_NAME";
                 ObjectParams.SaveParamBySql(columns, values.ToString(), "PDM_Params");
            */
            TextBox t = new TextBox();
            t.Tag = p_params.TARGET_COLNAME;
            t.Text = p_ProValue;
            textBoxList.Add(t);

            InsertOrUpDateExtPro();
            /*if (!isHaveValue)
            {
                InsertExtPro();
            }
            else
            {
                UpDateExtPro();
            }*/
            MessageBox.Show("添加属性成功");
        }