Example #1
0
 public patientViewForm(tblPatient myPatient)
 {
     InitializeComponent();
     _myPatient = myPatient;
     _controller.Initialize();
     this.UpdateForm();
 }
Example #2
0
 public patientViewForm()
 {
     InitializeComponent();
     _myPatient = new tblPatient();
     _controller = new patientController(this, _myPatient);
     _controller.Initialize();
 }
Example #3
0
        public letterDialog(tblPatient MyPatient, tblRefDoctor MyDoctor)
        {
            InitializeComponent();
            myPatient = MyPatient;
            myDoctor = MyDoctor;

            setLetterContents();

            thankyouLetterRichEdit.Text = letterContents;
        }
        // GET: Patients/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPatient tblPatient = db.tblPatients.Find(id);

            if (tblPatient == null)
            {
                return(HttpNotFound());
            }
            return(View(tblPatient));
        }
        // GET: Patients/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPatient tblPatient = db.tblPatients.Find(id);

            if (tblPatient == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DoctId = new SelectList(db.tblDoctors, "Id", "Name", tblPatient.DoctId);
            return(View(tblPatient));
        }
Example #6
0
        public JsonResult Active(int id)
        {
            tblPatient ad = dc.tblPatients.SingleOrDefault(ob => ob.PatientId == id);

            if (ad.IsActive == true)
            {
                ad.IsActive = false;
            }
            else
            {
                ad.IsActive = true;
            }
            dc.SaveChanges();
            return(Json(ad.IsActive, JsonRequestBehavior.AllowGet));
        }
 public tblPatient GetUsernamePasswordPatient(string username, string password)
 {
     try
     {
         using (MedicalInstitutionNedeljniEntities context = new MedicalInstitutionNedeljniEntities())
         {
             tblPatient patient = (from e in context.tblPatients where e.UsernameLogin.Equals(username) where e.PasswordLogin.Equals(password) select e).First();
             
             return patient;
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Exception" + ex.Message.ToString());
         return null;
     }
 }
Example #8
0
        public void Add()
        {
            var tblPatient = new tblPatient
            {
                Patient_Id   = DPatientId,
                Name         = DName,
                Family       = DFamily,
                Sex          = DSex,
                Address      = DAddress,
                PhoneNumber  = DPhoneNumber,
                MobileNumber = DMobileNumber,
                Description  = DDescription
            };

            _dbVisitorEntities.tblPatient.Add(tblPatient);
            _dbVisitorEntities.SaveChanges();
        }
        private void birthDayDatePicker_LostFocus(object sender, RoutedEventArgs e)
        {
            if (DateTimeLostEvent == null)
            {
                return;
            }
            tblPatient xPatient = (tblPatientInfo)DataContext;

            if ((xPatient == null) || (!xPatient.BirthDay.HasValue) /* || Guid.Empty.Equals(xPatient.ID)*/)
            {
                return;
            }

            DateTimeLostEvent(xPatient.FirstName, xPatient.LastName, xPatient.FatherName, xPatient.BirthDay.Value);

            //this.DataContext;
            // FDataHelper.FindFIOData()
        }
        public tblPatient GetPatientHealthInsuranceCardNumber(string cardNumber)
        {
            try
            {
                using (MedicalInstitutionNedeljniEntities context = new MedicalInstitutionNedeljniEntities())
                {
                    tblPatient user = (from e in context.tblPatients where e.HealthInsuranceCardNumber.Equals(cardNumber) select e).First();


                    return user;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Exception" + ex.Message.ToString());
                return null;
            }
        }
        /// <summary>
        /// Method for login user
        /// </summary>
        private void LoginExecute()
        {
            string username = mainWindow.NameTextBox.Text;

            // Hash password
            var hasher         = new SHA256Managed();
            var unhashed       = Encoding.Unicode.GetBytes(mainWindow.passwordBox.Password);
            var hashed         = hasher.ComputeHash(unhashed);
            var hashedPassword = Convert.ToBase64String(hashed);

            string password = hashedPassword;

            Service s = new Service();

            tblPatient patientLogin = s.GetUsernamePasswordPatient(username, password);

            if (patientLogin != null)
            {
                Xceed.Wpf.Toolkit.MessageBox.Show($"{ username}, dobrodošli.", "L-Medical Institution");


                PatientMenu patientMenu = new PatientMenu
                {
                    Owner = mainWindow
                };
                mainWindow.Hide();
                patientMenu.ShowDialog();
            }
            else if (usernameAdmin == mainWindow.NameTextBox.Text.ToString() && passwordAdmin == mainWindow.passwordBox.Password.ToString())
            {
                Xceed.Wpf.Toolkit.MessageBox.Show($"{usernameAdmin}, dobrodošli.", "L-Medical Institution");
                AdminMenu adminMenu = new AdminMenu
                {
                    Owner = mainWindow
                };
                mainWindow.Hide();
                adminMenu.ShowDialog();
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("Korisničko ime ili lozinka nisu ispravni,\n pokušajte opet.", "Nalog nije pronađen.");
            }
        }
        public MainWindowViewModel(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;

            patient = new tblPatient();

            Service s = new Service();

            DoctorList = s.GetAllDoctor().ToList();

            if (!File.Exists(@"..\..\ClinicAccess.txt"))
            {
                File.Create(@"..\..\ClinicAccess.txt");
            }
            else
            {
                string[] lines = System.IO.File.ReadAllLines(@"..\..\ClinicAccess.txt");
                try
                {
                    if (lines.Count() > 2)
                    {
                        string UsernameAdminAll = lines[0];
                        string PasswordAdminAll = lines[1];

                        string[] FirstLine  = lines[0].Split(':');
                        string[] SecondLine = lines[1].Split(':');

                        usernameAdmin = FirstLine[1].Trim();
                        passwordAdmin = SecondLine[1].Trim();
                    }
                    else
                    {
                        Xceed.Wpf.Toolkit.MessageBox.Show("Niste uneli ispravno kredencijale admina u dokumentu ClinicAccess.txt\n\n1.Korisnicko ime:Vaše korisničko ime\n2.Lozinka: Vaša lozinka", "ClinicAccess.txt", MessageBoxButton.OK);
                    }
                }
                catch (Exception)
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Niste uneli ispravno kredencijale admina u dokumentu ClinicAccess.txt\n\n1.Korisnicko ime:Vaše korisničko ime\n2.Lozinka: Vaša lozinka", "ClinicAccess.txt", MessageBoxButton.OK);
                }
            }
        }
Example #13
0
 public PatientView(tblPatient patientUser)
 {
     InitializeComponent();
     DataContext    = new PatientViewModel(this, patientUser);
     tbPatient.Text = "Patient: " + patientUser.UserName;
 }
        public Task SetDocsByPatient(tblPatient patient)
        {
            ObservableCollection <tblDocumentCommon> xDocs = PopulateCollection(DocsByPatient(patient), RVDataContext.tblDocumentCommons);

            return(SetDocs(xDocs));
        }
Example #15
0
 private void patientLookUp_EditValueChanged(object sender, EventArgs e)
 {
     if(patientLookUpView.GetFocusedRow() != null)
     myPatient = (tblPatient)patientLookUpView.GetFocusedRow();
 }
 private IQueryable <tblDocumentCommon> DocsByPatient(tblPatient patient)
 {
     return(from doc in GetDocContext()
            where (doc.DateDelete == null) && (doc.PatientID == patient.ID)
            select doc);
 }
Example #17
0
    protected void rptPatients_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header && e.CommandName == "Sort")
        {
            if (Convert.ToString(ViewState["Sort"]).EndsWith(" asc"))
            {
                ViewState["Sort"] = e.CommandArgument.ToString() + " desc";
            }
            else
            {
                ViewState["Sort"] = e.CommandArgument.ToString() + " asc";
            }
            BindData();
        }
        else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            if (e.CommandName == "IsEdit")
            {
                int inlProdId = Convert.ToInt32(e.CommandArgument);
                lblId.Text             = Convert.ToString(inlProdId);
                ViewState["PatientId"] = Convert.ToString(inlProdId);
                moHMSDataContext       = new HMSDataContext();

                tblPatient loSelect = moHMSDataContext.tblPatients.Where(c => c.inPatientId == inlProdId).First();
                if (loSelect != null)
                {
                    txtFirstName.Text = loSelect.stFirstName;
                    txtLastName.Text  = loSelect.stLastName;
                    txtAddress.Text   = loSelect.stAddress;

                    if (loSelect.stStatus == "Single")
                    {
                        rdSingle.Checked = true;
                    }
                    else
                    {
                        rdMarried.Checked = true;
                    }

                    if (loSelect.stGender == "Male")
                    {
                        rdMale.Checked = true;
                    }
                    else
                    {
                        rdFemale.Checked = true;
                    }

                    if (loSelect.flgIsIn == true)
                    {
                        rdINStatus.Checked = true;
                    }
                    else
                    {
                        rdOutStatus.Checked = true;
                    }

                    txtAge.Text                 = Convert.ToString(loSelect.inAge);
                    txtPhone.Text               = Convert.ToString(loSelect.inPhone);
                    txtSymtoms.Text             = loSelect.stSymtoms;
                    txtWeight.Text              = Convert.ToString(loSelect.inWeight);
                    ddlFloor.SelectedValue      = Convert.ToString(loSelect.inFloorId);
                    ddlDepartment.SelectedValue = Convert.ToString(loSelect.inDepartmentId);
                    ddlDoctor.SelectedValue     = Convert.ToString(loSelect.inDoctorId);

                    fillBeds(Convert.ToInt32(loSelect.inFloorId), inlProdId);
                    ddlBed.SelectedValue = Convert.ToString(loSelect.inBedId);

                    lblPath.Text = loSelect.stImage;
                    if (lblPath.Text != string.Empty)
                    {
                        trView.Visible = true;
                    }
                    else
                    {
                        trView.Visible = false;
                    }
                    tdView.HRef = ConfigurationSettings.AppSettings["PatientImagePath"] + loSelect.stImage;

                    mvProduct.ActiveViewIndex = 0;
                    btnSave.Visible           = false;
                    btnEdit.Visible           = true;
                    lblMessage.Text           = "Update Patient";
                }
                txtFirstName.Focus();
            }
            if (e.CommandName == "IsDeleted")
            {
                int inlProdId = Convert.ToInt32(e.CommandArgument);
                lblId.Text       = Convert.ToString(inlProdId);
                moHMSDataContext = new HMSDataContext();

                tblPatient loDelete = moHMSDataContext.tblPatients.Where(c => c.inPatientId == inlProdId).FirstOrDefault();
                moHMSDataContext.tblPatients.DeleteOnSubmit(loDelete);
                moHMSDataContext.SubmitChanges();
                Common.CommonFunction.showMsg("Patient deleted successfully.", this.Page);
                BindData();
                ClearControl();
            }
        }
    }
 public AddPatientViewModel(AddPatientView patientView)
 {
     addPatient = patientView;
     patient    = new tblPatient();
 }
