private void button1_Click(object sender, EventArgs e) { List <CigarreteLeftCountInfo> list = new List <CigarreteLeftCountInfo>(); list = CigarreteLeftCountClass.GetLeftCount(comboBox1.SelectedIndex + 2); codedata.DataSource = list; }
public w_Cigarette_LeftCount() { InitializeComponent(); comboBox1.SelectedIndex = 0; List <CigarreteLeftCountInfo> list = new List <CigarreteLeftCountInfo>(); list = CigarreteLeftCountClass.GetLeftCount(comboBox1.SelectedIndex + 2); codedata.DataSource = list; }
private void button1_Click(object sender, EventArgs e) { CigarreteLeftCountInfo info = new CigarreteLeftCountInfo() { CigaretteCode = itemno, CigaretteName = itemName, MachineSeq = Convert.ToDecimal(machineseq), Threshold = Convert.ToDecimal(tbhjws.Text), Mantissa = Convert.ToDecimal(tbws.Text) }; if (CigarreteLeftCountClass.UpdateLeftCount(info, groupNo)) { MessageBox.Show("修改成功"); } else { MessageBox.Show("修改失败"); } }
private void button3_Click(object sender, EventArgs e) { if (this.codedata.SelectedRows.Count < 1) { MessageBox.Show("请选择一行修改"); } else { w_CigaretteHandle repleish_handle = new w_CigaretteHandle(this.codedata.CurrentRow.Cells["cigarettecode"].Value.ToString(), this.codedata.CurrentRow.Cells["cigarettename"].Value.ToString(), this.codedata.CurrentRow.Cells["machineseq"].Value.ToString(), this.codedata.CurrentRow.Cells["mantissa"].Value.ToString(), this.codedata.CurrentRow.Cells["THRESHOLD"].Value.ToString(), comboBox1.SelectedIndex + 2 ); repleish_handle.WindowState = FormWindowState.Normal; repleish_handle.StartPosition = FormStartPosition.CenterScreen; repleish_handle.ShowDialog(); List <CigarreteLeftCountInfo> list = new List <CigarreteLeftCountInfo>(); list = CigarreteLeftCountClass.GetLeftCount(comboBox1.SelectedIndex + 2); codedata.DataSource = list; } }