private void fromGV_Load(object sender, EventArgs e) { taBode.Connection.ConnectionString += ";password=123"; this.taGV.Connection.ConnectionString += ";password=123"; this.taGVDK.Connection.ConnectionString += ";password=123"; taKhoa.Connection.ConnectionString += ";password=123"; this.taKhoa.Fill(this.DS.KHOA); cmbMAKH.DataSource = bdsKhoa; cmbMAKH.DisplayMember = "MAKH"; cmbMAKH.ValueMember = "MAKH"; String strFilter = ""; int count = cmbMAKH.Items.Count; for (int i = 0; i < count - 1; i++) { cmbMAKH.SelectedIndex = i; strFilter += "[MAKH] = '" + cmbMAKH.SelectedValue + "'OR "; } cmbMAKH.SelectedIndex = count - 1; strFilter += "[MAKH] = '" + cmbMAKH.SelectedValue + "'"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAKH"], new ColumnFilterInfo(strFilter)); this.taGV.Fill(this.DS.GIAOVIEN); this.taBode.Fill(this.DS.BODE); this.taGVDK.Fill(this.DS.GIAOVIEN_DANGKY); }
private void fromGV_Load(object sender, EventArgs e) { taBode.Connection.ConnectionString = this.taGV.Connection.ConnectionString = this.taGVDK.Connection.ConnectionString = taKhoa.Connection.ConnectionString = Program.connstr; this.taKhoa.Fill(this.DS.KHOA); cmbMAKH.DataSource = bdsKhoa; cmbMAKH.DisplayMember = "MAKH"; cmbMAKH.ValueMember = "MAKH"; String strFilter = ""; int count = cmbMAKH.Items.Count; for (int i = 0; i < count - 1; i++) { cmbMAKH.SelectedIndex = i; strFilter += "[MAKH] = '" + cmbMAKH.SelectedValue + "'OR "; } cmbMAKH.SelectedIndex = count - 1; strFilter += "[MAKH] = '" + cmbMAKH.SelectedValue + "'"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAKH"], new ColumnFilterInfo(strFilter)); this.taGV.Fill(this.DS.GIAOVIEN); this.taBode.Fill(this.DS.BODE); this.taGVDK.Fill(this.DS.GIAOVIEN_DANGKY); if (Program.mGroup == "TRUONG") { btnThem.Enabled = btnSua.Enabled = btnXoa.Enabled = false; } }
private void frmDKThi_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'DS.MONHOC' table. You can move, or remove it, as needed. taGVDK.Connection.ConnectionString += ";password=123"; taLop.Connection.ConnectionString = taGVDK.Connection.ConnectionString; taMH.Connection.ConnectionString = taGVDK.Connection.ConnectionString; this.taLop.Fill(this.DS.LOP); this.taMH.Fill(this.DS.MONHOC); this.taGVDK.Fill(this.DS.GIAOVIEN_DANGKY); cmbTrinhdo.Items.AddRange(Program.strTrinhdo); cmbCS.DataSource = Program.bds_dspm; cmbCS.DisplayMember = "COSO"; cmbCS.ValueMember = "TENSERVER"; cmbCS.SelectedIndex = Program.mCoso; cmbMALOP.DataSource = bdsLop; cmbMALOP.DisplayMember = "MALOP"; cmbMALOP.ValueMember = "MALOP"; cmbMAMH.DataSource = bdsMH; cmbMAMH.DisplayMember = "MAMH"; cmbMAMH.ValueMember = "MAMH"; String strFilter = "Contains([MAGV], '" + Program.username + "')"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAGV"], new ColumnFilterInfo(strFilter)); minDate = DateTime.Now; }
private void frmBode_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'DS.GIAOVIEN_DANGKY' table. You can move, or remove it, as needed. taMonhoc.Connection.ConnectionString += ";password=123"; taBode.Connection.ConnectionString += ";password=123"; // TODO: This line of code loads data into the 'DS.MONHOC' table. You can move, or remove it, as needed. this.taBode.Fill(this.DS.BODE); this.taMonhoc.Fill(this.DS.MONHOC); cmbMAMH.DataSource = bdsMonhoc; cmbMAMH.DisplayMember = cmbMAMH.ValueMember = "MAMH"; String strFilter = "Contains([MAGV], '" + Program.username + "')"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAGV"], new ColumnFilterInfo(strFilter)); spnCauhoi.Properties.MinValue = 1; spnCauhoi.Properties.MaxValue = 999999; // TODO: This line of code loads data into the 'dS.BODE' table. You can move, or remove it, as needed. cmbTrinhdo.Items.AddRange(Program.strTrinhdo); }
private void frmBode_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'DS.GIAOVIEN_DANGKY' table. You can move, or remove it, as needed. taMonhoc.Connection.ConnectionString = Program.connstr; taBode.Connection.ConnectionString = Program.connstr; // TODO: This line of code loads data into the 'DS.MONHOC' table. You can move, or remove it, as needed. this.taMonhoc.Fill(this.DS.MONHOC); cmbMAMH.DataSource = bdsMonhoc; cmbMAMH.DisplayMember = "MAMH"; cmbMAMH.ValueMember = "MAMH"; this.taBode.Fill(this.DS.BODE); String strFilter = "Contains([MAGV], '" + Program.username + "')"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAGV"], new ColumnFilterInfo(strFilter)); // TODO: This line of code loads data into the 'dS.BODE' table. You can move, or remove it, as needed. cmbTrinhdo.Items.AddRange(Program.strTrinhdo); if (Program.mGroup == "TRUONG") { btnThem.Enabled = btnSua.Enabled = btnXoa.Enabled = false; } }
private void frmDKThi_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'DS.MONHOC' table. You can move, or remove it, as needed. taGVDK.Connection.ConnectionString = Program.connstr; taLop.Connection.ConnectionString = taGVDK.Connection.ConnectionString; taMH.Connection.ConnectionString = taGVDK.Connection.ConnectionString; this.taLop.Fill(this.DS.LOP); this.taMH.Fill(this.DS.MONHOC); this.taGVDK.Fill(this.DS.GIAOVIEN_DANGKY); cmbTrinhdo.Items.AddRange(Program.strTrinhdo); cmbCS.DataSource = Program.bds_dspm; cmbCS.DisplayMember = "COSO"; cmbCS.ValueMember = "TENSERVER"; cmbCS.SelectedIndex = 1; cmbCS.SelectedIndex = Program.mCoso; this.cmbCS.SelectedIndexChanged += new System.EventHandler(this.cmbCS_SelectedIndexChanged); cmbMALOP.DataSource = bdsLop; cmbMALOP.DisplayMember = "MALOP"; cmbMALOP.ValueMember = "MALOP"; cmbMAMH.DataSource = bdsMH; cmbMAMH.DisplayMember = "MAMH"; cmbMAMH.ValueMember = "MAMH"; String strFilter = "Contains([MAGV], '" + Program.username + "')"; filterInfo = new ViewColumnFilterInfo(gridView1.Columns["MAGV"], new ColumnFilterInfo(strFilter)); minDate = DateTime.Now.Date; if (Program.mGroup == "TRUONG") { btnThem.Enabled = btnSua.Enabled = btnXoa.Enabled = false; cmbCS.Enabled = true; return; } if (Program.mGroup == "COSO") { btnXoa.Enabled = true; } }