Ejemplo n.º 1
0
        private void tmShowItem_Tick(object sender, EventArgs e)
        {
            if (PTB1.Location.X + 185 < 445 && PTB2.Location.X > 585)
            {
                PTB1.Location = new Point(PTB1.Location.X + Temp, PTB1.Location.Y);
                PTB2.Location = new Point(PTB2.Location.X - Temp, PTB2.Location.Y);
            }
            else
            {
                ListPanel[Thu - 2].Location  = new Point(455, 115);
                ListPanel[Thu - 2].Enabled   = true;
                ListPanel[Thu - 2].BackColor = Color.Red;
                ListPanel[Thu - 2].Visible   = true;
                tmShowItem.Stop();

                if (Thu == 8)
                {
                    MSBox mgs = new MSBox("Điểm Danh thành công", "Chúc mừng bạn đã nhận được món quà", "Mở Quà", MSBox.MSBoxIcon.Like);
                    mgs.ShowOnScreen();
                    FrmChuNhat frmchunhat = new FrmChuNhat(ID, NAME);
                    this.Visible = false;
                    frmchunhat.ShowDialog();
                    this.Close();
                }

                MSBox mgb = new MSBox("Điểm Danh thành công", "Chúc bạn chơi vui vẻ! ^v^", "Xác Nhận", MSBox.MSBoxIcon.Infomation);
                mgb.ShowOnScreen();
                FrmMain frmMain = new FrmMain(NAME);
                this.Visible = false;
                frmMain.ShowDialog();
                this.Close();
            }
        }
Ejemplo n.º 2
0
        public void DangNhap()
        {
            bool Check = Check_User();

            if (Check == false)
            {
                MSBox mgb = new MSBox("Error", "Tài Khoản hoặc Mật Khẩu không đúng. Vui lòng kiểm tra lại", "Oke", MSBox.MSBoxIcon.Error);
                mgb.ShowOnScreen();
            }
            else
            {
                // Update Note
                UpdateNote();
                CheckForm(datetime);
            }
        }
Ejemplo n.º 3
0
        private void tmRunChu_Tick(object sender, EventArgs e)
        {
            Dem--;

            if (Dem < 0)
            {
                Image Bgimg = LoadImage(Properties.Resources.GiftOpen, this.Size.Width, this.Size.Height);
                this.BackgroundImage = Bgimg;
                lblChao.Visible      = false;
                PanelQua.Visible     = true;
                tmRunChu.Stop();
                MSBox mgb = new MSBox("Điểm Danh thành công", "Chúc bạn chơi vui vẻ! ^v^", "Xác Nhận", MSBox.MSBoxIcon.Like);
                mgb.ShowOnScreen();
                FrmMain frmMain = new FrmMain(Name);
                this.Visible = false;
                frmMain.ShowDialog();
                this.Close();
            }
            lblChao.Text = Dem.ToString();
        }
Ejemplo n.º 4
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtID.Text))
     {
         MSBox msb = new MSBox("Thông Báo", "ID không được rỗng. Vui lòng kiểm tra lại!", "Đồng ý", MSBox.MSBoxIcon.Infomation);
         msb.ShowDialog();
         //MetroMessageBox.Show(this, "ID không được rỗng. Vui lòng kiểm tra lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, 160);
         txtID.Focus();
     }
     else if (string.IsNullOrEmpty(txtPassword.Text))
     {
         MSBox msb = new MSBox("Thông Báo", "Passwords không được rỗng. Vui lòng kiểm tra lại!", "Đồng ý", MSBox.MSBoxIcon.Infomation);
         msb.ShowDialog();
         //MetroMessageBox.Show(this, "Passwords không được rỗng. Vui lòng kiểm tra lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, 160);
         txtPassword.Focus();
     }
     else
     {
         DANGNHAP();
     }
 }
Ejemplo n.º 5
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            // Kiểm tra rỗng
            if (txtID.Text == "" || txtMK.Text == "")
            {
                MSBox mgb = new MSBox("Error", "Tài Khoản hoặc Mật Khẩu không được rỗng!", "Oke", MSBox.MSBoxIcon.Error);
                mgb.ShowOnScreen();
                txtMK.Clear();
                txtMK.Focus();
            }
            else
            {
                if (ChkLuuID.Checked == true)
                {
                    // Nếu check thì thêm txtID vào file text
                    CheckBox();
                }

                DangNhap();
            }
        }