Example #19
0
 private void UpdatePatientDetails()
 {
     var foo = (tblPatient)this.displayGridView.GetFocusedRow();
     if (foo != null)
     {
         _myPatient = foo;
         _controller = new patientController(this, _myPatient);
         _controller.Initialize();
         this.UpdateForm();
         this.patientDetailsGroupBox.Text = this._controller.EditCopyPatient.FirstNames + @" " +
                                               this._controller.EditCopyPatient.LastName;
         _newPatient = false;
     }
 }
Example #20
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            moHMSDataContext = new HMSDataContext();

            if (editImgCode())
            {
                tblPatient loSelect = new tblPatient();
                loSelect.stFirstName = txtFirstName.Text;
                loSelect.stLastName  = txtLastName.Text;
                loSelect.stAddress   = txtAddress.Text;
                if (rdSingle.Checked)
                {
                    loSelect.stStatus = "Single";
                }
                else
                {
                    loSelect.stStatus = "Married";
                }

                if (rdMale.Checked)
                {
                    loSelect.stGender = "Male";
                }
                else
                {
                    loSelect.stGender = "Female";
                }

                if (rdINStatus.Checked)
                {
                    loSelect.flgIsIn = true;
                }
                else
                {
                    loSelect.flgIsIn = false;
                }

                loSelect.inEmployeeId    = Convert.ToInt32(Session["ID"]);
                loSelect.inAge           = Convert.ToByte(txtAge.Text);
                loSelect.inPhone         = Convert.ToInt64(txtPhone.Text);
                loSelect.stSymtoms       = txtSymtoms.Text;
                loSelect.inWeight        = Convert.ToByte(txtWeight.Text);
                loSelect.inBedId         = Convert.ToInt32(ddlBed.SelectedValue);
                loSelect.inFloorId       = Convert.ToInt32(ddlFloor.SelectedValue);
                loSelect.inDepartmentId  = Convert.ToInt32(ddlDepartment.SelectedValue);
                loSelect.inDoctorId      = Convert.ToInt32(ddlDoctor.SelectedValue);
                loSelect.dtAdmissionDate = DateTime.Now;
                loSelect.stImage         = lblPath.Text;


                moHMSDataContext.tblPatients.InsertOnSubmit(loSelect);
                moHMSDataContext.SubmitChanges();
                ClearControl();
                BindData();
                mvProduct.ActiveViewIndex = 1;
                Common.CommonFunction.showMsg("Patient saved successfully.", this.Page);
            }
        }
    }
