示例#1
0
        private void btn_OrderMod_Click(object sender, EventArgs e)
        {
            DataRow RowOrder = ((DataRowView)bsOrder.Current).Row;

            try
            {
                frm_OrderNew frm = new frm_OrderNew(false, ref RowOrder);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Action_DbSave();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
        private void btn_OrderAdd_Click(object sender, EventArgs e)
        {
            DataRow RowOrder = (bsOrder.AddNew() as DataRowView).Row;

            //DataRow RowCustomer = ((DataRowView)bsCustomer.Current).Row;
            //DataRow RowOrder = dtOrder.NewRow();
            //RowOrder.SetField<int>("CustomerID", RowCustomer.Field<int>("id"));
            try
            {
                frm_OrderNew frm = new frm_OrderNew(true, ref RowOrder);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    dtOrder.Rows.Add(RowOrder);
                    Action_DbSave();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }