Esempio n. 1
0
        public static List <Patient> GetAllPatients()
        {
            PatientTableAdapter taPatient = new PatientTableAdapter();
            //PatientTableAdapter taPatients = new PatientTableAdapter();
            var            dtPatient   = taPatient.GetData();
            List <Patient> allPatients = new List <Patient>();

            foreach (dsUltimateMedDB.PatientRow patientRow in dtPatient.Rows)
            {
                Patient currentPatient = new Patient();
                currentPatient.Pid     = patientRow.Id;
                currentPatient.Address = patientRow.Address;
                currentPatient.Age     = patientRow.Age;
                currentPatient.Name    = patientRow.Name;
                currentPatient.Gender  = patientRow.Gender;
                currentPatient.Age     = patientRow.Age;
                currentPatient.Weight  = patientRow.Weight;
                currentPatient.Address = patientRow.Address;
                currentPatient.Phone   = patientRow.Phone;
                currentPatient.Disease = patientRow.Disease;
                currentPatient.Doc_Id  = patientRow.Doc_Id;
                currentPatient.AddPatient(currentPatient);
                allPatients.Add(currentPatient);
            }
            return(allPatients);
        }
Esempio n. 2
0
        /*Function which takes two parameters
         *  1) The new lab to be inserted into the database
         *  2) The name of the patient to assign this lab to
         * The Pid is located first
         * Query is then executed to insert new lab and return the Scope_ID of the new lab
         * The Patient is then associated with the new Lab using connector table Patient_Lab
         */
        public static void AddLab(Lab newLab, string Name)
        {
            LabTableAdapter     taLabs        = new LabTableAdapter();
            PatientTableAdapter patientLookUp = new PatientTableAdapter();
            int pid      = (int)patientLookUp.GetPatientID(Name);
            int scope_id = Convert.ToInt32(taLabs.AddNewLabReturnScopeID(newLab.Weight, newLab.Doc_id, newLab.Date, newLab.Category, newLab.PatientType, newLab.Amount));
            Patient_LabTableAdapter labPatientConnect = new Patient_LabTableAdapter();

            labPatientConnect.InsertByPidLabID(pid, scope_id);
        }
Esempio n. 3
0
        public void SaveNewPatient(string Name, string Gender,
                                   int Age, int Weight, string Address,
                                   string Phone, string Disease, string Doctor)
        {
            PatientTableAdapter taPatient = new PatientTableAdapter();

            if (Name != null)
            {
                taPatient.AddNewPatient(Name, Gender, Age, Weight, Address, Phone, Disease, Doctor);
            }
        }
Esempio n. 4
0
        public static void UnassignRoom(int roomNumber, string patientName)
        {
            PatientTableAdapter taPatient = new PatientTableAdapter();
            int patient_id          = (int)taPatient.GetPatientID(patientName);
            RoomTableAdapter taRoom = new RoomTableAdapter();

            taRoom.UpdateRoomStatus("available", roomNumber);
            int room_id = (int)taRoom.GetRoomID(roomNumber);
            Patient_RoomTableAdapter taPatientRow = new Patient_RoomTableAdapter();

            taPatientRow.UnassignRoom(patient_id, room_id);
        }
Esempio n. 5
0
        public static void AssignRoom(int roomNumber, string patientName)
        {
            PatientTableAdapter taPatient = new PatientTableAdapter();
            int patient_id          = (int)taPatient.GetPatientID(patientName);
            RoomTableAdapter taRoom = new RoomTableAdapter();

            taRoom.UpdateRoomStatus("occupied", roomNumber);
            int room_id = (int)taRoom.GetRoomID(roomNumber);
            Patient_RoomTableAdapter taPatientRoom = new Patient_RoomTableAdapter();

            taPatientRoom.InsertRoomByPidScopeID(patient_id, room_id);
        }
