Example #1
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            switch (lblStatus.Text)
            {
            case "HỒ SƠ NHÂN VIÊN":
                DataTable     dataGrid = new DataTable();
                BindingSource SBind    = new BindingSource();
                SBind.DataSource           = frmHoSoNhanVien.dataTable;
                frmHoSoNhanVien.dataTable2 = frmHoSoNhanVien.dataTable;
                try
                {
                    frmHoSoNhanVien.Action = "Export";
                    frmHoSoNhanVien hoSoNhanVien = new frmHoSoNhanVien();
                    hoSoNhanVien.IsExport1 = true;

                    hoSoNhanVien.ExportExcel();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("" + ex);
                }
                break;

            case "CHẤM CÔNG":
                break;

            case "":
                break;

            default:
                break;
            }
        }
Example #2
0
 private void cbSearch_KeyDown(object sender, KeyEventArgs e)
 {
     IsSearch = true;
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab)
     {
         if (cbSearch.SelectedItem != null)
         {
             lblStatus.Text = "TÌM NHÂN VIÊN - " + cbSearch.SelectedValue.ToString();
             frmHoSoNhanVien frmHoSoNhanVien = new frmHoSoNhanVien();
             frmHoSoNhanVien.Action = "Tìm kiếm";
             //frmHoSoNhanVien.TenNhanVien = txtSearch.Text;
             string MaNV = cbSearch.SelectedValue.ToString();
             MaNV = MaNV.Split('-')[1];
             frmHoSoNhanVien.MaNhanVien = Convert.ToInt32(MaNV.Trim());
             frmHoSoNhanVien.TopLevel   = false;
             frmHoSoNhanVien.MdiParent  = this.MdiParent;
             PanelCenter.Controls.Add(frmHoSoNhanVien);
             frmHoSoNhanVien.Dock = DockStyle.Fill;
             frmHoSoNhanVien.Show();
             frmHoSoNhanVien.BringToFront();
             cbSearch.SelectedItem = null;
             cbSearch.SelectedText = "Tìm kiếm hồ sơ nhân sự";
         }
         else
         {
             MessageBox.Show("Không tìm thấy nhân viên");
         }
     }
 }
Example #3
0
        private void btnDashboard_Click(object sender, EventArgs e)
        {
            Form   frmLayouLogin = new frmLayoutLogin();
            Button bt            = (Button)sender;

            //bt = (Button)sender;
            //frmLayouLogin.Show();
            //FormChild<frmLogin>();
            //if (sender.GetType().Name == "Button")
            //{
            //     bt = (Button)sender;
            //}
            //else
            //{
            //    bt = (Bunifu.Framework.UI.BunifuTileButton)sender;
            //}

            //Bunifu.Framework.UI.BunifuTileButton bunifuTileButton = (Bunifu.Framework.UI.BunifuTileButton)sender;
            if (bt.Name == "btnDashboard")
            {
                lblStatus.Text = "DASHBOARD";
                //FormChild<frmLogin>();
                btnDashboard.BackColor = Color.FromArgb(81, 136, 202);
                btnDashboard.ForeColor = Color.White;
                iconDashboard.Image    = ((System.Drawing.Image)(resources.GetObject("iconDashboard.ImageActive")));
            }
            else
            {
                btnDashboard.BackColor = Color.Transparent;
                btnDashboard.ForeColor = Color.Black;
                iconDashboard.Image    = ((System.Drawing.Image)(resources.GetObject("iconDashboard.Image")));
            }

            if (bt.Name == "btnNhanVien" || bt.Name == "btnImport")
            {
                lblStatus.Text = "HỒ SƠ NHÂN VIÊN";
                frmHoSoNhanVien frmHoSoNhanVien = new frmHoSoNhanVien();
                frmHoSoNhanVien.Action    = "Không tìm kiếm";
                frmHoSoNhanVien.TopLevel  = false;
                frmHoSoNhanVien.MdiParent = this.MdiParent;
                PanelCenter.Controls.Add(frmHoSoNhanVien);
                frmHoSoNhanVien.Dock = DockStyle.Fill;
                frmHoSoNhanVien.Show();
                frmHoSoNhanVien.BringToFront();

                btnNhanVien.BackColor = Color.FromArgb(81, 136, 202);
                btnNhanVien.ForeColor = Color.White;
                iconNhanVien.Image    = ((System.Drawing.Image)(resources.GetObject("iconNhanVien.ImageActive")));
            }
            else
            {
                btnNhanVien.BackColor = Color.Transparent;
                btnNhanVien.ForeColor = Color.Black;
                iconNhanVien.Image    = ((System.Drawing.Image)(resources.GetObject("iconNhanVien.Image")));
            }

            if (bt.Name == "btnChamCong")
            {
                lblStatus.Text = "CHẤM CÔNG";
                //FormChild<frmLogin>();
                btnChamCong.BackColor = Color.FromArgb(81, 136, 202);
                btnChamCong.ForeColor = Color.White;
                iconChamCong.Image    = ((System.Drawing.Image)(resources.GetObject("iconChamCong.ImageActive")));
            }
            else
            {
                btnChamCong.BackColor = Color.Transparent;
                btnChamCong.ForeColor = Color.Black;
                iconChamCong.Image    = ((System.Drawing.Image)(resources.GetObject("iconChamCong.Image")));
            }

            if (bt.Name == "btnBangLuong")
            {
                lblStatus.Text = "BẢNG LƯƠNG";
                //FormChild<frmLogin>();
                btnBangLuong.BackColor = Color.FromArgb(81, 136, 202);
                btnBangLuong.ForeColor = Color.White;
                iconBangLuong.Image    = ((System.Drawing.Image)(resources.GetObject("iconChamCong.ImageActive")));
            }
            else
            {
                btnBangLuong.BackColor = Color.Transparent;
                btnBangLuong.ForeColor = Color.Black;
                iconBangLuong.Image    = ((System.Drawing.Image)(resources.GetObject("iconChamCong.Image")));
            }
        }