public bool UpdateCT_NhapKho(CT_NhapKhoDTO dtoCT_NhapKho)
 {
     string strQuery = "Update CT_NHAPKHO Set ";
     strQuery += "MAMATHANG = N'" + dtoCT_NhapKho.MaMatHang + "',";
     strQuery += "SOLUONGNHAP = " + dtoCT_NhapKho.SoLuongNhap + ",";
     strQuery += "GIANHAP = " + dtoCT_NhapKho.GiaNhap + ",";
     strQuery += "THANHTIEN = " + dtoCT_NhapKho.ThanhTien ;
     strQuery += "Where MACTNHAPKHO = N'" + dtoCT_NhapKho.MaCTNhapKho + "'";
     return dp.ExecuteNonQuery(strQuery);
 }
 public bool InsertCT_NhapKho(CT_NhapKhoDTO dtoCT_NhapKho)
 {
     string strQuery = "Insert Into CT_NHAPKHO Values(";
     strQuery += "N'" + dtoCT_NhapKho.MaCTNhapKho + "',";
     strQuery += "N'" + dtoCT_NhapKho.MaNhapKho + "',";
     strQuery += "N'" + dtoCT_NhapKho.MaMatHang + "',";
     strQuery += dtoCT_NhapKho.SoLuongNhap + ",";
     strQuery += dtoCT_NhapKho.GiaNhap + ",";
     strQuery += dtoCT_NhapKho.ThanhTien + ", " + dtoCT_NhapKho.TinhTrang + ")";
     return dp.ExecuteNonQuery(strQuery);
 }
 public bool UpdateCT_NhapKho(CT_NhapKhoDTO dtoCT_NhapKho)
 {
     return dalCTNhapKho.UpdateCT_NhapKho(dtoCT_NhapKho);
 }
 public bool InsertCT_NhapKho(CT_NhapKhoDTO dtoCT_NhapKho)
 {
     return dalCTNhapKho.InsertCT_NhapKho(dtoCT_NhapKho);
 }
 private CT_NhapKhoDTO LayThongTinChiTietNhapKho(NhapKhoDTO dtoNhapKho, int i)
 {
     CT_NhapKhoDTO dtoCTNhap = new CT_NhapKhoDTO();
     dtoCTNhap.MaCTNhapKho = cf.CreateId("CTN", "CT_NHAPKHO");
     dtoCTNhap.MaNhapKho = dtoNhapKho.MaNhapKho;
     double dbGia = double.Parse(dgvMatHang.Rows[i].Cells["colGia"].Value.ToString());
     dtoCTNhap.GiaNhap = dbGia;
     dtoCTNhap.MaMatHang = dgvMatHang.Rows[i].Cells["colMaMatHang"].Value.ToString();
     dtoCTNhap.SoLuongNhap = int.Parse(dgvMatHang.Rows[i].Cells["colSoLuong"].Value.ToString());
     dtoCTNhap.ThanhTien = double.Parse(dgvMatHang.Rows[i].Cells["colThanhTien"].Value.ToString());
     dtoCTNhap.TinhTrang = "1";
     return dtoCTNhap;
 }