Esempio n. 6
0
 private void PolyclinicForm_Load(object sender, EventArgs e)
 {
     DoctorDataGridView.ColumnHeadersDefaultCellStyle.Font = new Font("Microsoft YaHei", 12F, FontStyle.Bold);
     CardTableAdapter.Fill(polyDataSet.Амбулаторная_карта);
     DiagnosesTableAdapter.Fill(polyDataSet.Диагнозы);
     SpecialtyTableAdapter.Fill(polyDataSet.Категория_врачебной_специальности);
     CardViewTableAdapter.Fill(polyDataSet.СхемаЛечения);
     PatientTableAdapter.Fill(polyDataSet.Пациент);
     DoctorTableAdapter.Fill(polyDataSet.Врачи);
     RegistryTableAdapter.Fill(polyDataSet.егистратура);
     RegistryViewTableAdapter.Fill(polyDataSet.СписокРегистратуры);
 }
Esempio n. 7
0
        public static void AssignNewBill(Bill newBill, string Name)
        {
            PatientTableAdapter taBill = new PatientTableAdapter();
            int pid = (int)taBill.GetPatientID(Name);
            BillTableAdapter taNewBill = new BillTableAdapter();
            //Returns the Bill_id so that we may assign it in the Patient_Bill Connector Table.
            var ScopeID = taNewBill.AddBillReturnScopeID(newBill.PatientType, newBill.MedicineCharge, newBill.DoctorCharge,
                                                         newBill.RoomCharge, newBill.OperationCharge, newBill.NursingCharge,
                                                         newBill.LabCharge, newBill.BillTotal, newBill.InsuranceCarrier);

            //Add row to Patient_Bill table using PID and Bill_id
            taNewBill.InsertBillByPidScopeID(pid, Convert.ToInt32(ScopeID));

            //Add Bill to our Bills list
            //Bills.Add(newBill);
        }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        if (CaptchaControl1.UserValidated)
        {

            if (RadioButtonList1.SelectedIndex == 1)
            {
                PatientTableAdapter adap_patient = new PatientTableAdapter();
                DataSet1.PatientDataTable dt = adap_patient.GetData(UserName.Text, Password.Text);
                if (dt.Rows.Count > 0)
                {
                    Session["PatientID"] = dt.Rows[0][0].ToString();
                    Master.DataFromPageLabelControl("Patient");
                    Session["name"] = dt.Rows[0][1].ToString();
                    Response.Redirect("~/Patient/PatHome.aspx");
                    //  Session["type"] = "Doctor";
                }
                else
                    FailureText.Text = "Login attempt failed, Please try again.";

            }
            else
            {
                DoctorTableAdapter adap_doctor = new DoctorTableAdapter();
                DataSet1.DoctorDataTable dt = adap_doctor.GetData(UserName.Text, Password.Text);
                if (dt.Rows.Count > 0)
                {
                    Session["DocID"] = dt.Rows[0][0].ToString();
                    Session["name"] = dt.Rows[0][1].ToString();
                    Master.DataFromPageLabelControl("Doctor");
                    Response.Redirect("~/Doctor/DoctorHome.aspx");
                }

                else
                    FailureText.Text = "Login attempt failed, Please try again.";

            }
        }
    }
Esempio n. 9
0
        public static List <Lab> LabsByPatient(string Name)
        {
            PatientTableAdapter taPatient = new PatientTableAdapter();
            int             pid           = Convert.ToInt32(taPatient.GetPatientID(Name));
            LabTableAdapter taPatientLab  = new LabTableAdapter();
            List <Lab>      patientLabs   = new List <Lab>();
            var             dtLabs        = taPatientLab.GetLabsByPid(pid);

            foreach (UltimateMedDB.Business.dsUltimateMedDB.LabRow labRow in dtLabs)
            {
                Lab currentLab = new Lab
                {
                    Amount      = labRow.Amount,
                    Category    = labRow.Category,
                    Date        = labRow.Date,
                    Doc_id      = labRow.Doc_id,
                    PatientType = labRow.PatientType,
                    Weight      = labRow.Weight
                };
                patientLabs.Add(currentLab);
            }
            return(patientLabs);
        }