Exemple #1
0
 private void Part5_Save_Click(object sender, EventArgs e)
 {
     try
     {
         //添加数据
         BellyWaistHipDataInfo.id    = txt5ID.Text;
         BellyWaistHipDataInfo.waist = txtWaist.Text;
         BellyWaistHipDataInfo.waistBackLevelDifference = txtWaistBackLevelDifference.Text;
         BellyWaistHipDataInfo.hipThickness             = txtHipThickness.Text;
         BellyWaistHipDataInfo.adominalThickness        = txtAdominalThickness.Text;
         BellyWaistHipDataInfo.hipGirth                  = txtHipGirth.Text;
         BellyWaistHipDataInfo.buttockGirth              = txtButtockGirth.Text;
         BellyWaistHipDataInfo.maximumHipGirth           = txtMaximumHipGirth.Text;
         BellyWaistHipDataInfo.belly                     = txtBelly.Text;
         BellyWaistHipDataInfo.maximumBellyCircamference = txtMaximumBellyCircamference.Text;
         BellyWaistHipDataInfo.waistPelvisDistance       = txtWaistPelvisDistance.Text;
         BellyWaistHipDataInfo.waistPelvisLengthLeft     = txtWaistPelvisLengthLeft.Text;
         BellyWaistHipDataInfo.waistPelvisLengthRight    = txtWaistPelvisLengthRight.Text;
         BellyWaistHipDataInfo.waistUnderarmLeft         = txtWaistUnderarmLeft.Text;
         BellyWaistHipDataInfo.waistUnderarmRight        = txtWaistUnderarmRight.Text;
         //执行添加
         int id = MyMC.AddBellyWaistHipData(BellyWaistHipDataInfo);
         MessageBox.Show("新增--腹腰臀部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     dataGridView5.DataSource = MyMC.GetAllBellyWaistHipData("BellyWaistHipData").Tables[0].DefaultView;
     this.SetdataGridView5HeadText();
 }
 private void tlBtnSave_Click(object sender, EventArgs e)
 {
     //判断是添加还是修改数据
     if (G_Int_addOrUpdate == 0)
     {
         try
         {
             //添加数据
             BellyWaistHipDataInfo.id    = txtID.Text;
             BellyWaistHipDataInfo.waist = txtWaist.Text;
             BellyWaistHipDataInfo.waistBackLevelDifference = txtWaistBackLevelDifference.Text;
             BellyWaistHipDataInfo.hipThickness             = txtHipThickness.Text;
             BellyWaistHipDataInfo.adominalThickness        = txtAdominalThickness.Text;
             BellyWaistHipDataInfo.hipGirth                  = txtHipGirth.Text;
             BellyWaistHipDataInfo.buttockGirth              = txtButtockGirth.Text;
             BellyWaistHipDataInfo.maximumHipGirth           = txtMaximumHipGirth.Text;
             BellyWaistHipDataInfo.belly                     = txtBelly.Text;
             BellyWaistHipDataInfo.maximumBellyCircamference = txtMaximumBellyCircamference.Text;
             BellyWaistHipDataInfo.waistPelvisDistance       = txtWaistPelvisDistance.Text;
             BellyWaistHipDataInfo.waistPelvisLengthLeft     = txtWaistPelvisLengthLeft.Text;
             BellyWaistHipDataInfo.waistPelvisLengthRight    = txtWaistPelvisLengthRight.Text;
             BellyWaistHipDataInfo.waistUnderarmLeft         = txtWaistUnderarmLeft.Text;
             BellyWaistHipDataInfo.waistUnderarmRight        = txtWaistUnderarmRight.Text;
             //执行添加
             int id = baseinfo.AddBellyWaistHipData(BellyWaistHipDataInfo);
             MessageBox.Show("新增--腹腰臀部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         //修改数据
         BellyWaistHipDataInfo.id    = txtID.Text;
         BellyWaistHipDataInfo.waist = txtWaist.Text;
         BellyWaistHipDataInfo.waistBackLevelDifference = txtWaistBackLevelDifference.Text;
         BellyWaistHipDataInfo.hipThickness             = txtHipThickness.Text;
         BellyWaistHipDataInfo.adominalThickness        = txtAdominalThickness.Text;
         BellyWaistHipDataInfo.hipGirth                  = txtHipGirth.Text;
         BellyWaistHipDataInfo.buttockGirth              = txtButtockGirth.Text;
         BellyWaistHipDataInfo.maximumHipGirth           = txtMaximumHipGirth.Text;
         BellyWaistHipDataInfo.belly                     = txtBelly.Text;
         BellyWaistHipDataInfo.maximumBellyCircamference = txtMaximumBellyCircamference.Text;
         BellyWaistHipDataInfo.waistPelvisDistance       = txtWaistPelvisDistance.Text;
         BellyWaistHipDataInfo.waistPelvisLengthLeft     = txtWaistPelvisLengthLeft.Text;
         BellyWaistHipDataInfo.waistPelvisLengthRight    = txtWaistPelvisLengthRight.Text;
         BellyWaistHipDataInfo.waistUnderarmLeft         = txtWaistUnderarmLeft.Text;
         BellyWaistHipDataInfo.waistUnderarmRight        = txtWaistUnderarmRight.Text;
         //执行修改
         int id = baseinfo.UpdateBellyWaistHipData(BellyWaistHipDataInfo);
         MessageBox.Show("修改--腹腰臀部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     dgvBellyWaistHipDataList.DataSource = baseinfo.GetAllBellyWaistHipData("BellyWaistHipData").Tables[0].DefaultView;
     this.SetdgvBellyWaistHipDataListHeadText();
     this.cancelEnabled();
 }