private void rptThiNghiemBind() { lblIDThiNghiem.Text = Request.QueryString["ID"]; lblSoCot.Text = countCol().ToString(); int ID = Convert.ToInt32(lblIDThiNghiem.Text); DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); DataRow rowThiNghiem = TNDAO.getThiNghiemByID(ID); lblID_ThiNghiem.Text = ID.ToString(); lblTenThiNghiem.Text = DAO.clsLoaiThiNghiemDAO.getTenThiNghiemByID(Convert.ToInt32(rowThiNghiem["ID_LoaiThiNghiem"])).Rows[0][0].ToString(); lblXuatXu.Text = rowThiNghiem["XuatXu"].ToString(); int ID_LoaiThiNghiem = Convert.ToInt32(rowThiNghiem["ID_LoaiThiNghiem"]); rptCot.DataSource = DAO.clsCotThiNghiem_Mapping.getCotByIDLoai(ID_LoaiThiNghiem); rptCot.DataBind(); if (Session["VaiTro"].ToString() == "1") { rptThiNghiem.DataSource = DAO.clsNhapLieuDAO.selectNhapLieuByIDTN(ID); } else { rptThiNghiem.DataSource = DAO.clsNhapLieuDAO.selectNhapLieuByIDTN_IDND(ID, Convert.ToInt32(Session["ID"])); } rptThiNghiem.DataBind(); if (rptThiNghiem.Items.Count == 0) { lblPhanCong.Visible = true; btnCapNhat.Visible = false; } }
public int countCol() { int ID = Convert.ToInt32(Request.QueryString["ID"]); DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); DataRow rowThiNghiem = TNDAO.getThiNghiemByID(ID); int ID_LoaiThiNghiem = Convert.ToInt32(rowThiNghiem["ID_LoaiThiNghiem"]); return(DAO.clsCotThiNghiem_Mapping.countCot(ID_LoaiThiNghiem)); }
private void lblThiNghiemBind() { DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); DataRow t = TNDAO.getThiNghiemByID(Convert.ToInt32(Request.QueryString["ID"])); lbl_kqxuatxu.Text = t["XuatXu"].ToString(); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); lbl_kqngaylaymau.Text = Convert.ToDateTime(t["NgayLayMau"]).ToString("d/M/yyyy"); lbl_kqngaynhanmau.Text = Convert.ToDateTime(t["NgayNhanMau"]).ToString("d/M/yyyy"); lbl_kqngaythumau.Text = Convert.ToDateTime(t["NgayThuMau"]).ToString("d/M/yyyy"); lbl_kqlydothinghiem.Text = t["LyDoThiNghiem"].ToString(); lbl_kqphutrachlaymau.Text = t["PhuTrachLayMau"].ToString(); lbl_kqghichu.Text = t["GhiChu"].ToString(); }
private void rptDCDBind() { lblSoCot.Text = countCol().ToString(); int ID = Convert.ToInt32(Request.QueryString["ID"]); DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); DataRow rowThiNghiem = TNDAO.getThiNghiemByID(ID); int ID_LoaiThiNghiem = Convert.ToInt32(rowThiNghiem["ID_LoaiThiNghiem"]); lbl_DCD_title4.Text = DAO.clsLoaiThiNghiemDAO.getTenThiNghiemByID(ID_LoaiThiNghiem).Rows[0][0].ToString(); rptCot.DataSource = DAO.clsCotThiNghiem_Mapping.getCotByIDLoai(ID_LoaiThiNghiem); rptCot.DataBind(); rptThiNghiem.DataSource = DAO.clsNhapLieuDAO.selectNhapLieuByIDTN(ID); rptThiNghiem.DataBind(); }
private void rptDNCNBind(int id) { DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); DataRow TN = TNDAO.getThiNghiemByID(id); if (TN["QuyenSua"].ToString() == "0" && Session["VaiTro"].ToString() != "1") { Server.Transfer("index.aspx"); return; } else { lblID_ThiNghiem.Text = id.ToString(); if (TN["ID_LoaiThiNghiem"].ToString() == "1") { lblTenThiNghiem.Text = "Dầu cách điện"; } else { lblTenThiNghiem.Text = "Dầu nhớt công nghiệp"; } lblXuatXu.Text = TN["XuatXu"].ToString(); DAO.clsPhanQuyenDAO PQDAO = new DAO.clsPhanQuyenDAO(); DataRow tblND = PQDAO.getQuyen(Convert.ToInt32(Session["ID"])); DAO.clsNhapLieuDAO NLDAO = new DAO.clsNhapLieuDAO(); DataTable tblDNCN = new DataTable(); tblDNCN = NLDAO.selectNhapLieu_DNCN(id); DataView view = new DataView(tblDNCN); if (tblND["VaiTro"].ToString() != "1") { string filter = "ID_DacTinh IN (0,"; string[] arr = tblND["NhapLieu_DNCN"].ToString().Split(' '); for (int i = 0; i < arr.Length - 1; i++) { filter = filter + arr[i] + ","; } filter += ")"; view.RowFilter = filter; } rptDNCN.DataSource = view; rptDNCN.DataBind(); } }
private void form_ThiNghiemBind(int ID, int ID_LoaiThiNghiem) { string t = DAO.clsLoaiThiNghiemDAO.getTenThiNghiemByID(ID_LoaiThiNghiem).Rows[0][0].ToString(); txtTenLoaiThiNghiem.Text = t; DAO.clsThiNghiemDAO TNDAO = new DAO.clsThiNghiemDAO(); var rowThiNghiem = TNDAO.getThiNghiemByID(ID); if (rowThiNghiem["QuyenSua"].ToString() == "0" && Session["VaiTro"].ToString() != "1") { btnSuaThiNghiem.Visible = false; } txtXuatXu.Text = rowThiNghiem["XuatXu"].ToString(); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); txtNgayLayMau.Text = Convert.ToDateTime(rowThiNghiem["NgayLayMau"]).ToString("d/M/yyyy"); txtNgayNhanMau.Text = Convert.ToDateTime(rowThiNghiem["NgayNhanMau"]).ToString("d/M/yyyy"); txtNgayThuMau.Text = Convert.ToDateTime(rowThiNghiem["NgayThuMau"]).ToString("d/M/yyyy"); txtLyDoThiNghiem.Text = rowThiNghiem["LyDoThiNghiem"].ToString(); txtPhuTrachLayMau.Text = rowThiNghiem["PhuTrachLayMau"].ToString(); txtGhiChu.Text = rowThiNghiem["GhiChu"].ToString(); }