Exemple #1
0
        private void button2_Click(object sender, EventArgs e)// Изменить
        {
            if (comboBox1.SelectedIndex == 0)
            {
                List <client> query = (from client in db.client
                                       select client).ToList();
                client item = query.First(w => w.id_client.ToString() ==
                                          dataGridView1.SelectedCells[0].OwningRow.Cells[0].Value.ToString());
                EditUser editUser = new EditUser(item);
                editUser.Owner = this;
                editUser.Show();
            }

            if ((comboBox1.SelectedIndex == 1) || (comboBox1.SelectedIndex == 2))
            {
                List <employee> query = (from employee in db.employee
                                         select employee).ToList();
                employee item = query.First(w => w.id_employee.ToString() ==
                                            dataGridView1.SelectedCells[0].OwningRow.Cells[0].Value.ToString());
                EditUser editUser = new EditUser(item);
                editUser.Owner = this;
                editUser.Show();
            }

            if (comboBox1.SelectedIndex == 3)
            {
                List <service> query = (from service in db.service
                                        select service).ToList();
                service item = query.First(w => w.name.ToString() ==
                                           dataGridView1.SelectedCells[0].OwningRow.Cells[0].Value.ToString());
                EditService editUser = new EditService(item);
                editUser.Owner = this;
                editUser.Show();
            }

            if (comboBox1.SelectedIndex == 4)
            {
                List <procedure_schedule> query = (from procedure_schedule in db.procedure_schedule
                                                   select procedure_schedule).ToList();
                procedure_schedule item = query.First(w => w.date.ToString() ==
                                                      dataGridView1.SelectedCells[0].OwningRow.Cells[0].Value.ToString());
                Procedure procedure = new Procedure(item);
                procedure.Show();
            }
        }
Exemple #2
0
 public EditInfo(employee newemployee, EditUser editUser)
 {
     this.newemployee = newemployee;
     this.editUser    = editUser;
 }
Exemple #3
0
 public EditInfo(client newclient, EditUser editUser)
 {
     this.newclient = newclient;
     this.editUser  = editUser;
 }