private void frmTrangMoDau_Load(object sender, EventArgs e)
        {
            try
            {
                lblCenter.Text      = string.Format("{0}", GlobalSettings.TrungTam_Name).ToUpper();
                lblAddress.Text     = string.Format("Địa chỉ: {0}", GlobalSettings.TrungTam_DiaChi);
                lblSoDienThoai.Text = string.Format("Hotline: {0}", GlobalSettings.TrungTam_Phone);
                lblLienHe.Text      = string.Format("Liên hệ: {0} - {1}", GlobalSettings.TrungTam_Website, GlobalSettings.TrungTam_Email);

                piclogotrungtam.Image = Image.FromFile(@"Picture\logo.jpg");

                //Co so trung tam
                lblCoSo_Ten.Text    = string.Format("{0}", GlobalSettings.CoSo_Ten).ToUpper();
                lblCoSo_DiaChi.Text = string.Format("Địa chỉ: {0}", GlobalSettings.CoSo_DiaChi);
                lblCoSo_SDT.Text    = string.Format("Hotline: {0}", GlobalSettings.CoSo_Sdt);
                lblCoSo_Email.Text  = string.Format("Liên hệ: {0} - {1}", GlobalSettings.CoSo_Email, GlobalSettings.TrungTam_Email);
                picCoSo_image.Image = GlobalSettings.CoSo_LogoCoSo;



                lblWelcome.Text = string.Format("Xin chào, {0}", TaiKhoanLogic.FullUserName(new DataAccess.TAIKHOAN()
                {
                    TenDangNhap = GlobalSettings.UserCode
                }));
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Warn(ex);
            }
        }
Пример #2
0
        private void gridViewTaiKhoan_Click(object sender, EventArgs e)
        {
            try
            {
                if (gridViewTaiKhoan.RowCount > 0)
                {
                    var rowHandle   = gridViewTaiKhoan.FocusedRowHandle;
                    int _taikhoanId = O2S_Common.TypeConvert.Parse.ToInt32(gridViewTaiKhoan.GetRowCellValue(rowHandle, "TaiKhoanId").ToString());

                    //hien thi tai khoan hien tai len form
                    this.TaiKhoan_Select = TaiKhoanLogic.SelectSingle(_taikhoanId);
                    txtTenDangNhap.Text  = this.TaiKhoan_Select.TenDangNhap;
                    txtMatKhau.Text      = O2S_Common.EncryptAndDecrypt.MD5EncryptAndDecrypt.Decrypt(this.TaiKhoan_Select.MatKhau, true);

                    LoadPhanQuyenTheoTaiKhoan(_taikhoanId);
                }
                else
                {
                    this.TaiKhoan_Select = new TAIKHOAN();
                }
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Warn(ex);
            }
        }
        private void ValidateTrungTaiKhoan(string _tendangnhap)
        {
            TAIKHOAN _taikhoan = TaiKhoanLogic.SelectTheoTenDangNhap(_tendangnhap);

            if (_taikhoan != null)
            {
                throw new ArgumentException("Tên đăng nhập đã có người sử dụng\nVui lòng lấy tên đăng nhập khác");
            }
        }
