public Patient(AccountType typeAccc, string namee, string lastnamee, string idd, DateTime dateOfBirthh, string phoneNumberr, string emaill, string placeOfResidancee, TypeOfPerson typeOfPersonn, string usernameee, string passworddd, string jmbggg, SexType sexTypeee, MedicalRecord mr, List <Allergen> listAllergenss) : base(namee, lastnamee, idd, dateOfBirthh, phoneNumberr, emaill, placeOfResidancee, typeOfPersonn, usernameee, passworddd, jmbggg, sexTypeee) { typeAcc = typeAccc; medicalRecord = mr; listAllergens = listAllergenss; }
private void Submit_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string firstName = textBoxFirstName.Text; string lastName = textBoxLastName.Text; string jmbg = textBoxJMBG.Text; string username = textBoxFirstName.Text + textBoxLastName.Text; string password = "******"; string date = BoxDateTime.Text; string[] entries = date.Split('/'); int year = Int32.Parse(entries[2]); int month = Int32.Parse(entries[0]); int day = Int32.Parse(entries[1]); DateTime myDate = new DateTime(year, month, day); int n = sc.GetAllPatients().Count; int idPatient; if (n > 0) { idPatient = Int32.Parse(sc.GetAllPatients()[n - 1].Id) + 1; } else { idPatient = 0; } TypeOfPerson typeOfPerson = (TypeOfPerson)Enum.Parse(typeof(TypeOfPerson), "Patient"); AccountType typeAccc = (AccountType)Enum.Parse(typeof(AccountType), "guestAccount"); List <Allergen> listAllergens = new List <Allergen>(); MedicalRecord mr = new MedicalRecord(idPatient.ToString(), typeAccc, 0, firstName, lastName, "empty", jmbg, myDate, "empty", "empty", "empty", 0); Patient p = new Patient(typeAccc, firstName, lastName, idPatient.ToString(), myDate, "Empty", "Empty", "Empty", typeOfPerson, username, password, jmbg, 0, mr, listAllergens); sc.CreatePatient(p); aPw.UpdateView(); Close(); }
public static bool CompareTypeOfPersons(TypeOfPerson type1, TypeOfPerson type2) { if (type1 == type2) { return(true); } else { return(false); } }
public Person(string namee, string lastnamee, string idd, DateTime dateOfBirthh, string phoneNumberr, string emaill, string placeOfResidancee, TypeOfPerson typeOfPersonn, string usernameee, string passworddd, string jmbgg, SexType sexTypee) : base(usernameee, passworddd) { name = namee; lastName = lastnamee; id = idd; dateOfBirth = dateOfBirthh; phoneNumber = phoneNumberr; email = emaill; placeOfResidance = placeOfResidancee; typeOfPerson = typeOfPersonn; jmbg = jmbgg; sexType = sexTypee; }
static void Main(string[] args) { Message.Welcome(); var utility = new Utility(); var personSelectionLetter = ""; var typeOfPerson = new TypeOfPerson(); var employeeList = new List <Employee>(); var customerList = new List <Customer>(); do { personSelectionLetter = utility.GetValidPersonSelection(); typeOfPerson = utility.ConvertLetterToPersonType(personSelectionLetter); if (typeOfPerson == TypeOfPerson.Customer) { var customer = utility.GetCustomerInfo(); customerList.Add(customer); } else { var employee = utility.GetEmployeeInfo(); employeeList.Add(employee); } } while (utility.AskToContinue()); Message.DisplayCustomers(); foreach (var customer in customerList) { Console.WriteLine($"Name: {customer.Full_Name()}"); Console.WriteLine($"Email Address: {customer.Email_Address}"); Console.WriteLine($"Phone Number: {customer.Phone_Number}"); Console.WriteLine($"Credit Card Number: {customer.Credit_Card_Number}"); Console.WriteLine($"Billing Address: {customer.Billing_Address}"); Console.WriteLine($"Shipping Address: {customer.Shipping_Address}"); Console.WriteLine($"Home Address: {customer.Home_Address}"); Console.WriteLine(); } Message.DisplayEmployees(); foreach (var employee in employeeList) { Console.WriteLine($"Name: {employee.Full_Name()}"); Console.WriteLine($"Email Address: {employee.Email_Address}"); Console.WriteLine($"Home Address: {employee.Home_Address}"); Console.WriteLine($"Phone Number: {employee.Phone_Number}"); Console.WriteLine($"Job Title: {employee.Job_Title}"); Console.WriteLine($"Department: {employee.Department.ToString()}"); Console.WriteLine($"Yearly Salary: {employee.Yearly_Salary}"); Console.WriteLine(); } Message.ThankYou(); }
public Person(Game game, TypeOfPerson type, float scale, float mass, Vector2 initialPosition, Vector2 initialVelocity) : base(game) { _texture = initiateSkin(this); _scale = scale; _mass = mass; _position = initialPosition; _velocity = initialVelocity; _friction = 0.05f; _acceleration = 0.0003f; _speed = initialVelocity.Length(); _type = type; _health = 100; _baseSpeed = initiateBaseSpeed(this); }
// Here i use enums. public static void NoExistMassege(bool flag, TypeOfPerson typeOfPerson, AmountOfPersons amountOfPersons) { if (flag == false) { switch (typeOfPerson) { case TypeOfPerson.Student: { switch (amountOfPersons) { case AmountOfPersons.One: { WriteLine("( Such studen doesn't exist )"); } break; case AmountOfPersons.Several: { WriteLine("( There's no one student )"); } break; } } break; case TypeOfPerson.Employee: { switch (amountOfPersons) { case AmountOfPersons.One: { WriteLine("( Such employee doesn't exist )"); } break; case AmountOfPersons.Several: { WriteLine("( There's no one employee )"); } break; } } break; } } }
private void Submit_Click(object sender, RoutedEventArgs e) { //PatientManagement pm = new PatientManagement(); SecretaryController sc = new SecretaryController(); string firstName = textBoxFirstName.Text; string lastName = textBoxLastName.Text; string jmbg = textBoxJMBG.Text; string date = BoxDateTime.Text; string[] entries = date.Split('/'); int year = Int32.Parse(entries[2]); int month = Int32.Parse(entries[0]); int day = Int32.Parse(entries[1]); DateTime myDate = new DateTime(year, month, day); string placeOfResidance = textBoxPlaceOfResidance.Text; string email = textBoxEmail.Text; string phoneNumber = textBoxPhoneNumber.Text; string username = textBoxUsername.Text; string password = textBoxPassword.Text; SexType sex = SexType.male; if (Convert.ToBoolean(MSex.IsChecked)) { sex = SexType.male; } else if (Convert.ToBoolean(FSex.IsChecked)) { sex = SexType.female; } int n = sc.GetAllPatients().Count; int idPatient; if (n > 0) { idPatient = Int32.Parse(sc.GetAllPatients()[n - 1].Id) + 1; } else { idPatient = 0; } TypeOfPerson typeOfPerson = (TypeOfPerson)Enum.Parse(typeof(TypeOfPerson), "Patient"); List <Allergen> listAllergens = new List <Allergen>(); MedicalRecord mr = new MedicalRecord(idPatient.ToString(), 0, 0, firstName, lastName, "empty", jmbg, myDate, "empty", placeOfResidance, phoneNumber, sex); Patient p = new Patient(0, firstName, lastName, idPatient.ToString(), myDate, phoneNumber, email, placeOfResidance, typeOfPerson, username, password, jmbg, sex, mr, listAllergens); sc.CreatePatient(p); aPw.UpdateView(); Close(); }
public Secretary(string namee, string lastnamee, string idd, DateTime dateOfBirthh, string phoneNumberr, string emaill, string placeOfResidancee, TypeOfPerson typeOfPersonn, string usernameee, string passworddd, string jmbggg, SexType sexTypeee) : base(namee, lastnamee, idd, dateOfBirthh, phoneNumberr, emaill, placeOfResidancee, typeOfPersonn, usernameee, passworddd, jmbggg, sexTypeee) { }
public Person(Game game, TypeOfPerson type, float scale, float mass) : this(game, TypeOfPerson.player, scale, mass, Vector2.Zero, Vector2.Zero) { }