Example #21
0
 private void NewPatientBtnClick(object sender, EventArgs e)
 {
     this._newPatient = true;
     this._myPatient = new tblPatient();
     this._controller = new patientController(this, _myPatient);
     this._controller.Initialize();
     this.UpdateForm();
     this.patientDetailsGroupBox.Text = @"Enter a new Patient";
     this.surnameTextEdit.Focus();
     this.applyBtn.Enabled = false;
 }
Example #22
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (editImgCode())
            {
                moHMSDataContext = new HMSDataContext();
                tblPatient loSelect = moHMSDataContext.tblPatients.Where(c => c.inPatientId == Convert.ToInt32(lblId.Text)).FirstOrDefault();
                loSelect.stFirstName = txtFirstName.Text;
                loSelect.stLastName  = txtLastName.Text;
                if (rdSingle.Checked)
                {
                    loSelect.stStatus = "Single";
                }
                else
                {
                    loSelect.stStatus = "Married";
                }

                if (rdMale.Checked)
                {
                    loSelect.stGender = "Male";
                }
                else
                {
                    loSelect.stGender = "Female";
                }

                if (rdINStatus.Checked)
                {
                    loSelect.flgIsIn = true;
                }
                else
                {
                    loSelect.flgIsIn = false;
                }

                loSelect.stAddress      = txtAddress.Text;
                loSelect.inAge          = Convert.ToByte(txtAge.Text);
                loSelect.inPhone        = Convert.ToInt64(txtPhone.Text);
                loSelect.stSymtoms      = txtSymtoms.Text;
                loSelect.inWeight       = Convert.ToByte(txtWeight.Text);
                loSelect.inBedId        = Convert.ToInt32(ddlBed.SelectedValue);
                loSelect.inFloorId      = Convert.ToInt32(ddlFloor.SelectedValue);
                loSelect.inDepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue);
                loSelect.inDoctorId     = Convert.ToInt32(ddlDoctor.SelectedValue);
                loSelect.stImage        = lblPath.Text;

                if (rdOutStatus.Checked)
                {
                    loSelect.dtOutDate = DateTime.Now;
                }

                moHMSDataContext.SubmitChanges();
                ClearControl();
                BindData();
                mvProduct.ActiveViewIndex = 1;
                Common.CommonFunction.showMsg("Patient details updated successfully.", this.Page);
            }
        }
    }
