Exemplo n.º 1
0
 private void UsersControl_Load(object sender, EventArgs e)
 {
     _context = new EPatientContext();
     usersBindingSource.DataSource     = _context.Users.ToList();
     rolesBindingSource.DataSource     = _context.Roles.ToList();
     pavilionsBindingSource.DataSource = _context.Pavilions.ToList();
 }
 public BasicReportsControl()
 {
     _context = new EPatientContext();
     myWebBrowser.DocumentCompleted += myWebBrowser_DocumentCompleted;
     InitializeComponent();
     FillGrids();
 }
Exemplo n.º 3
0
        public FolderForm(int patientId)
        {
            _context        = new EPatientContext();
            _currentPatient = _context.Patients.FirstOrDefault(p => p.Id == patientId);

            InitializeComponent();

            textName.Text         = _currentPatient.Name;
            textSurname.Text      = _currentPatient.Surname;
            textBirthday.Text     = _currentPatient.Birthday.ToShortDateString();
            textGender.Text       = (_currentPatient.Gender) ? "Mashkull" : "Femer";
            textPhone.Text        = _currentPatient.Phone;
            textEmail.Text        = _currentPatient.Email;
            textBoxAllergies.Text = _currentPatient.Allergies;

            gridViewFolder.DataSource = FillTable();
            StyleGrid();

            if (AuthUser.Model.RoleId == Role.Operator)
            {
                btnPrint.Enabled = true;
            }
            else
            {
                btnPrint.Enabled = false;
            }
        }
 private void TimetablesControl_Load(object sender, EventArgs e)
 {
     _context = new EPatientContext();
     usersBindingSource.DataSource     = _context.Users.Where(u => u.RoleId == Role.Doctor || u.RoleId == Role.Nurse).Include(u => u.Timetables).ToList();
     rolesBindingSource.DataSource     = _context.Roles.ToList();
     pavilionsBindingSource.DataSource = _context.Pavilions.ToList();
     timetablePanel.Hide();
 }
        public TimetablesControl()
        {
            InitializeComponent();
            _context = new EPatientContext();
            var query = _context.Users.Where(u => u.RoleId == Role.Doctor || u.RoleId == Role.Nurse).Include("TimeTables").ToList();

            userBindingSource.DataSource = query;
            roleBindingSource.DataSource = _context.Roles.ToList();
        }
Exemplo n.º 6
0
        private void ServicesControl_Load(object sender, EventArgs e)
        {
            _context = new EPatientContext();
            var pavilions = _context.Pavilions.ToList();

            pavilionsBindingSource.DataSource = pavilions;
            servicesBindingSource.DataSource  = _context.Services.ToList();

            cboPavilion.DisplayMember = "Name";
            cboPavilion.ValueMember   = "Id";

            cboPavilion.DataSource = pavilions;
        }
Exemplo n.º 7
0
        private void EmergencyDoctorControl_Load(object sender, EventArgs e)
        {
            _context = new EPatientContext();
            source   = new BindingSource {
                DataSource = GetItems()
            };

            if (source.Count != 0)
            {
                StyleGrid();
            }

            cboUsername.DisplayMember = "Username";
            cboUsername.ValueMember   = "Id";
        }
Exemplo n.º 8
0
        public AdvancedReportsControl()
        {
            _context = new EPatientContext();
            myWebBrowser.DocumentCompleted += myWebBrowser_DocumentCompleted;
            InitializeComponent();

            listBoxSearchDoctor.DisplayMember = "NameSurname";
            listBoxSearchDoctor.ValueMember   = "Id";
            var doctors = _context.Users.Where(d => d.RoleId == Role.Doctor || d.RoleId == Role.Nurse).Select(t => new
            {
                Id          = t.Id,
                NameSurname = t.Name + " " + t.Surname
            }).ToList();

            doctors.Insert(0, new { Id = 0, NameSurname = "All Doctors" });
            listBoxSearchDoctor.DataSource = doctors;
        }
Exemplo n.º 9
0
        public ReservationShow(int reservationId)
        {
            _context            = new EPatientContext();
            _currentReservation = _context.Reservations.Include("User").Include("Service").Include("Patient").FirstOrDefault(r => r.Id == reservationId);
            InitializeComponent();

            textPatient.Text  = _currentReservation.Patient.Name;
            textDoctor.Text   = _currentReservation.User.Name;
            textService.Text  = _currentReservation.Service.Name;
            textPaid.Text     = _currentReservation.Paid ? "Po" : "Jo";
            textDate.Text     = _currentReservation.StartTime.ToShortDateString();
            textDuration.Text = _currentReservation.StartTime.ToString("H:mm") + " - " + _currentReservation.EndTime.ToString("H:mm");
            textRecipe.Text   = _currentReservation.Recipe;


            if (_currentReservation.File == null)
            {
                btnDownload.Enabled = false;
            }
        }
Exemplo n.º 10
0
        public bool LoggedIn(string username, string password, bool isRememberMeChecked)
        {
            using (_context = new EPatientContext())
            {
                var user = _context.Users.Include("TimeTables").SingleOrDefault(u => u.Username == username);

                if (user == null)
                {
                    return(false);
                }

                var hashedPassword = user.Password;

                if (HashingPassword.CheckPassword(password, hashedPassword))
                {
                    RememberMe(isRememberMeChecked, username, password);
                    AuthUser.Model = user;
                    return(true);
                }

                return(false);
            }
        }
Exemplo n.º 11
0
        private void AddEditUserForm_Load(object sender, EventArgs e)
        {
            cboRole.DisplayMember     = "Name";
            cboRole.ValueMember       = "Id";
            cboPavilion.DisplayMember = "Name";
            cboPavilion.ValueMember   = "Id";

            using (EPatientContext _context = new EPatientContext())
            {
                cboRole.DataSource     = _context.Roles.ToList();
                cboPavilion.DataSource = _context.Pavilions.ToList();
            }

            if (UserInfo.RoleId != 0)
            {
                cboRole.SelectedIndex = cboRole.FindStringExact(UserInfo.Role.Name);
            }
            else
            {
                cboRole.SelectedIndex = -1;
            }

            if (UserInfo.PavilionId != null)
            {
                cboPavilion.SelectedIndex = cboPavilion.FindStringExact(UserInfo.Pavilion.Name);
            }
            else
            {
                cboPavilion.SelectedIndex = -1;
            }

            if (string.IsNullOrEmpty(UserInfo.Name))
            {
                textPassword.Enabled = true;
                chkBoxEditPassword.Hide();
            }
        }
Exemplo n.º 12
0
 public ReservationsControl()
 {
     InitializeComponent();
     _context = new EPatientContext();
 }
Exemplo n.º 13
0
 private void PatientsControl_Load(object sender, EventArgs e)
 {
     _context = new EPatientContext();
     patientBindingSource.DataSource = _context.Patients.ToList();
 }
 public AddReservationForm()
 {
     _context = new EPatientContext();
     InitializeComponent();
 }
 public AddQuickReservation()
 {
     _context = new EPatientContext();
     InitializeComponent();
 }
Exemplo n.º 16
0
 private void ReservationControl_Load(object sender, EventArgs e)
 {
     _context = new EPatientContext();
     gridViewReservation.DataSource = FillTable(null, DateTime.Now);
     StyleGrid();
 }
 public TimetableControl()
 {
     InitializeComponent();
     _context = new EPatientContext();
 }
 public ReservationDiagnose(int reservation_id)
 {
     _context           = new EPatientContext();
     CurrentReservation = _context.Reservations.Include("Patient").FirstOrDefault(r => r.Id == reservation_id);
     InitializeComponent();
 }