private void grvGiaoVien_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (grvGiaoVien.DataRowCount > 0) { idxGV = grvGiaoVien.FocusedRowHandle; DataRow dr = grvGiaoVien.GetDataRow(idxGV); oBGiaoVien.ToInfo(ref pGiaoVienInfo, dr); drGiaoVien = grvGiaoVien.GetDataRow(grvGiaoVien.FocusedRowHandle); LoadQuaTrinhKyLuat(); ClearText(); grvQuaTrinhKyLuat_FocusedRowChanged(null, null); if (grvQuaTrinhKyLuat.DataRowCount > 0) { SetButton(true); } else { SetButton(false); btnThem.Enabled = true; } } else { SetButton(false); btnThem.Enabled = true; layXoaKyLuat.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; grdQuaTrinhKyLuat.DataSource = null; } }
private void grvGiaoVien_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (grvGiaoVien.DataRowCount > 0) { idxGV = grvGiaoVien.FocusedRowHandle; DataRow dr = grvGiaoVien.GetDataRow(idxGV); oBGiaoVien.ToInfo(ref pGiaoVienInfo, dr); drGiaoVien = grvGiaoVien.GetDataRow(grvGiaoVien.FocusedRowHandle); LoadPhuCap(); ClearText(); grvPhuCap_FocusedRowChanged(null, null); if (grvPhuCap.DataRowCount > 0) { SetButton(true); } else { SetButton(false); btnThem.Enabled = true; } } else { SetButton(false); btnThem.Enabled = true; grdPhuCap.DataSource = null; } }
private void grvGiaoVien_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (grvGiaoVien.DataRowCount > 0) { idxGV = grvGiaoVien.FocusedRowHandle; LoadChucVuBoNhiem(int.Parse(grvGiaoVien.GetDataRow(grvGiaoVien.FocusedRowHandle)["NS_GiaoVienID"].ToString())); DataRow dr = grvGiaoVien.GetDataRow(idxGV); oBGiaoVien.ToInfo(ref pGiaoVienInfo, dr); drGiaoVien = grvGiaoVien.GetDataRow(grvGiaoVien.FocusedRowHandle); LoadQuaTrinhMienNhiemTuChuc(); ClearText(); grvQuaTrinhMienNhiemTuChuc_FocusedRowChanged(null, null); if (grvQuaTrinhMienNhiemTuChuc.DataRowCount > 0) { SetButton(true); } else { SetButton(false); btnThem.Enabled = true; } } else { SetButton(false); btnThem.Enabled = true; grdQuaTrinhMienNhiemTuChuc.DataSource = null; } }
/// <summary> /// Kiểm tra đăng nhập /// </summary> /// <param name="UserName">Tên đăng nhập</param> /// <param name="Password">Mật khẩu</param> /// <param name="lstUsers">Danh sách người dùng</param> /// <param name="objUser">Đối tượng người dùng</param> /// <returns>True/False</returns> /// <remarks></remarks> private bool CheckLogIn(string UserName, string Password) { DataTable dtGiaoVien = oBNS_GiaoVien.GetByUsername(UserName); if (dtGiaoVien.Rows.Count > 0) { if (Lib.clsAuthentication.Decrypt("" + dtGiaoVien.Rows[0]["Password"]) == Password) { oBNS_GiaoVien.ToInfo(ref pNS_GiaoVienInfo, dtGiaoVien.Rows[0]); Program.objUserCurrent = pNS_GiaoVienInfo; return(true); } } return(false); }
private void grvGiaoVien_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (grvGiaoVien.DataRowCount > 0) { SetButton(true); idxGV = grvGiaoVien.FocusedRowHandle; DataRow dr = grvGiaoVien.GetDataRow(idxGV); oBGiaoVien.ToInfo(ref pGiaoVienInfo, dr); LoadGiaoVien_MonHoc(int.Parse(grvGiaoVien.GetDataRow(idxGV)[pGiaoVienInfo.strNS_GiaoVienID].ToString())); drGiaoVien = grvGiaoVien.GetDataRow(grvGiaoVien.FocusedRowHandle); } else { grdMonDay.DataSource = null; SetButton(false); } }