Пример #4
0
 private void LoadDanhSachTaiKhoan()
 {
     try
     {
         TaiKhoanFilter _filter = new TaiKhoanFilter();
         _filter.LoaiTaiKhoanId = O2S_Common.TypeConvert.Parse.ToInt32(cboLoaiTaiKhoan.SelectedValue.ToString());
         List <TaiKhoan_PlusDTO> _lstTaiKhoan = TaiKhoanLogic.SelectFilter(_filter);
         gridControlTaiKhoan.DataSource = _lstTaiKhoan;
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Error(ex);
     }
 }
        private void frmBangDiem_Load(object sender, EventArgs e)
        {
            lblTitle.Text = string.Format("Bảng điểm của {0}", TaiKhoanLogic.FullUserName(new TAIKHOAN()
            {
                TenDangNhap = GlobalSettings.UserCode
            }));
            cboLop.DataSource    = BangDiemLogic.SelectDSLop(GlobalSettings.UserID);
            cboLop.DisplayMember = "TenLopHoc";
            cboLop.ValueMember   = "LopHocId";

            lblTenLop.Text = lblTenKhoaHocoa.Text = string.Empty;

            lblDiemTrungBinh.Text = 0.ToString();

            isLoaded = true;
            cboLop_SelectedValueChanged(sender, e);
        }
        private void btnInBangDiem_Click(object sender, EventArgs e)
        {
            frmReport frm = new frmReport();

            List <ReportParameter> _params = new List <ReportParameter>()
            {
                new ReportParameter("CenterName", GlobalSettings.TrungTam_Name),
                new ReportParameter("CenterWebsite", GlobalSettings.TrungTam_Website),
                new ReportParameter("MaHocVien", GlobalSettings.UserID.ToString()),
                new ReportParameter("TenHocVien", TaiKhoanLogic.FullUserName(new TAIKHOAN()
                {
                    TenDangNhap = GlobalSettings.UserCode
                })),
                new ReportParameter("MaLop", cboLop.SelectedValue.ToString()),
                new ReportParameter("TenLop", lblTenLop.Text),
                new ReportParameter("TenKhoaHoc", lblTenKhoaHocoa.Text),
                new ReportParameter("DiemTB", lblDiemTrungBinh.Text)
            };

            frm.ReportViewer.LocalReport.ReportPath = @"Reports\rptInBangDiem.rdlc";

            dsSource.dtBangDiemHocVienDataTable dt = new dsSource.dtBangDiemHocVienDataTable();
            for (int i = 0; i < gridViewDSDiem.RowCount; i++)
            {
                dt.Rows.Add(gridViewDSDiem.GetRowCellValue(i, "MaMonHoc").ToString(), gridViewDSDiem.GetRowCellValue(i, "TenMonHoc").ToString(), gridViewDSDiem.GetRowCellValue(i, "Diem").ToString());
            }

            //var query = BangDiem.SelectBangDiemLop(gridLop.SelectedRows[0].Cells["clmMaLop"].Value.ToString());
            //var bangDiem = BangDiem.SelectDetail(maHV, maLop);
            //gridControlDSDiem.DataSource = bangDiem.BangDiemChiTiets;

            //foreach (var i in query)
            //{
            //    dt.Rows.Add(i.MaHocVien, i.TenHocVien, i.DiemTrungBinh);
            //}

            frm.ReportViewer.LocalReport.DataSources.Clear();
            frm.ReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", (DataTable)dt));

            frm.ReportViewer.LocalReport.SetParameters(_params);
            frm.ReportViewer.LocalReport.DisplayName = "Bảng điểm học viên";
            frm.Text = "Bảng điểm học viên";

            frm.ShowDialog();
        }
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtTenDangNhap.Text.ToLower() == KeyTrongPhanMem.AdminUser_key && txtMatKhau.Text == KeyTrongPhanMem.AdminPass_key)
                {
                    //TAIKHOAN tk = TaiKhoan.Select(txtTenDangNhap.Text);
                    GlobalSettings.UserID   = -1;
                    GlobalSettings.UserCode = txtTenDangNhap.Text.Trim().ToLower();
                    GlobalSettings.UserName = "******";
                    GlobalSettings.UserType = UserType.QuanTri;

                    //Settings.Default.Login_UserName = txtTenDangNhap.Text;
                    //Settings.Default.Login_Password = txtMatKhau.Text;
                    //Settings.Default.Save();
                    LoadDuLieuSauKhiDangNhap();
                }
                else
                {
                    if (TaiKhoanLogic.IsValid(txtTenDangNhap.Text, txtMatKhau.Text))
                    {
                        TAIKHOAN _taikhoan = TaiKhoanLogic.SelectTheoTenDangNhap(txtTenDangNhap.Text);
                        GlobalSettings.UserID   = _taikhoan.TaiKhoanId;//TaiKhoanLogic.FullUserID(_taikhoan);
                        GlobalSettings.UserCode = txtTenDangNhap.Text.Trim().ToLower();
                        GlobalSettings.UserName = TaiKhoanLogic.FullUserName(_taikhoan);
                        GlobalSettings.UserType = (UserType)TaiKhoanLogic.FullUserType(_taikhoan);

                        //Settings.Default.Login_UserName = txtTenDangNhap.Text;
                        //Settings.Default.Login_Password = txtMatKhau.Text;
                        //Settings.Default.Save();
                        Base.KiemTraLicense.KiemTraLicenseHopLe();
                        LoadDuLieuSauKhiDangNhap();
                    }
                    else
                    {
                        lblNotification.Text = "Tên đăng nhập hoặc mật khẩu không chính xác";
                        System.Media.SystemSounds.Exclamation.Play();
                    }
                }
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Error(ex);
            }
        }
 private void btnTaiKhoan7So_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         if (TaiKhoanLogic.UpdateMaDangNhap7So())
         {
             MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Cập nhật thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Warn(ex);
     }
 }
