private void buttonConectareLogin_Click(object sender, EventArgs e) { username = textBoxUserName.Text; password = textBoxPassword.Text; if (!(string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))) { if (MyOracleConnection.Connect(username, password)) { TipUtilizator tipUtilizator = MyOracleConnection.TypeOfUtilizator(); switch (tipUtilizator) { case TipUtilizator.Admin: FormAdmin formAdmin = new FormAdmin(); MyOracleConnection.utilizatorId = username; formAdmin.setUserLabel(username); this.Hide(); formAdmin.ShowDialog(this); this.Show(); break; case TipUtilizator.Angajat: FormAngajat formAngajat = new FormAngajat(); MyOracleConnection.utilizatorId = username; formAngajat.setUserLabel(username); this.Hide(); formAngajat.ShowDialog(this); this.Show(); break; case TipUtilizator.None: MessageBox.Show("Accesul utilizatorului curent este restrictionat!"); break; } MyOracleConnection.Close(); } else { MessageBox.Show("Introduceti datele corect!"); } } }
public FormEditeazaPontaj(FormAngajat form, DataGridView gridView) : this() { parentForm = form; foreach (DataGridViewRow row in gridView.SelectedRows) { oldValueName = row.Cells[0].Value.ToString(); oldValueNumeProiect = comboBoxProiectEdit.Text = row.Cells[1].Value.ToString(); oldValueOraStart = int.Parse(row.Cells[2].Value.ToString()); comboBoxOraStartEdit.Text = row.Cells[2].Value.ToString(); oldValueOraStop = int.Parse(row.Cells[3].Value.ToString()); comboBoxOraStopEdit.Text = row.Cells[3].Value.ToString(); oldValueTotalOre = int.Parse(row.Cells[4].Value.ToString()); oldValueDate = dateTimePickerEdit.Text = row.Cells[5].Value.ToString(); } }
public FormAdaugaPontaj(FormAngajat form) : this() { parentForm = form; }