private void SaveDetail2()
 {
     try
     {
         foreach (var row in dgv_DanhSach.Rows)
         {
             var hs = new DiemThi
             {
                 MaSV = int.Parse(row.Cells["MaSV"].Text),
                 Diem = double.Parse(row.Cells["DiemThi"].Text),
                 IdNamHoc = _idnamhoc,
                 HocKy = _hocky
             };
             _listThongke.Add(hs);
         }
         if (_listThongke.Count > 0)
         {
             InsertData.ThemThongKe(_listThongke);
             MessageBox.Show(@"Lưu lại thành công");
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Thêm bảng thống kê
 /// </summary>
 /// <returns></returns>
 public static bool ThemThongKe(DiemThi item)
 {
     try
     {
         var diem = item.Diem.ToString().Replace(',', '.');
         Conn.ExcuteQuerySql("insert into DIEMTHI(MaSV,IdNamHoc,HocKy,Diem) values(" +
         item.MaSV + "," + item.IdNamHoc + ",'" + item.HocKy + "'," +diem + ")");
         return true;
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
         return false;
     }
 }