Beispiel #1
0
 public EditInfo(service newservice, string newemployee, EditService editService)
 {
     this.editService = editService;
     this.newservice  = newservice;
     this.newemployee = db.employee.SingleOrDefault(w => (w.surname + " " + w.name + " " + w.lastlename)
                                                    == newemployee);
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)// Add
        {
            /*Клиенты
             * Врачи
             * Администраторы
             * Список услуг
             * Записи*/
            string usertype = "";

            switch (comboBox1.SelectedIndex)
            {
            case 0:
            {
                usertype = "Клиент";
                Add_new_user add_New_User = new Add_new_user(usertype);
                add_New_User.Show();
            }
            break;

            case 1:
            {
                usertype = "Сотрудник";
                Add_new_user add_New_User = new Add_new_user(usertype);
                add_New_User.Show();
            }
            break;

            case 2:
            {
                usertype = "Сотрудник";
                Add_new_user add_New_User = new Add_new_user(usertype);
                add_New_User.Show();
            }                    break;

            case 3:
            {
                EditService editService = new EditService();
                editService.Show();
            }                    break;

            case 4:
            {
                Procedure procedure = new Procedure();
                procedure.Show();
            }                    break;
            }
        }
Beispiel #3
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();
            }
        }
Beispiel #4
0
 public AddNewUser(string newemployee, EditService editService)
 {
     this.editService = editService;
     this.newemployee = db.employee.SingleOrDefault(w => (w.surname + " " + w.name + " " + w.lastlename)
                                                    == newemployee);
 }