private void 修改Button_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { Dairy dairy = (Dairy)comboBox1.SelectedItem; dairy.Pos机会籍 = numericUpDown1.Value; dairy.Pos机私教 = numericUpDown2.Value; dairy.现金会籍 = numericUpDown3.Value; dairy.现金私教 = numericUpDown4.Value; dairy.微信会籍 = numericUpDown9.Value; dairy.微信私教 = numericUpDown8.Value; dairy.现金存水 = numericUpDown5.Value; dairy.微信存水 = numericUpDown10.Value; dairy.水吧余 = numericUpDown6.Value; dairy.总金额 = numericUpDown7.Value; dairy.经手人 = (selectStaffControl1.SelectedStaffs != null && selectStaffControl1.SelectedStaffs.Count > 0) ? selectStaffControl1.SelectedStaffs[0] : null; dairy.日期 = dateTimePicker3.Value; dairy.备注 = textBox2.Text; DairyLogic al = DairyLogic.GetInstance(); if (al.UpdateDairy(dairy)) { LoadDairys(); MessageBox.Show("修改成功!"); } } else { MessageBox.Show("先选定要修改的业绩!"); } }