using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Hospital
{
interface Imointerface
{ void Summa(); }
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form2());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hospital
{
public class Hospital
{
List<Doctor> doctor;
List<Pacient> pac;
Pacient searchedP;
public Pacient SearchedP
{
get { return searchedP; }
set { searchedP = value; }
}
public Hospital()
{
FillDoctors();
}
private void FillDoctors()
{
doctor = new List<Doctor>();
doctor.Add(new Doctor("re","rg"));
}
public List<Doctor> ShowAllDoc()
{
return doctor;
}
public bool AddDoc(Doctor newDoc)
{
try
{
doctor.Add(newDoc);
return true;
}
catch
{
return false;
}
}
public Pacient SearchedPg(string nameP)
{
Pacient searchedP = null;
foreach (Pacient item in pac)
{
if (item.NameP == nameP)
searchedP = item;
}
return searchedP;
}
public void Pacients()
{
FillPac();
}
private void FillPac()
{
pac = new List<Pacient>();
pac.Add(new Pacient("re", "rg"));
}
public List<Pacient> ShowAllPac()
{
return pac;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hospital
{
public class Pacient
{
string nameP;
string disease;
public string NameP
{
get { return nameP; }
set { nameP = value; }
}
public string Disease
{
get { return disease; }
set { disease = value; }
}
public Pacient( string nameP, string disease)
{
this.NameP = nameP;
this.Disease = disease;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hospital
{
class SearchPac
{
List<Pacient> pac;
Pacient searchedP;
public Pacient SearchedP
{
get { return searchedP; }
set { searchedP = value; }
}
public Pacient SearchedPg(string nameP)
{
Pacient searchedP = null;
foreach (Pacient item in pac)
{
if (item.NameP == nameP)
searchedP = item;
}
return searchedP;
}
public SearchPac()
{
FillPac();
}
private void FillPac()
{
pac = new List<Pacient>();
pac.Add(new Pacient("Иванов", "Простуда"));
pac.Add(new Pacient("Бабаев", "ВИЧ"));
pac.Add(new Pacient("Гончарова", "Грыжа"));
pac.Add(new Pacient("Пушков", "ОРВИ"));
pac.Add(new Pacient("Шевченко", "Флюс"));
pac.Add(new Pacient("Крутицкий", "Менингит"));
pac.Add(new Pacient("Зорин", "Бронхит"));
pac.Add(new Pacient("Лавренюк", "Энурез"));
}
public List<Pacient> ShowAllPac()
{
return pac;
}
}
}