Ejemplo n.º 6
0
        private void btnChuyen_ChuyenPhong_Click(object sender, EventArgs e)
        {
            DateTime giovao       = DateTime.Now;
            int      tiendatphong = 0;

            foreach (DTO_Room room in MainRooms.lstRoom.Where(room => room.Name == Nameroom))
            {
                giovao       = room.StartTime;
                tiendatphong = room.Tiendatphong;
                break;
            }

            int kq = BUS_Room.Instance.ChuyenPhong(txtPhongHienTai_ChuyenPhong.Text, giovao, cmbPhongMuonChuyen_ChuyenPhong.SelectedItem.ToString(), tiendatphong);

            if (kq != 0)
            {
                MSBox ms = new MSBox("Thông báo", "Chuyển phòng thành công", "Đóng", MSBox.MSBoxIcon.Done);

                //Chuyển trạng thái của phòng cần chuyển
                foreach (var item in MainRooms.lstRoom.Where(name => name.Name == Nameroom))
                {
                    item.Status       = 1;
                    item.Tiendatphong = 0;
                    break;
                }

                //Cập nhật trái thái phòng sắp vào & set thời gian bắt đầu
                foreach (var item in MainRooms.lstRoom.Where(name => name.Name == cmbPhongMuonChuyen_ChuyenPhong.SelectedItem.ToString()))
                {
                    item.Status       = 2;
                    item.StartTime    = giovao;
                    item.Tiendatphong = tiendatphong;
                    break;
                }

                //Đổi màu phòng cần chuyển và phòng đến
                foreach (var item in MainRooms.lstButton.Where(button => button.Name == Nameroom))
                {
                    item.BackColor = Color.FromArgb(-32576);
                    break;
                }


                foreach (
                    var item1 in
                    MainRooms.lstButton.Where(
                        button1 => button1.Name == cmbPhongMuonChuyen_ChuyenPhong.SelectedItem.ToString()))
                {
                    item1.BackColor = Color.FromArgb(-16744448);
                }

                DialogResult dialog = ms.ShowOnScreen();
                if (dialog == System.Windows.Forms.DialogResult.Cancel)
                {
                    this.Close();
                }
            }
            else
            {
                MSBox ms = new MSBox("Thông báo", "Chuyển phòng thất bại", "Đóng", MSBox.MSBoxIcon.Error);
                return;
            }
        }
Ejemplo n.º 7
0
        public void DANGNHAP()
        {
            string[] result = BUS_Login.Instance.Login(txtID.Text, txtPassword.Text);
            if (string.IsNullOrEmpty(result[1]) || result[1].Contains("Nhân Viên") == true)
            {
                MSBox msb = new MSBox("Error", "ID hoặc Passwork không đúng. Vui lòng kiểm tra lại!", "Đồng ý", MSBox.MSBoxIcon.Error);
                msb.ShowDialog();
            }
            else
            {
                INDEX_User = 0;
                if (chkID.Checked == true && temp.Contains(txtID.Text) == false)
                {
                    string RESULT = BUS_Name_Clone.Instance.Set_UserName(temp, txtID.Text);
                    if (!string.IsNullOrEmpty(RESULT))
                    {
                        MSBox msg = new MSBox("Error", "Không ghi nhớ được tên TK. Vui lòng kiểm tra lại!", "Đồng ý", MSBox.MSBoxIcon.Error);
                        msg.ShowDialog();
                    }
                }

                // input get when you login: index_user, name_position
                if (result[1].Contains("ADMIN") == true)
                {
                    frmMain frmmain = new frmMain();
                    this.Visible = false;
                    frmmain.ShowDialog();

                    this.Visible = true;
                    txtPassword.Clear();
                }
                else
                {
                    INDEX_User = Convert.ToInt32(result[0]);
                    string position = result[1];

                    // update status
                    string error = BUS_Login.Instance.Update_status(INDEX_User, "ONLINE");
                    if (!string.IsNullOrEmpty(error))
                    {
                        MessageBox.Show(error);
                    }
                    else
                    {
                        if (position.Contains("Quản Lý") == true)
                        {
                            frmQuanLyNhanVien frmQL = new frmQuanLyNhanVien();
                            this.Visible = false;
                            frmQL.ShowDialog();

                            this.Visible = true;
                            txtPassword.Clear();
                        }
                        else if (position.Contains("Thu Ngân") == true)
                        {
                            // new form thu ngan
                        }
                        else
                        {
                            // new form thu kho
                        }
                    }
                }
            }
        }