Example #1
0
 // Add a new constructor for passing in the main menu form and currently logged in user.
 public FormAdmin(Form callingForm, User user)
 {
     mainMenu    = callingForm as FormMainMenu;
     currentUser = user;
     InitializeComponent();
     LoadData();
 }
Example #2
0
 public FormDashboard(FormMainMenu formMainMenu)
 {
     InitializeComponent();
     emailBox.Focus();
     this.formMainMenu = formMainMenu;
     Text = "Dashboard";
 }
Example #3
0
 private void buttonDN_Click(object sender, EventArgs e)
 {
     try
     {
         if (String.IsNullOrEmpty(textBoxTK.Text))
         {
             MessageBox.Show("Ban chua nhap ten tai khoan!!");
             this.ActiveControl = textBoxTK;
         }
         else if (String.IsNullOrEmpty(textBoxMK.Text))
         {
             MessageBox.Show("Ban chua nhap mat khau!!");
             this.ActiveControl = textBoxMK;
         }
         else
         {
             NguoiDung ndCheck = db.NguoiDungs.SingleOrDefault(x => x.TenUser == textBoxTK.Text && x.MatKhau == textBoxMK.Text);
             if (ndCheck != null)
             {
                 FormMainMenu formMain = new FormMainMenu();
                 formMain.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Tai khoan hoac mat khau sai!!");
                 textBoxTK.Clear();
                 textBoxMK.Clear();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #4
0
 public FormCheckin(FormMainMenu fmm)
 {
     InitializeComponent();
     this.formMainMenu = fmm;
     LoadCheckedoutEquipment();
     Text = "Check In";
 }
    // ***************************************************
    // Start [Monobehavior]
    // ---------------------------------------------------
	void Start()
    {
        mInstance = this;

        Hide();
        Show();
        GuiMall();
	}
Example #6
0
 public FormProfile(Form callingForm, User user)
 {
     mainMenu    = callingForm as FormMainMenu;
     currentUser = user;
     InitializeComponent();
     this.Text = user.Username;
     // Populate fields with current user passed to the form.
     lbl_usernameData.Text = user.Username;
     lbl_emailData.Text    = user.Email;
 }
Example #7
0
 public FormLogin(Form callingForm, string message = "")
 {
     mainMenu = callingForm as FormMainMenu;
     InitializeComponent();
     // If a message is sent when opening the form, display it.
     if (message != "")
     {
         lbl_errorMessage.Text = message;
         panel_error.Visible   = true;
     }
 }
Example #8
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     panel2.Width += 5;
     if (panel2.Width >= 700)
     {
         timer1.Stop();
         FormMainMenu mainMenu = new FormMainMenu();
         mainMenu.Show();
         this.Hide();
     }
 }
 public FormAccountSettings(FormMainMenu fmm)
 {
     InitializeComponent();
     this.formMainMenu     = fmm;
     UserIDLabel.Text      = formMainMenu.id;
     FirstNameLabel.Text   = formMainMenu.fname;
     LastNameLabel.Text    = formMainMenu.lname;
     EmailLabel.Text       = formMainMenu.UserEmail;
     PhoneNumberLabel.Text = formMainMenu.phone;
     CurrentFineLabel.Text = "$" + formMainMenu.fine;
     Text = "Account";
 }
Example #10
0
        public FormStock(FormMainMenu fmm)
        {
            InitializeComponent();
            LoadEquipmentList();
            Text = "Stock";
            this.formMainMenu = fmm;
            activeFilter      = "All";

            if (formMainMenu.isLoggedIn == false)
            {
                CheckOutBtn.Hide();
            }
            else
            {
                CheckOutBtn.Show();
            }
        }
Example #11
0
        private void buttonDangNhap_Click(object sender, EventArgs e)
        {
            FormMainMenu fm = new FormMainMenu();

            try
            {
                if (String.IsNullOrEmpty(textBoxTK.Text))
                {
                    MessageBox.Show("Ban chua nhap ten tai khoan!!");
                    this.ActiveControl = textBoxTK;
                }
                else if (String.IsNullOrEmpty(textBoxMK.Text))
                {
                    MessageBox.Show("Ban chua nhap mat khau!!");
                    this.ActiveControl = textBoxMK;
                }
                else
                {
                    UserTaiKhoan user = db.UserTaiKhoans.SingleOrDefault(x => x.TaiKhoan == textBoxTK.Text &&
                                                                         x.MatKhau == textBoxTK.Text);
                    if (user != null)
                    {
                        this.Hide();
                        fm.ShowDialog();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Tai khoan hoac mat khau khong dung!!!");
                        textBoxTK.Clear();
                        textBoxMK.Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            FormMainMenu frm;

            if (passText.Text == "admin" && radioButton1.Checked)
            {
                frm = new FormMainMenu("YÖNETİCİ");
                frm.Show();
                this.Hide();
            }
            else if (passText.Text == "kasa1" && radioButton2.Checked)
            {
                frm = new FormMainMenu("KASA1");
                frm.Show();
                this.Hide();
            }
            else if (passText.Text == "kasa2" && radioButton3.Checked)
            {
                frm = new FormMainMenu("KASA2");
                frm.Show();
                this.Hide();
            }
            else if (passText.Text == "kasa3" && radioButton4.Checked)
            {
                frm = new FormMainMenu("KASA3");
                frm.Show();
                this.Hide();
            }
            else if (passText.Text == "kasa4" && radioButton5.Checked)
            {
                frm = new FormMainMenu("KASA4");
                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Giriş!");
            }
        }
Example #13
0
 public FormRegister(Form callingForm)
 {
     mainMenu = callingForm as FormMainMenu;
     InitializeComponent();
 }
Example #14
0
 // ***************************************************
 // OnDestroy [Monobehavior]
 // ---------------------------------------------------
 void OnDestroy()
 {
     mInstance = null;
 }
Example #15
0
 public FormCheckout(FormMainMenu formMainMenu)
 {
     InitializeComponent();
     this.formMainMenu = formMainMenu;
 }
Example #16
0
        /*public FormRegister()
         * {
         *  InitializeComponent();
         * }*/

        public FormRegister(FormMainMenu formMainMenu)
        {
            InitializeComponent();
            firstNameBox.Focus();
            this.formMainMenu = formMainMenu;
        }
 public FormAddEquipment(FormMainMenu fmm)
 {
     InitializeComponent();
     this.formMainMenu = fmm;
 }