Пример #9
0
        private void frmDoiMatKhau_Load(object sender, EventArgs e)
        {
            lblUserName.Text = TaiKhoanLogic.FullUserName(currentUser);

            txtTenDangNhap.Text = GlobalSettings.UserCode;
        }
Пример #10
0
 public frmDoiMatKhau(string userName)
 {
     InitializeComponent();
     this.currentUser = TaiKhoanLogic.SelectTheoTenDangNhap(userName);
 }
Пример #11
0
        private void btnLuuThongTin_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.TaiKhoan_Select != null)
                {
                    //Update TAIKHOAN: passs
                    this.TaiKhoan_Select.MatKhau = txtMatKhau.Text;

                    //Update PHANQUYENTAIKHOAN
                    List <PHANQUYENTAIKHOAN> _lstPQ_TK_All = new List <PHANQUYENTAIKHOAN>();
                    foreach (var _item in this.lstPQ_TK_ChucNang)
                    {
                        if (_item.IsCheck)
                        {
                            PHANQUYENTAIKHOAN _phanquyen = new PHANQUYENTAIKHOAN
                            {
                                TaiKhoanId = this.TaiKhoan_Select.TaiKhoanId,
                                ChucNangId = _item.ChucNangId,
                                Them       = _item.Them == true ? 1 : 0,
                                Sua        = _item.Sua == true ? 1 : 0,
                                Xoa        = _item.Xoa == true ? 1 : 0,
                                InAn       = _item.InAn == true ? 1 : 0,
                                XuatFile   = _item.XuatFile == true ? 1 : 0,
                            };
                            _lstPQ_TK_All.Add(_phanquyen);
                        }
                    }
                    foreach (var _item in this.lstPQ_TK_BaoCao)
                    {
                        if (_item.IsCheck)
                        {
                            PHANQUYENTAIKHOAN _phanquyen = new PHANQUYENTAIKHOAN
                            {
                                TaiKhoanId = this.TaiKhoan_Select.TaiKhoanId,
                                ChucNangId = _item.ChucNangId,
                                Them       = _item.Them == true ? 1 : 0,
                                Sua        = _item.Sua == true ? 1 : 0,
                                Xoa        = _item.Xoa == true ? 1 : 0,
                                InAn       = _item.InAn == true ? 1 : 0,
                                XuatFile   = _item.XuatFile == true ? 1 : 0,
                            };
                            _lstPQ_TK_All.Add(_phanquyen);
                        }
                    }

                    if (TaiKhoanLogic.Update(this.TaiKhoan_Select) && PhanQuyenTaiKhoanLogic.DeleteAndInsert(_lstPQ_TK_All, this.TaiKhoan_Select.TaiKhoanId))
                    {
                        O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.CAP_NHAT_THANH_CONG);
                        frmthongbao.Show();
                    }
                    else
                    {
                        O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.CAP_NHAT_THAT_BAI);
                        frmthongbao.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Warn(ex);
            }
        }