private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { lc = new LopController(); if (lc.CheckErr(cbMaLop.Text.Trim(), txtViTri.Text.Trim(), txtSiSo.Text.Trim(), cbMaGV.Text.Trim())) { if (_ID == null) { if (lc.ThemLop(cbMaLop.Text.Trim(), txtViTri.Text.Trim(), int.Parse(txtSiSo.Text.Trim()), cbMaGV.Text.Trim())) { MessageBox.Show("Thành Công", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Lỗi", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { if (lc.SuaLop(cbMaLop.Text.Trim(), txtViTri.Text.Trim(), int.Parse(txtSiSo.Text.Trim()), cbMaGV.Text.Trim(), cbMaLop.Text.Trim())) { MessageBox.Show("Thành Công", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Lỗi", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void cmbLop_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbLop.SelectedIndex != -1) { this.PhanLopController.HienThiDS(this.lvDSLopHoc, ((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); LopInfo lop = new LopController().LayTuMa(((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbLop_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbLop.SelectedIndex != -1) { LopController lopCtrl = new LopController(); LopInfo lopInfo = lopCtrl.LayTuMa(((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); this.MonHocController.HienThiDS(this.lvDMMonHoc, lopInfo); this.LopMonHocController.HienThiDS(this.lvDSMonHocDuocChon, lopInfo); } }
public void LoadCBB() { KhoaController khoaControll = new KhoaController(); _cbbkhoa.ItemsSource = khoaControll.GetAllKhoa; _cbbkhoa.DisplayMemberPath = "TenKhoa"; LopController lopControll = new LopController(); _cbblop.ItemsSource = lopControll.GetAllLop; _cbblop.DisplayMemberPath = "TenLop"; }
public frmKhoaLop() { InitializeComponent(); khoaControll = new KhoaController(); lopControll = new LopController(); LoadKTable(); LoadLTable(); if (App.Role.AddAll == true) { _btnaddK.IsEnabled = true; _btnaddL.IsEnabled = true; _btnaddK_cancel.IsEnabled = true; _btnaddL_cancel.IsEnabled = true; } else { if (App.Role.AddDocGia != true) { _btnaddK.IsEnabled = false; _btnaddL.IsEnabled = false; _btnaddK_cancel.IsEnabled = false; _btnaddL_cancel.IsEnabled = false; } } if (App.Role.EditAll == true) { _btnsaveK.IsEnabled = true; _btnsaveL.IsEnabled = true; } else { if (App.Role.EditDocGia != true) { _btnsaveK.IsEnabled = false; _btnsaveL.IsEnabled = false; } } if (App.Role.DeleteAll == true) { _btndeleteK.IsEnabled = true; _btndeleteL.IsEnabled = true; } else { if (App.Role.DeleteDocGia != true) { _btndeleteK.IsEnabled = false; _btndeleteL.IsEnabled = false; } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void botBoQua_Click(object sender, EventArgs e) { this.cmbNamHoc.Enabled = true; this.cmbKhoiLop.Enabled = true; this.cmbLop.Enabled = true; LopController lopCtrl = new LopController(); LopInfo lopInfo = lopCtrl.LayTuMa(((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); this.MonHocController.HienThiDS(this.lvDMMonHoc, lopInfo); this.LopMonHocController.HienThiDS(this.lvDSMonHocDuocChon, lopInfo); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbLop_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbLop.SelectedIndex != -1) { this.PhanLopController.HienThiDS(this.lvDSLopHoc, ((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); LopInfo lop = new LopController().LayTuMa(((DataRowView)this.cmbLop.SelectedItem).Row.ItemArray[0].ToString()); this.LopMonHocController.HienThiComboBox(this.cmbMonHoc, lop, Utilities.TTNguoiDungDangNhap.GiaoVien); } else { this.PhanLopController.HienThiDS(this.lvDSLopHoc, ""); LopInfo lop = new LopInfo(); this.LopMonHocController.HienThiComboBox(this.cmbMonHoc, lop, Utilities.TTNguoiDungDangNhap.GiaoVien); } }
public void Hienthi() { lstLop = LopController.getAllDataClass(); DataTable dt = ViewHelper.ToDataTable <Lop>(lstLop); dtgLopHoc.DataSource = dt; dtgLopHoc.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dt.Columns["Malop"].ColumnName = "Mã Lớp"; dt.Columns["TenLop"].ColumnName = "Tên Lớp"; dt.Columns["NiemKhoa"].ColumnName = "Niêm khóa"; int j = 0; foreach (DataGridViewColumn col in dtgLopHoc.Columns) { col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; col.HeaderCell.Style.Font = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Pixel); dtgLopHoc.Columns[j].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; j++; } try { dtgLopHoc.CurrentCell = dtgLopHoc[CurCl, CurR]; } catch { } //lblTongSL.Text = GetTongSobanGhi("select * from Lop").ToString(); dtgLopHoc.Refresh(); }
public List <lop> getDsLop(String search) { LopController lopConTroller = new LopController(); return(lopConTroller.searchListLop(search)); }
public List <lop> getDsLop() { LopController lopConTroller = new LopController(); return(lopConTroller.getListLop()); }
public frmThaoTacLop(string id) { InitializeComponent(); _ID = id; lc = new LopController(); //Xử lý mã Môn DataTable ml = sqlHelper.Query("SELECT MaLop FROM Lop"); List <DataRow> list = ml.AsEnumerable().ToList(); for (int i = 0; i < list.Count; i++) { ComboboxItem item = new ComboboxItem(); item.Text = list[i].ItemArray[0].ToString(); item.Value = list[i].ItemArray[0].ToString(); cbMaLop.Items.Add(item); } //Xử lý mã HocSinh DataTable mhs = sqlHelper.Query("SELECT MaGV FROM GiaoVien"); List <DataRow> list1 = mhs.AsEnumerable().ToList(); for (int i = 0; i < list1.Count; i++) { ComboboxItem item1 = new ComboboxItem(); item1.Text = list1[i].ItemArray[0].ToString(); item1.Value = list1[i].ItemArray[0].ToString(); cbMaGV.Items.Add(item1); } if (id == null) { cbMaLop.Enabled = true; return; } Lop l = new Lop(); l = lc.GetData(id); txtSiSo.Text = l.SiSo.ToString(); txtViTri.Text = l.ViTri; for (int i = 0; i < list.Count; i++) { if (l.Malop == list[i].ItemArray[0].ToString()) { cbMaLop.SelectedIndex = i; l.Malop = cbMaLop.Text; break; } } for (int i = 0; i < list1.Count; i++) { if (l.MaGV == list1[i].ItemArray[0].ToString()) { cbMaGV.SelectedIndex = i; l.MaGV = cbMaGV.Text; break; } } //Xử lý mã lớp }