Пример #1
0
        private void Part9_Save_Click(object sender, EventArgs e)
        {
            try
            {
                //添加数据
                FootDataInfo.id                   = txt9ID.Text;
                FootDataInfo.footLength           = txtFootLength.Text;
                FootDataInfo.footWidth            = txtFootWidth.Text;
                FootDataInfo.footGirth            = txtFootGirth.Text;
                FootDataInfo.toeHeihet            = txtToeHeihet.Text;
                FootDataInfo.footTarsiHigh        = txtFootTarsiHigh.Text;
                FootDataInfo.medialMalleolusHigh  = txtMedialMalleolusHigh.Text;
                FootDataInfo.lateralMalleolusHigh = txtLateralMalleolusHigh.Text;

                //执行添加
                int id = MyMC.AddFootData(FootDataInfo);
                MessageBox.Show("新增--足部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            dataGridView9.DataSource = MyMC.GetAllFootData("FootData").Tables[0].DefaultView;
            this.SetdataGridView9HeadText();
        }
Пример #2
0
        private void tlBtnSave_Click(object sender, EventArgs e)
        {
            //判断是添加还是修改数据
            if (G_Int_addOrUpdate == 0)
            {
                try
                {
                    //添加数据
                    FootDataInfo.id                   = txtID.Text;
                    FootDataInfo.footLength           = txtFootLength.Text;
                    FootDataInfo.footWidth            = txtFootWidth.Text;
                    FootDataInfo.footGirth            = txtFootGirth.Text;
                    FootDataInfo.toeHeihet            = txtToeHeihet.Text;
                    FootDataInfo.footTarsiHigh        = txtFootTarsiHigh.Text;
                    FootDataInfo.medialMalleolusHigh  = txtMedialMalleolusHigh.Text;
                    FootDataInfo.lateralMalleolusHigh = txtLateralMalleolusHigh.Text;

                    //执行添加
                    int id = baseinfo.AddFootData(FootDataInfo);
                    MessageBox.Show("新增--足部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                //修改数据
                FootDataInfo.id                   = txtID.Text;
                FootDataInfo.footLength           = txtFootLength.Text;
                FootDataInfo.footWidth            = txtFootWidth.Text;
                FootDataInfo.footGirth            = txtFootGirth.Text;
                FootDataInfo.toeHeihet            = txtToeHeihet.Text;
                FootDataInfo.footTarsiHigh        = txtFootTarsiHigh.Text;
                FootDataInfo.medialMalleolusHigh  = txtMedialMalleolusHigh.Text;
                FootDataInfo.lateralMalleolusHigh = txtLateralMalleolusHigh.Text;

                //执行修改
                int id = baseinfo.UpdateFootData(FootDataInfo);
                MessageBox.Show("修改--足部数据--成功!", "成功提示!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            dgvFootDataList.DataSource = baseinfo.GetAllFootData("FootData").Tables[0].DefaultView;
            this.SetdgvFootDataListHeadText();
            this.cancelEnabled();
        }