Exemplo n.º 1
0
 private void button_LeftSubMenu3_Click(object sender, EventArgs e)
 {
     if (button_LeftSubMenu3.Text == "Thống kê độc giả")
     {
         Ham.openFormInPanel(new DocGiaBCTK(), panel_Content);
     }
     if (button_LeftSubMenu3.Text == "Thống kê sách")
     {
         Ham.openFormInPanel(new SachBCTK(), panel_Content);
     }
     if (button_LeftSubMenu3.Text == "Đăng ký trả")
     {
         Ham.openFormInPanel(new MuonTra(), panel_Content);
     }
     hideSubMenu();
 }
Exemplo n.º 2
0
        private void Menu_Load(object sender, EventArgs e)
        {
            hideSubMenu();
            NHANVIEN nv = Ham.tv.NHANVIENs.Where(x => x.MaNhanVien == Ham.currentUser).SingleOrDefault();

            if (nv == null)
            {
                label_MaNhanVien.Text = "Khách";
                label_HoVaTen.Text    = "Khách";
            }
            else
            {
                label_MaNhanVien.Text        = nv.MaNhanVien;
                label_HoVaTen.Text           = nv.HoVaTen;
                pictureBox_Anh.ImageLocation = nv.Anh == null? Ham.defaultNVImage : nv.Anh;
            }
            Ham.openFormInPanel(new TrangChu(), panel_Content);


            if (DateTime.Now.Day == Ham.lastDaySendReminder.Day && DateTime.Now.Month == Ham.lastDaySendReminder.Month)
            {
            }
            else
            {
                IEnumerable <MUONTRA> allMuon = Ham.tv.MUONTRAs.ToList();
                foreach (var item in allMuon)
                {
                    if ((int)(DateTime.Now - (DateTime)item.NgayHenTra).TotalDays == 7 || (int)(DateTime.Now - (DateTime)item.NgayHenTra).TotalDays == 3 || (int)(DateTime.Now - (DateTime)item.NgayHenTra).TotalDays == 1)
                    {
                        Ham.sendEmailRemindMuon(item.MaMuonTra);
                    }
                }
                var allLastestTDG = Ham.tv.THEDOCGIAs
                                    .GroupBy(x => x.MaDocGia)
                                    .Select(g => new { MaDocGia = g.Key, HanMoi = g.Max(x => x.HanMoi) })
                                    .ToList();
                foreach (var item in allLastestTDG)
                {
                    if ((int)(DateTime.Now - (DateTime)item.HanMoi).TotalDays == 7 || (int)(DateTime.Now - (DateTime)item.HanMoi).TotalDays == 3 || (int)(DateTime.Now - (DateTime)item.HanMoi).TotalDays == 1)
                    {
                        Ham.sendEmailRemindTheDocGia(item.MaDocGia);
                    }
                }
                Ham.lastDaySendReminder = DateTime.Now;
            }
        }
Exemplo n.º 3
0
 private void button_LeftSubMenu2_Click(object sender, EventArgs e)
 {
     if (button_LeftSubMenu2.Text == "Quản lý nhân viên")
     {
         Ham.openFormInPanel(new NhanVien(), panel_Content);
     }
     if (button_LeftSubMenu2.Text == "Quản lý độc giả")
     {
         Ham.openFormInPanel(new DocGia(), panel_Content);
     }
     if (button_LeftSubMenu2.Text == "Quản lý sách")
     {
         Ham.openFormInPanel(new Sach(), panel_Content);
     }
     if (button_LeftSubMenu2.Text == "Đăng ký mượn")
     {
         Ham.openFormInPanel(new MuonTra(), panel_Content);
     }
     hideSubMenu();
 }
Exemplo n.º 4
0
 private void button_LeftSubMenu1_Click(object sender, EventArgs e)
 {
     if (button_LeftSubMenu1.Text == "Tra cứu nhân viên")
     {
         Ham.openFormInPanel(new NhanVien(), panel_Content);
     }
     if (button_LeftSubMenu1.Text == "Tra cứu độc giả")
     {
         Ham.openFormInPanel(new DocGia(), panel_Content);
     }
     if (button_LeftSubMenu1.Text == "Tra cứu sách")
     {
         Ham.openFormInPanel(new Sach(), panel_Content);
     }
     if (button_LeftSubMenu1.Text == "Tra cứu mượn/trả")
     {
         Ham.openFormInPanel(new MuonTra(), panel_Content);
     }
     hideSubMenu();
 }
Exemplo n.º 5
0
 private void button_TrangChu_Click(object sender, EventArgs e)
 {
     Ham.openFormInPanel(new TrangChu(), panel_Content);
 }