private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { _parent.AddChild(new frmChiTietDonNhapHang(_parent, dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString())); } }
private void btnTao_Click(object sender, EventArgs e) { var context = new QLKHContext(); List <SqlParameter> PhieuNhapHangParameters = new List <SqlParameter>(); PhieuNhapHangParameters.Add(new SqlParameter("@maphieu", txtMaDonHang.Text)); PhieuNhapHangParameters.Add(new SqlParameter("@NgayNhap", DateTime.Now.ToString("yyyy-MM-dd"))); PhieuNhapHangParameters.Add(new SqlParameter("@mota", rtMoTa.Text)); PhieuNhapHangParameters.Add(new SqlParameter("@nhanvien_nhap", Round.nhanVien.MaNhanVien)); context.Database.ExecuteSqlRaw("ThemPhieuNhap @maphieu, @NgayNhap, @mota, @nhanvien_nhap", PhieuNhapHangParameters); foreach (DataGridViewRow item in dataGridView1.Rows) { if (item.Cells[0].Value != null) { List <SqlParameter> hangnhapPara = new List <SqlParameter>(); hangnhapPara.Add(new SqlParameter("@soluong", item.Cells[2].Value)); hangnhapPara.Add(new SqlParameter("@mpnhap", txtMaDonHang.Text)); hangnhapPara.Add(new SqlParameter("@mahangnhap", item.Cells[0].Value)); context.Database.ExecuteSqlRaw("ThemHangNhap @soluong, @mpnhap, @mahangnhap", hangnhapPara); } } _parent.AddChild(new frmChiTietDonNhapHang(_parent, txtMaDonHang.Text)); }
private void btnAdd_Click(object sender, EventArgs e) { _parent.AddChild(new frmChiTietMatHang()); }
private void btnAdd_Click(object sender, EventArgs e) { _parent.AddChild(new frmQlThemDonXuatHang(_parent)); }
private void btnDatLich_Click(object sender, EventArgs e) { _parent.AddChild(new frmDatLichKiemKe()); }
private void btnTao_Click(object sender, EventArgs e) { _parent.AddChild(new frmQlChiTietDonXuatHang(_parent)); }