コード例 #1
0
ファイル: frmAddData.cs プロジェクト: IamWilliamWang/BID
 private void Part8_Save_Click(object sender, EventArgs e)
 {
     try
     {
         //添加数据
         LowerLimbsDataInfo.id = txt8ID.Text;
         LowerLimbsDataInfo.insideLegLengthLeft       = txtInsideLegLengthLeft.Text;
         LowerLimbsDataInfo.insideLegLengthRight      = txtInsideLegLengthRight.Text;
         LowerLimbsDataInfo.sideLengthToWaistLeft     = txtSideLengthToWaistLeft.Text;
         LowerLimbsDataInfo.sideLengthToWaistRight    = txtSideLengthToWaistRight.Text;
         LowerLimbsDataInfo.lateralHeightOfWaistLeft  = txtLateralHeightOfWaistLeft.Text;
         LowerLimbsDataInfo.lateralHeightOfWaistRight = txtLateralHeightOfWaistRight.Text;
         LowerLimbsDataInfo.thighGirthLeft            = txtThighGirthLeft.Text;
         LowerLimbsDataInfo.thighGirthRight           = txtThighGirthRight.Text;
         LowerLimbsDataInfo.kneeGirthLeft             = txtKneeGirthLeft.Text;
         LowerLimbsDataInfo.kneeGirthRight            = txtKneeGirthRight.Text;
         LowerLimbsDataInfo.calfGirthLeft             = txtCalfGirthLeft.Text;
         LowerLimbsDataInfo.calfGirthRight            = txtCalfGirthRight.Text;
         LowerLimbsDataInfo.ankleGirthLeft            = txtAnkleGirthLeft.Text;
         LowerLimbsDataInfo.ankleGirthRight           = txtAnkleGirthRight.Text;
         LowerLimbsDataInfo.waistKnee         = txtWaistKnee.Text;
         LowerLimbsDataInfo.waistHeight       = txtWaistHeight.Text;
         LowerLimbsDataInfo.hipHeight         = txtHipHeight.Text;
         LowerLimbsDataInfo.maximumHipHeight  = txtMaximumHipHeight.Text;
         LowerLimbsDataInfo.crothHeight       = txtCrothHeight.Text;
         LowerLimbsDataInfo.bellyHeight       = txtBellyHeight.Text;
         LowerLimbsDataInfo.maximuBellyHeight = txtMaximuBellyHeight.Text;
         LowerLimbsDataInfo.crothToWaistband  = txtCrothToWaistband.Text;
         LowerLimbsDataInfo.crothLength       = txtCrothLength.Text;
         //执行添加
         int id = MyMC.AddLowerLimbsData(LowerLimbsDataInfo);
         MessageBox.Show("新增--下肢数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     dataGridView8.DataSource = MyMC.GetAllLowerLimbsData("LowerLimbsData").Tables[0].DefaultView;
     this.SetdataGridView8HeadText();
 }
コード例 #2
0
        private void tlBtnSave_Click(object sender, EventArgs e)
        {
            //判断是添加还是修改数据
            if (G_Int_addOrUpdate == 0)
            {
                try
                {
                    //添加数据
                    LowerLimbsDataInfo.id = txtID.Text;
                    LowerLimbsDataInfo.insideLegLengthLeft       = txtInsideLegLengthLeft.Text;
                    LowerLimbsDataInfo.insideLegLengthRight      = txtInsideLegLengthRight.Text;
                    LowerLimbsDataInfo.sideLengthToWaistLeft     = txtSideLengthToWaistLeft.Text;
                    LowerLimbsDataInfo.sideLengthToWaistRight    = txtSideLengthToWaistRight.Text;
                    LowerLimbsDataInfo.lateralHeightOfWaistLeft  = txtLateralHeightOfWaistLeft.Text;
                    LowerLimbsDataInfo.lateralHeightOfWaistRight = txtLateralHeightOfWaistRight.Text;
                    LowerLimbsDataInfo.thighGirthLeft            = txtThighGirthLeft.Text;
                    LowerLimbsDataInfo.thighGirthRight           = txtThighGirthRight.Text;
                    LowerLimbsDataInfo.kneeGirthLeft             = txtKneeGirthLeft.Text;
                    LowerLimbsDataInfo.kneeGirthRight            = txtKneeGirthRight.Text;
                    LowerLimbsDataInfo.calfGirthLeft             = txtCalfGirthLeft.Text;
                    LowerLimbsDataInfo.calfGirthRight            = txtCalfGirthRight.Text;
                    LowerLimbsDataInfo.ankleGirthLeft            = txtAnkleGirthLeft.Text;
                    LowerLimbsDataInfo.ankleGirthRight           = txtAnkleGirthRight.Text;
                    LowerLimbsDataInfo.waistKnee         = txtWaistKnee.Text;
                    LowerLimbsDataInfo.waistHeight       = txtWaistHeight.Text;
                    LowerLimbsDataInfo.hipHeight         = txtHipHeight.Text;
                    LowerLimbsDataInfo.maximumHipHeight  = txtMaximumHipHeight.Text;
                    LowerLimbsDataInfo.crothHeight       = txtCrothHeight.Text;
                    LowerLimbsDataInfo.bellyHeight       = txtBellyHeight.Text;
                    LowerLimbsDataInfo.maximuBellyHeight = txtMaximuBellyHeight.Text;
                    LowerLimbsDataInfo.crothToWaistband  = txtCrothToWaistband.Text;
                    LowerLimbsDataInfo.crothLength       = txtCrothLength.Text;
                    //执行添加
                    int id = baseinfo.AddLowerLimbsData(LowerLimbsDataInfo);
                    MessageBox.Show("新增--下肢数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                //修改数据
                LowerLimbsDataInfo.id = txtID.Text;
                LowerLimbsDataInfo.insideLegLengthLeft       = txtInsideLegLengthLeft.Text;
                LowerLimbsDataInfo.insideLegLengthRight      = txtInsideLegLengthRight.Text;
                LowerLimbsDataInfo.sideLengthToWaistLeft     = txtSideLengthToWaistLeft.Text;
                LowerLimbsDataInfo.sideLengthToWaistRight    = txtSideLengthToWaistRight.Text;
                LowerLimbsDataInfo.lateralHeightOfWaistLeft  = txtLateralHeightOfWaistLeft.Text;
                LowerLimbsDataInfo.lateralHeightOfWaistRight = txtLateralHeightOfWaistRight.Text;
                LowerLimbsDataInfo.thighGirthLeft            = txtThighGirthLeft.Text;
                LowerLimbsDataInfo.thighGirthRight           = txtThighGirthRight.Text;
                LowerLimbsDataInfo.kneeGirthLeft             = txtKneeGirthLeft.Text;
                LowerLimbsDataInfo.kneeGirthRight            = txtKneeGirthRight.Text;
                LowerLimbsDataInfo.calfGirthLeft             = txtCalfGirthLeft.Text;
                LowerLimbsDataInfo.calfGirthRight            = txtCalfGirthRight.Text;
                LowerLimbsDataInfo.ankleGirthLeft            = txtAnkleGirthLeft.Text;
                LowerLimbsDataInfo.ankleGirthRight           = txtAnkleGirthRight.Text;
                LowerLimbsDataInfo.waistKnee         = txtWaistKnee.Text;
                LowerLimbsDataInfo.waistHeight       = txtWaistHeight.Text;
                LowerLimbsDataInfo.hipHeight         = txtHipHeight.Text;
                LowerLimbsDataInfo.maximumHipHeight  = txtMaximumHipHeight.Text;
                LowerLimbsDataInfo.crothHeight       = txtCrothHeight.Text;
                LowerLimbsDataInfo.bellyHeight       = txtBellyHeight.Text;
                LowerLimbsDataInfo.maximuBellyHeight = txtMaximuBellyHeight.Text;
                LowerLimbsDataInfo.crothToWaistband  = txtCrothToWaistband.Text;
                LowerLimbsDataInfo.crothLength       = txtCrothLength.Text;

                //执行修改
                int id = baseinfo.UpdateLowerLimbsData(LowerLimbsDataInfo);
                MessageBox.Show("修改--下肢数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            dgvLowerLimbsDataList.DataSource = baseinfo.GetAllLowerLimbsData("LowerLimbsData").Tables[0].DefaultView;
            this.SetdgvLowerLimbsDataListHeadText();
            this.cancelEnabled();
        }