private void gcGVDK_Click(object sender, EventArgs e) { DateTime currentDateTime1 = DateTime.Now; this.txtNgayThi.MinDate = currentDateTime1.AddDays(-1000); DateTime currentDateTime = DateTime.Now; this.txtNgayThi.MaxDate = currentDateTime.AddDays(60); DataRowView current = (DataRowView)bs_GVDK.Current; String x = current["MAMH"].ToString(); String nameMH = SqlRequestFunction.GetTenMH(x); this.txtMH2.Text = nameMH; String y = current["MALOP"].ToString(); String nameLOP = SqlRequestFunction.GetTenLop(y); this.txtMaLop1.Text = nameLOP; String z = current["TRINHDO"].ToString(); String TrinhDo = GetLevelName(z); this.txtTrinhDo1.Text = TrinhDo; String t = current["NGAYTHI"].ToString(); this.txtNgayThi.Text = t; }
public void set() { if (bs_GVDK.Count == 0) { btn_Add.Enabled = true; btn_Edit.Enabled = btn_Ghi.Enabled = btn_Delete.Enabled = btn_Reload.Enabled = btn_Thoat.Enabled = btn_Reset.Enabled = false; this.groupBox1.Enabled = false; } else { btn_Ghi.Enabled = false; this.btn_Reset.Enabled = true; this.groupBox1.Enabled = false; this.txtMH2.Visible = this.txtMaLop1.Visible = this.txtTrinhDo1.Visible = true; gcGVDK.Enabled = true; /*DataRowView current1 = (DataRowView)bs_GVDK.Current * * /*String maGV = current1["MAGV"].ToString(); * this.bs_GVDK.Position = FindPointionCurrentTeacher(maGV);*/ DataRowView current = (DataRowView)bs_GVDK.Current; String x = current["MAMH"].ToString(); this.txtMaMH.Text = x; String nameMH = SqlRequestFunction.GetTenMH(x); this.txtMH2.Text = nameMH; String y = current["MALOP"].ToString(); String nameLOP = SqlRequestFunction.GetTenLop(y); this.txtMaLop1.Text = nameLOP; String z = current["TRINHDO"].ToString(); String TrinhDo = GetLevelName(z); this.txtTrinhDo1.Text = TrinhDo; DateTime currentDateTime = DateTime.Now; this.txtNgayThi.MinDate = currentDateTime.AddDays(-1000); this.txtNgayThi.MaxDate = currentDateTime.AddDays(60); String t = current["NGAYTHI"].ToString(); this.txtNgayThi.Text = t; } }