public EmployeeEditForm(EmployeesListForm instance, Employee emplForUpdate)
     : this(instance)
 {
     this.emplForUpdate = emplForUpdate;
     this.forUpdate     = true;
     addDataForUpdate();
 }
        public EmployeeEditForm(EmployeesListForm instance)
        {
            this.instance = instance;

            InitializeComponent();

            queryEmpl = new QueryEmployee();

            this.Text   = Properties.Resources.Employee;
            label1.Text = Properties.Resources.Surname;
            label2.Text = Properties.Resources.Name;
            label3.Text = Properties.Resources.Patronymic;
            label4.Text = Properties.Resources.Login;
            label5.Text = Properties.Resources.Password;
            label6.Text = Properties.Resources.Group;

            ArrayList lObj = new ArrayList();

            foreach (var item in queryEmpl.querySelectPositions())
            {
                lObj.Add(new { Id = item.Id, PositionName = item.Name });
            }

            comboBox1.DataSource    = lObj;
            comboBox1.ValueMember   = "Id";
            comboBox1.DisplayMember = "PositionName";


            buttonOk.Text     = Properties.Resources.Cancel;
            buttonCancel.Text = Properties.Resources.OK;
        }
Example #3
0
        private void buttonEmployeesList_Click(object sender, EventArgs e)
        {
            EmployeesListForm f = new EmployeesListForm();

            f.ShowDialog();
        }