/// <summary> /// Добавление строки таблицы. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddButton_Click(object sender, EventArgs e) { var form = new AddForm() { Owner = this }; form.Show(); }
/// <summary> /// 修改数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { DataGridViewRow drvRow = dataGridView1.CurrentRow; if (addForm == null || addForm.IsDisposed) { addForm = new AddForm(drvRow); addForm.Show(); } addForm.Focus(); }
/// <summary> /// 添加数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddOpen_Click(object sender, EventArgs e) { //打开窗体 if (addForm == null || addForm.IsDisposed) { addForm = new AddForm("add"); addForm.Show(); } addForm.Focus(); //添加界面的属性 addForm.Text = "添加页面"; }
//增加消费 private void Insert_Click(object sender, EventArgs e) { TablesModel tables = new TablesModel(); tables.TableID1 = id; tables.TableName1 = name; //查询出当前餐桌得编号 ConsumerBillModel cbm = new ConsumerBillModel(); cbm.TableID1 = id; cbm.CBClose1 = 0; DataTable dt = ConsumerBillBLL.getNo(cbm); cbm.CBID1 = dt.Rows[0]["账单编号"].ToString(); AddForm af = new AddForm(tables, cbm); af.Show(); }
private void brnOK_Click(object sender, EventArgs e) { TablesModel tables2 = new TablesModel(); tables2.TableName1 = tables.TableName1; tables2.TableState1 = 1; int result = RommBLL.getUpdateZT(tables2); string count = txtCount.Text.Trim(); if (result > 0) { MessageBox.Show("OK"); if (cb.Checked) { string no = "ZD" + DateTime.Now.ToString("yyyyMMddhhmm"); string time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); ConsumerBillModel cbm = new ConsumerBillModel(no, tables.TableID1, count, "-1", "1", time, "", admin, Convert.ToDouble("0"), 0); ConsumerBillBLL.getInsert(cbm); AddForm af = new AddForm(tables, cbm); af.Show(); } else { string no = "ZD" + DateTime.Now.ToString("yyyyMMddhhmm"); string time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); ConsumerBillModel cbm = new ConsumerBillModel(no, tables.TableID1, count, "-1", "1", time, "", admin, Convert.ToDouble("0"), 0); ConsumerBillBLL.getInsert(cbm); } FunctionForm ff = new FunctionForm(); ff.FunctionForm_Load(null, null); this.Close(); } else { MessageBox.Show("NO"); } }