public FormFinanceEtatsGlobal(FormFinance finance) { InitializeComponent(); _formFinance = finance; cbYearMois.Text = cbYear.Text = DateTime.Now.Year.ToString(); cbMonth.SelectedIndex = DateTime.Now.Month - 1; }
private void btnLogin_Click(object sender, EventArgs e) { String userName = txtUn.Text; String password = txtPw.Text; String pass = null; String jobRole = null; String q = "select password,jobRole from employee where employeeID = '" + userName + "'"; using (DBConnect db = new DBConnect()) { MySqlCommand cmd = new MySqlCommand(q, db.con); MySqlDataReader r = cmd.ExecuteReader(); if (r.HasRows) { while (r.Read()) { pass = r["password"].ToString(); jobRole = r["jobRole"].ToString(); } if (pass.Equals(password)) { if (jobRole.Equals("Receptionist")) { frmMain m = new frmMain(txtUn.Text); this.Hide(); m.Show(); } else if (jobRole.Equals("Manager")) { frmHome home = new frmHome(txtUn.Text); this.Hide(); home.Show(); } else if (jobRole.Equals("StockManager")) { InventoryMain inv = new InventoryMain(txtUn.Text); this.Hide(); inv.Show(); } else if (jobRole.Equals("FinanceManager")) { FormFinance fiance = new FormFinance(txtUn.Text); fiance.Show(); this.Hide(); } else if (jobRole.Equals("RestaurantManager")) { Rest_Managment.RestManagment res = new Rest_Managment.RestManagment(txtUn.Text); res.Show(); this.Hide(); } } else { MessageBox.Show("Invalid Password"); } } else { MessageBox.Show("Invalid user name"); } } }
public void doAfterLogin(string userSkr, string area) { this.area = area; if (statusForm == 1) { FormCEO f = new FormCEO(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.Show(); f.Location = new Point(0, 0); } if (statusForm == 2) { FormKepCab f = new FormKepCab(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.update_area(area); f.Show(); f.Location = new Point(0, 0); } else if (statusForm == 3) { FormFinance f = new FormFinance(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.Show(); f.Location = new Point(0, 0); } if (statusForm == 4) { FormPetty f = new FormPetty(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.update_area(area); f.Show(); f.Location = new Point(0, 0); } else if (statusForm == 5) { tambahMenuStrip(); } else if (statusForm == 6) { tambahMenuStrip(); } else if (statusForm == 7) { FormAccounting f = new FormAccounting(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.Show(); f.Location = new Point(0, 0); } else if (statusForm == 8) { FormAEPO f = new FormAEPO(); f.MdiParent = this; f.FormBorderStyle = FormBorderStyle.None; f.ControlBox = false; f.kode = kodeuser; f.status = 1; f.Text = "History Cash Adv"; f.Show(); f.Location = new Point(0, 0); f.updateDGVCashAdv(); f.dataGridViewCA.Invalidate(); } else if (statusForm == 9) { tambahMenuStrip(); } }