示例#1
0
        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!");
                }
            }
        }
示例#2
0
        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();
            }
        }
示例#3
0
 public FormAdaugaPontaj(FormAngajat form) : this()
 {
     parentForm = form;
 }