private void dgvMon_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { //if (dgvMon.RowCount.ToString() == "0") //{ // MessageBox.Show("Dữ liệu trống", "Cảnh báo"); // return; //} //btnLuu.Enabled = true; //btnHuy.Enabled = true; //tenMon = dgvMon.CurrentRow.Cells[1].Value.ToString().Trim(); ////tongNguyenLieu = int.Parse(dgvMon.CurrentRow.Cells[2].Value.ToString().Trim()); //calo = double.Parse(dgvMon.CurrentRow.Cells[3].Value.ToString().Trim()); //ManhomMon = int.Parse(dgvMon.CurrentRow.Cells[4].Value.ToString()); //nhomMon = db.NHOMMONs.Find(ManhomMon).TenNhom.ToString().ToLower(); //frmChiTietMonAn monAn = new frmChiTietMonAn(); //monAn.ShowDialog(); maMon = int.Parse(dgvMon.CurrentRow.Cells[0].Value.ToString().Trim()); tenMon = dgvMon.CurrentRow.Cells[1].Value.ToString().Trim(); IDMON = maMon; var x = db.CONGTHUCMONs.Where(s => s.IDMon == IDMON) .Select(s => s.IDNL); var y = db.CONGTHUCMONs.Where(s => s.IDMon == IDMON) .Select(s => s.LieuLuong); lsLieuLuong = y.ToList(); lsMaNguyenLieu = x.ToList(); frmChiTietCongThuc frm = new frmChiTietCongThuc(); frm.ShowDialog(); }
private void dgvCongThucMon_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { maMon = int.Parse(dgvCongThucMon.CurrentRow.Cells[0].Value.ToString().Trim()); tenMon = dgvCongThucMon.CurrentRow.Cells[1].Value.ToString().Trim(); IDMON = int.Parse(dgvCongThucMon.CurrentRow.Cells[0].Value.ToString().Trim()); var x = db.CONGTHUCMONs.Where(s => s.IDMon == IDMON) .Select(s => s.IDNL); var y = db.CONGTHUCMONs.Where(s => s.IDMon == IDMON) .Select(s => s.LieuLuong); lsLieuLuong = y.ToList(); lsMaNguyenLieu = x.ToList(); frmChiTietCongThuc frm = new frmChiTietCongThuc(); frm.ShowDialog(); }