Ejemplo n.º 1
0
        private void Part6_Save_Click(object sender, EventArgs e)
        {
            try
            {
                //添加数据
                TrunkIntegralDataInfo.id                 = txt6ID.Text;
                TrunkIntegralDataInfo.bodyHigh           = txtBodyHigh.Text;
                TrunkIntegralDataInfo.cervicalHeight     = txtCervicalHeight.Text;
                TrunkIntegralDataInfo.cervicalHip        = txtCervicalHip.Text;
                TrunkIntegralDataInfo.cervicalHeightKnee = txtCervicalHeightKnee.Text;
                TrunkIntegralDataInfo.cervicalWaist      = txtCervicalWaist.Text;
                TrunkIntegralDataInfo.scapulaHeight      = txtScapulaHeight.Text;
                TrunkIntegralDataInfo.breastHeight       = txtBreastHeight.Text;
                TrunkIntegralDataInfo.neckFrontHeight    = txtNeckFrontHeight.Text;

                //执行添加
                int id = MyMC.AddTrunkIntegralData(TrunkIntegralDataInfo);
                MessageBox.Show("新增--躯干数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            dataGridView6.DataSource = MyMC.GetAllTrunkIntegralData("TrunkIntegralData").Tables[0].DefaultView;
            this.SetdataGridView6HeadText();
        }
Ejemplo n.º 2
0
        private void tlBtnSave_Click(object sender, EventArgs e)
        {
            //判断是添加还是修改数据
            if (G_Int_addOrUpdate == 0)
            {
                try
                {
                    //添加数据
                    TrunkIntegralDataInfo.id                 = txtID.Text;
                    TrunkIntegralDataInfo.bodyHigh           = txtBodyHigh.Text;
                    TrunkIntegralDataInfo.cervicalHeight     = txtCervicalHeight.Text;
                    TrunkIntegralDataInfo.cervicalHip        = txtCervicalHip.Text;
                    TrunkIntegralDataInfo.cervicalHeightKnee = txtCervicalHeightKnee.Text;
                    TrunkIntegralDataInfo.cervicalWaist      = txtCervicalWaist.Text;
                    TrunkIntegralDataInfo.scapulaHeight      = txtScapulaHeight.Text;
                    TrunkIntegralDataInfo.breastHeight       = txtBreastHeight.Text;
                    TrunkIntegralDataInfo.neckFrontHeight    = txtNeckFrontHeight.Text;

                    //执行添加
                    int id = baseinfo.AddTrunkIntegralData(TrunkIntegralDataInfo);
                    MessageBox.Show("新增--躯干数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                //修改数据
                TrunkIntegralDataInfo.id                 = txtID.Text;
                TrunkIntegralDataInfo.bodyHigh           = txtBodyHigh.Text;
                TrunkIntegralDataInfo.cervicalHeight     = txtCervicalHeight.Text;
                TrunkIntegralDataInfo.cervicalHip        = txtCervicalHip.Text;
                TrunkIntegralDataInfo.cervicalHeightKnee = txtCervicalHeightKnee.Text;
                TrunkIntegralDataInfo.cervicalWaist      = txtCervicalWaist.Text;
                TrunkIntegralDataInfo.scapulaHeight      = txtScapulaHeight.Text;
                TrunkIntegralDataInfo.breastHeight       = txtBreastHeight.Text;
                TrunkIntegralDataInfo.neckFrontHeight    = txtNeckFrontHeight.Text;

                //执行修改
                int id = baseinfo.UpdateTrunkIntegralData(TrunkIntegralDataInfo);
                MessageBox.Show("修改--头部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            dgvTrunkIntegralDataList.DataSource = baseinfo.GetAllTrunkIntegralData("TrunkIntegralData").Tables[0].DefaultView;
            this.SetdgvTrunkIntegralDataListHeadText();
            this.cancelEnabled();
        }