Example #23
0
 public patientController(Form myForm, tblPatient myPatient)
 {
     MyViewForm = myForm;
     _sourcePatient = myPatient;
 }
Example #24
0
        public void ApplyChanges()
        {
            var newConnection = new dbContextDataContext();

            //If Patient Changed.
            if(PatientPropertiesChanged())
            {

                try
                {
                    _sourcePatient = (from p in newConnection.tblPatients
                                      where p.PatientID == _sourcePatient.PatientID
                                      select p).SingleOrDefault();

                    if(_sourcePatient != null)
                    {
                        _sourcePatient.UpdatePatient(EditCopyPatient);
                        newConnection.SubmitChanges();
                    }
                    else
                    {
                        _sourcePatient = new tblPatient();
                        _sourcePatient.UpdatePatient(EditCopyPatient);
                        newConnection.tblPatients.InsertOnSubmit(_sourcePatient);
                        newConnection.SubmitChanges();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show(@"Database not responding. Please check your connection.");
                }
            }

            //If Patient Address Changed.
            if(PatientAddressPropertiesChanged())
            {
                try
                {
                    _sourceAddress = (from p in newConnection.tblPatientAddrs
                                      where p.PatientID == _sourcePatient.PatientID
                                      select p).FirstOrDefault();
                    if (_sourceAddress != null)
                    {
                        _sourceAddress.UpdatePatientAddress(EditCopyAddress);
                        newConnection.SubmitChanges();
                    }
                    else
                    {
                        _sourceAddress = new tblPatientAddr();
                        newConnection.tblPatientAddrs.InsertOnSubmit(_sourceAddress);
                        newConnection.SubmitChanges();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show(@"Database not responding. Please check your connection.");
                }
            }

            //Claimants of this patient changed.

            if(ClaimantsChanged() == false)
            {
                var added = this.EditCopyClaimantList.Except(this._sourceClaimantList);
                var deleted = this._sourceClaimantList.Except(this.EditCopyClaimantList);

                if (deleted.Any())
                {
                    using (newConnection)
                    {
                        foreach (var y in
                            deleted.Select(x => (tblPatientClaimant)(from p in newConnection.tblPatientClaimants
                                                                     where p.PatientID == this._sourcePatient.PatientID && p.ClaimantID == x.ClaimantID
                                                                     select p).First()))
                        {
                            newConnection.tblPatientClaimants.DeleteOnSubmit(y);
                        }

                        newConnection.SubmitChanges();
                    }

                }

                if (added.Any())
                {
                    var newConnection1 = new dbContextDataContext();
                    using (newConnection1)
                    {
                        foreach (var y in added.Select(x => new tblPatientClaimant
                        {
                            ClaimantID = x.ClaimantID,
                            PatientID = _sourcePatient.PatientID
                        }))
                        {
                            newConnection1.tblPatientClaimants.InsertOnSubmit(y);
                        }
                        newConnection1.SubmitChanges();
                    }
                }
            }
        }
        //Create new user
        private void SignUpExecute()
        {
            try
            {
                PasswordCorrect(mainWindow.txtLozinkaRegistracija.Text.ToString());

                Service s = new Service();

                string jmbg = Patient.BLK;
                string AN   = Patient.HealthInsuranceCardNumber;
                string user = Patient.UsernameLogin;



                //uniqueness check JMBG
                tblPatient patientJMBG = s.GetPatientBLK(jmbg);

                if (patientJMBG != null)
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Korisnik već postoji sa tim Brojem lične karte, pokušajte opet.", "JMBG");
                    return;
                }

                //uniqueness check Health Insurance Card Number
                tblPatient patientAN = s.GetPatientHealthInsuranceCardNumber(AN);

                if (patientAN != null)
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Broj zdravstvenog osiguranja već neko koristi, pokušajte sa drugim brojem.", "Broj zdravstvenog osiguranja");
                    return;
                }


                //uniqueness check username
                tblPatient employeeUserPatient = s.GetPatientUsername(user);

                if (employeeUserPatient != null)
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Korisničko ime je zauzeto, pokušajte neko drugo.", "Korisničko ime");
                    return;
                }

                // Hash Password
                var hasher         = new SHA256Managed();
                var unhashed       = Encoding.Unicode.GetBytes(this.Patient.PasswordLogin);
                var hashed         = hasher.ComputeHash(unhashed);
                var hashedPassword = Convert.ToBase64String(hashed);

                this.Patient.PasswordLogin = hashedPassword;
                if (mainWindow.cbxDoctor.Text != "")
                {
                    Patient.UniqueNumberDoctor = Convert.ToInt32(Doctor.DoctorID);
                }
                if (Patient.Gender == 0)
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Niste izabrali pol.", "Pol pacijenta");
                    return;
                }
                s.AddPatient(Patient);
                IsUpdateDoctor = true;
                mainWindow.NameTextBox.Text     = "";
                mainWindow.passwordBox.Password = "";
                mainWindow.login.Visibility     = Visibility.Visible;
                mainWindow.Images0.Visibility   = Visibility.Collapsed;
                mainWindow.Images1.Visibility   = Visibility.Visible;
                mainWindow.SignUp.Visibility    = Visibility.Collapsed;

                string poruka = Patient.NameSurname + ",\nUspešno ste se registrovali.";
                Xceed.Wpf.Toolkit.MessageBox.Show(poruka, "Registracija pacijenta", MessageBoxButton.OK);
                mainWindow.NameTextBox.Focus();

                mainWindow.txtCitizenship.Text           = "";
                mainWindow.txtHealthNumber.Text          = "";
                mainWindow.txtIDNumber.Text              = "";
                mainWindow.txtIme.Text                   = "";
                mainWindow.cbxDoctor.Text                = "";
                mainWindow.dpDatumRodjenja.Text          = "";
                mainWindow.dpExpirationDate.Text         = "";
                mainWindow.txtKorisnickoIme.Text         = "";
                mainWindow.txtLozinkaRegistracija.Text   = "";
                mainWindow.txtReLozinkaRegistracija.Text = "";
                mainWindow.mupper.Visibility             = Visibility.Hidden;
                mainWindow.mupperError.Visibility        = Visibility.Hidden;
                mainWindow.mlower.Visibility             = Visibility.Hidden;
                mainWindow.mlowerError.Visibility        = Visibility.Hidden;
                mainWindow.mminCharacter.Visibility      = Visibility.Hidden;
                mainWindow.mminCharacterError.Visibility = Visibility.Hidden;
                mainWindow.mspecial.Visibility           = Visibility.Hidden;
                mainWindow.mspecialError.Visibility      = Visibility.Hidden;
                mainWindow.mnumber.Visibility            = Visibility.Hidden;
                mainWindow.mnumberError.Visibility       = Visibility.Hidden;
            }
            catch (Exception ex)
            {
                Xceed.Wpf.Toolkit.MessageBox.Show(ex.ToString());
            }
        }
Example #26
0
        public ActionResult Detail(int id)
        {
            tblPatient ad = dc.tblPatients.SingleOrDefault(ob => ob.PatientId == id);

            return(View(ad));
        }
 public PatientViewModel(PatientView patientViewOpen, tblPatient patientInstance)
 {
     patientView = patientViewOpen;
     Patient     = patientInstance;
 }
Example #28
0
 private void invoicsByPatientToolStripMenuItem_Click(object sender, EventArgs e)
 {
     tblPatient one = new tblPatient();
     one.PatientID = 10834;
     var foo = new Patient.patientInvoiceViewForm(one);
     foo.ShowDialog();
     foo.Dispose();
 }
Example #29
0
 public patientInvoiceViewForm(tblPatient MyPatient)
 {
     InitializeComponent();
     myPatient = MyPatient;
 }