private void GetParameter(object sender, PerpetuumSoft.Reporting.Components.GetReportParameterEventArgs e) { try { //double bosung = Statistic.Thongkediem(0, _list).Rows.Count; //double toiec1 = Statistic.Thongkediem(1, _list).Rows.Count; //double toiec2 = Statistic.Thongkediem(2, _list).Rows.Count; //double toiec3 = Statistic.Thongkediem(3, _list).Rows.Count; //double toiec4 = Statistic.Thongkediem(4, _list).Rows.Count; //double miengiam = Statistic.Thongkediem(5, _list).Rows.Count; double bosung = 0; double toiec1 = 0; double toiec2 = 0; double toiec3 = 0; double toiec4 = 0; double miengiam = 0; foreach (var row in dgv_DanhSach.Rows) { var d = double.Parse(row.Cells["TongDiem"].Text); if (d < 200) bosung = bosung + 1; else if (d >= 200 && d < 250) toiec1 += 1; else if (d >= 250 && d < 300) toiec2 += 1; else if (d >= 300 && d < 374) toiec3 += 1; else if (d >= 374 && d < 450) toiec4 += 1; else miengiam += 1; } var tong = bosung + toiec1 + toiec2 + toiec3 + toiec4 + miengiam; e.Parameters["bosung"].Value = bosung.ToString(); e.Parameters["toiec1"].Value = toiec1.ToString(); e.Parameters["toiec2"].Value = toiec2.ToString(); e.Parameters["toiec3"].Value = toiec3.ToString(); e.Parameters["toiec4"].Value = toiec4.ToString(); e.Parameters["miengiam"].Value = miengiam.ToString(); e.Parameters["TLbosung"].Value = Math.Round(bosung / tong * 100, 1).ToString(); e.Parameters["TLtoiec1"].Value = Math.Round(toiec1 / tong * 100, 1).ToString(); e.Parameters["TLtoiec2"].Value = Math.Round(toiec2 / tong * 100, 1).ToString(); e.Parameters["TLtoiec3"].Value = Math.Round(toiec3 / tong * 100, 1).ToString(); e.Parameters["TLtoiec4"].Value = Math.Round(toiec4 / tong * 100, 1).ToString(); e.Parameters["TLmiengiam"].Value = Math.Round(miengiam / tong * 100, 1).ToString(); e.Parameters["tong"].Value = tong.ToString(); } catch (Exception ex) { Log2File.LogExceptionToFile(ex); } }
private void GetParameter1(object sender, PerpetuumSoft.Reporting.Components.GetReportParameterEventArgs e) { try { var tb = LoadData.Load(3, _idkythi); foreach (DataRow row in tb.Rows) { e.Parameters["GhiChu"].Value = row["GhiChu"].ToString(); } } catch (Exception ex) { Log2File.LogExceptionToFile(ex); } }
private void GetParameter(object sender, PerpetuumSoft.Reporting.Components.GetReportParameterEventArgs e) { try { var tb = (DataTable)dgv_DanhSach.DataSource; foreach (var row in tb.Rows.Cast <DataRow>().Where(row => row["MaSV"].ToString().Equals(_masv))) { e.Parameters["MaSV"].Value = row["MaSV"].ToString(); e.Parameters["diemtichluy"].Value = row["Diem"].ToString(); e.Parameters["TenSV"].Value = row["HoSV"] + " " + row["TenSV"]; e.Parameters["MaLop"].Value = row["MaLop"].ToString(); } } catch (Exception ex) { Log2File.LogExceptionToFile(ex); } }
private void GetParameter1(object sender, PerpetuumSoft.Reporting.Components.GetReportParameterEventArgs e) { try { //double bosung = SearchData.Thongkediem(0, _idkythi).Rows.Count; //double toiec1 = SearchData.Thongkediem(1, _idkythi).Rows.Count; //double toiec2 = SearchData.Thongkediem(2, _idkythi).Rows.Count; //double toiec3 = SearchData.Thongkediem(3, _idkythi).Rows.Count; //double toiec4 = SearchData.Thongkediem(4, _idkythi).Rows.Count; //double miengiam = SearchData.Thongkediem(5, _idkythi).Rows.Count; //var tong = bosung + toiec1 + toiec2 + toiec3 + toiec4 + miengiam; var tb = LoadData.Load(15, _idkythi); double bosung = 0; double toiec1 = 0; double toiec2 = 0; double toiec3 = 0; double toiec4 = 0; double miengiam = 0; foreach (var d in from DataRow row in tb.Rows select double.Parse(row["DiemThi"].ToString())) { if (d < 200) { bosung = bosung + 1; } else if (d >= 200 && d < 250) { toiec1 += 1; } else if (d >= 250 && d < 300) { toiec2 += 1; } else if (d >= 300 && d < 374) { toiec3 += 1; } else if (d >= 374 && d < 450) { toiec4 += 1; } else { miengiam += 1; } } var tong = bosung + toiec1 + toiec2 + toiec3 + toiec4 + miengiam; e.Parameters["bosung"].Value = bosung.ToString(); e.Parameters["toiec1"].Value = toiec1.ToString(); e.Parameters["toiec2"].Value = toiec2.ToString(); e.Parameters["toiec3"].Value = toiec3.ToString(); e.Parameters["toiec4"].Value = toiec4.ToString(); e.Parameters["miengiam"].Value = miengiam.ToString(); e.Parameters["TLbosung"].Value = Math.Round(bosung / tong * 100, 1).ToString(); e.Parameters["TLtoiec1"].Value = Math.Round(toiec1 / tong * 100, 1).ToString(); e.Parameters["TLtoiec2"].Value = Math.Round(toiec2 / tong * 100, 1).ToString(); e.Parameters["TLtoiec3"].Value = Math.Round(toiec3 / tong * 100, 1).ToString(); e.Parameters["TLtoiec4"].Value = Math.Round(toiec4 / tong * 100, 1).ToString(); e.Parameters["TLmiengiam"].Value = Math.Round(miengiam / tong * 100, 1).ToString(); e.Parameters["tong"].Value = tong.ToString(); } catch (Exception ex) { Log2File.LogExceptionToFile(ex); } }