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);
            }
        }
        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);
            }
        }
Ejemplo n.º 5
0
        private void frmDoiMatKhau_Load(object sender, EventArgs e)
        {
            lblUserName.Text = TaiKhoanLogic.FullUserName(currentUser);

            txtTenDangNhap.Text = GlobalSettings.UserCode;
        }