private void dvgListOrDetail_Click(object sender, EventArgs e) { Order orderbycus = new Order() { order_id = (int)dvgListOrDetail.SelectedCells[0].Value, order_name = dvgListOrDetail.SelectedCells[1].Value.ToString(), cus_id = (int)dvgListOrDetail.SelectedCells[2].Value, status = (bool)(dvgListOrDetail.SelectedCells[3].Value), date_create = (DateTime)dvgListOrDetail.SelectedCells[4].Value }; frmOrder order = new frmOrder(orderbycus); order.ShowDialog(); }
private void dvgCus_DoubleClick(object sender, EventArgs e) { Customer c = new Customer(); c.cus_id = int.Parse(txtCusid.Text); c.fullName = txtCusfullname.Text; c.address = txtCusaddress.Text; c.email = txtCusemail.Text; c.mobile = txtCusphone.Text; c.gender = cbCusgender.Checked ? true : false; c.status = cbCusstatus.Checked ? true : false; frmOrder frmOrder = new frmOrder(c); frmOrder.WindowState = FormWindowState.Maximized; frmOrder.ShowDialog(); }