Example #1
0
        // Update Departamento
        public static int U1()
        {
            Console.WriteLine("Update Departamento");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Descricao? = ");
            var          desc = Console.ReadLine();
            Departamento d    = new Departamento();
            Departamento ans  = new Departamento();

            d.Sigla     = sigla;
            d.Descricao = desc;
            ans         = UpdateFunctions.UpdateDepartamento(d);
            if (ans == null)
            {
                Console.WriteLine("An error has ocurred. Department wasn't updated.");
                return(-1);
            }
            else
            {
                Console.WriteLine("Department {0} was updated with description \"{1}\".", ans.Sigla, ans.Descricao);
                return(0);
            }
        }
Example #2
0
        // Update Seccao
        public static int U2()
        {
            Console.WriteLine("Update Seccao");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Departamento? = ");
            var dep = Console.ReadLine();

            Console.Write("Coordenador? = ");
            var coo = Console.ReadLine();

            Console.Write("Descricao? = ");
            var    desc = Console.ReadLine();
            Seccao s    = new Seccao();
            Seccao ans  = new Seccao();

            s.Sigla        = sigla;
            s.Departamento = dep;
            s.Coordenador  = coo;
            s.Descricao    = desc;
            ans            = UpdateFunctions.UpdateSeccao(s);
            if (ans == null)
            {
                Console.WriteLine("An error has ocurred. Seccao wasn't updated.");
                return(-1);
            }
            else
            {
                Console.WriteLine("Seccao {0} updated.", ans.Sigla);
                return(0);
            }
        }
Example #3
0
 public void Tick(float dtime)
 {
     if (I.Status == EngineStatus.LoadedWorld)
     {
         Triggers.ForEach(x => x.AcceptTrigger());
         UpdateFunctions.ForEach(f => f.Value.Call(f.Key, dtime));
     }
 }
Example #4
0
        public static void TesteUpdateDepartamento(string sigla, string desc)
        {
            Departamento d = new Departamento();

            d.Sigla     = sigla;
            d.Descricao = desc;
            d           = UpdateFunctions.UpdateDepartamento(d);
            Console.WriteLine("Departamento " + d.Sigla + "\t" + "updated with descrpition " + d.Descricao);
        }
Example #5
0
 static public void updateAll()
 {
     // Update all containers.
     foreach (Transform Allegiance in everything)
     {
         foreach (Transform container in Allegiance)
         {
             UpdateFunctions.update(container);
         }
     }
 }
Example #6
0
        public static void UpdateSeccao(string sigla, string departamento, string coordenador, string desc)
        {
            Seccao s = new Seccao();

            s.Sigla        = sigla;
            s.Departamento = departamento;
            s.Coordenador  = coordenador;
            s.Descricao    = desc;
            s = UpdateFunctions.UpdateSeccao(s);
            Console.WriteLine("Seccao " + s.Sigla + "\t" + " updated");
        }
Example #7
0
        public static void TesteUpdateUC(string sigla, DateTime data, int creditos, string descricao, string regente)
        {
            UnidadeCurricular uc = new UnidadeCurricular();

            uc._ID.Sigla = sigla;
            uc._ID.Data  = data;
            uc.Creditos  = creditos;
            uc.Descricao = descricao;
            uc.Regente   = regente;
            uc           = UpdateFunctions.UpdateUnidadeCurricular(uc);
            Console.WriteLine("Unidade Curricular " + uc._ID.Sigla + "\t" + " updated");
        }
Example #8
0
        /********************************************************************************************
        * Button Click that allows user to update patient demographic information
        * ******************************************************************************************/
        private void bEdit_Click(object sender, EventArgs e)
        {
            if (bEdit.Text == "Edit")
            {
                tbFirstname.ReadOnly          = false;
                tbLastname.ReadOnly           = false;
                tbGender.ReadOnly             = false;
                tbDateOfLastVisit.ReadOnly    = false;
                tbStreet.ReadOnly             = false;
                tbCity.ReadOnly               = false;
                tbState.ReadOnly              = false;
                tbZip.ReadOnly                = false;
                tbDOB.ReadOnly                = false;
                tbPhone.ReadOnly              = false;
                tbPrimaryInsurance.ReadOnly   = false;
                tbSecondaryInsurance.ReadOnly = false;

                bEdit.Text = "Submit Changes";
            }
            else if (bEdit.Text == "Submit Changes")
            {
                tbFirstname.ReadOnly          = true;
                tbLastname.ReadOnly           = true;
                tbGender.ReadOnly             = true;
                tbDateOfLastVisit.ReadOnly    = true;
                tbStreet.ReadOnly             = true;
                tbCity.ReadOnly               = true;
                tbState.ReadOnly              = true;
                tbZip.ReadOnly                = true;
                tbDOB.ReadOnly                = true;
                tbPhone.ReadOnly              = true;
                tbPrimaryInsurance.ReadOnly   = true;
                tbSecondaryInsurance.ReadOnly = true;

                //TODO: Pull information from text boxes here and update database.
                //need to fix to where if nothing is updated it doesnt output the Message box that says we have updated records for this patient
                int Updated = UpdateFunctions.UpdateDemographics(Int32.Parse(PatientId), tbFirstname.Text, tbLastname.Text, tbGender.Text, tbDateOfLastVisit.Text, tbStreet.Text, tbCity.Text, tbState.Text, tbZip.Text, tbDOB.Text, tbPhone.Text, tbPrimaryInsurance.Text, tbSecondaryInsurance.Text);
                if (Updated == 1)
                {
                    MessageBox.Show("You Have Updated the Records for This Patient");
                }
                else
                {
                    MessageBox.Show("No Records Updated");
                }
                bEdit.Text = "Edit";
            }
        }
Example #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            string str  = htb.Text.Trim();
            string str1 = wtb.Text.Trim();
            string str2 = o2sattb.Text.Trim();
            string str3 = HRtb.Text.Trim();
            string str4 = RRtb.Text.Trim();
            string str5 = temptb.Text.Trim();
            string str6 = systolictb.Text.Trim();
            string str7 = diastolictb.Text.Trim();

            int    heightCheck, weightCheck, o2Check, heartRateCheck, respiratoryRateCheck, systolicCheck, diastolicCheck;
            double temperatureCheck;

            bool isHeightCheck          = int.TryParse(str, out heightCheck);
            bool isWeightCheck          = int.TryParse(str1, out weightCheck);
            bool isO2Check              = int.TryParse(str2, out o2Check);
            bool isHeartRateCheck       = int.TryParse(str3, out heartRateCheck);
            bool isRespiratoryRateCheck = int.TryParse(str4, out respiratoryRateCheck);
            bool isTemperatureCheck     = double.TryParse(str5, out temperatureCheck);
            bool isSystolicCheck        = int.TryParse(str6, out systolicCheck);
            bool isDiastolicCheck       = int.TryParse(str7, out diastolicCheck);



            if (HRtb.Text == "" || systolictb.Text == "" || diastolictb.Text == "" || RRtb.Text == "" || o2sattb.Text == "" || attb.Text == "" || htb.Text == "" || wtb.Text == "" || temptb.Text == "")
            {
                MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
                return;
            }
            if (isHeightCheck && isWeightCheck && isO2Check && isHeartRateCheck && isRespiratoryRateCheck && isTemperatureCheck && editing == false)
            {
                string inserted = InsertFunctions.InsertIntoVitalsInformation(DateTime.Parse(dateTimePicker1.Text), int.Parse(HRtb.Text), Int32.Parse(systolictb.Text), Int32.Parse(RRtb.Text), Int32.Parse(diastolictb.Text), Int32.Parse(o2sattb.Text), attb.Text, Int32.Parse(htb.Text), Int32.Parse(wtb.Text), double.Parse(temptb.Text), PatientID);
                MessageBox.Show(inserted);
                this.Close();
            }
            else if (editing == true)
            {
                UpdateFunctions.UpdateVitalsInfo(PatientID, DateTime.Parse(dateTimePicker1.Text), HRtb.Text, systolictb.Text, RRtb.Text, diastolictb.Text, o2sattb.Text, attb.Text, htb.Text, wtb.Text, temptb.Text, DateTime.Parse(dateTaken), heartRate, systolic, diastolic, respiratoryRate, O2Sat, airType, height, weight, temperature);
                this.Close();
            }
            else
            {//if you have time check each individual text box
                MessageBox.Show("Must add numerical values for: \n\n Heart Rate \n Blood Pressure Values \n Respiratory Rate \n Oxygen Saturation \n Height \n Weight \n Temperature", "Error");
            }
        }
Example #10
0
        /********************************************************************************************
        * Button Click that opens new form for user to insert notes for the current patient
        * ******************************************************************************************/
        private void button2_Click(object sender, EventArgs e)
        {
            if (addNotes.Text.Contains("Edit"))
            {
                tbNotes.ReadOnly = false;

                addNotes.Text = "Submit Addition";
                tbNotes.AppendText(System.Environment.NewLine + System.Environment.NewLine + getCurrentDate() + "\n");
                tbNotes.Focus();
            }
            else if (addNotes.Text.Contains("Submit"))
            {
                tbNotes.ReadOnly = true;

                UpdateFunctions.UpdateNotes(Int32.Parse(PatientId), tbNotes.Text);
                addNotes.Text = "Edit Notes";
            }
        }
Example #11
0
 private void addBackgroundInfobtn_Click(object sender, EventArgs e)
 {
     if (diabetesType.Text == "")
     {
         MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
         return;
     }
     else if (editing == false)
     {
         string inserted = InsertFunctions.InsertIntoDiabetesBackground(dateInfoTaken.Text, dateDiagnosed.Text, diabetesType.Text, PatientID);
         MessageBox.Show(inserted);
         this.Close();
     }
     else if (editing == true)
     {
         UpdateFunctions.UpdateDiabetesBackgroundInfo(PatientID, dateInfoTaken.Text, dateDiagnosed.Text, diabetesType.Text, editDateInfoTaken, editDateDiagnosed, editDiabetesType);
         this.Close();
     }
 }
Example #12
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (medicationTb.Text == "" || amounttb.Text == "" || frequencytb.Text == "" || routeTb.Text == "")
     {
         MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
         return;
     }
     if (editing == false)
     {
         string inserted = InsertFunctions.InsertIntoMedication(medicationTb.Text, dateTimePicker1.Text, amounttb.Text, frequencytb.Text, routeTb.Text, PatientID);
         MessageBox.Show(inserted);
         this.Close();
     }
     else if (editing == true)
     {
         UpdateFunctions.UpdateMedicationInfo(PatientID, medicationTb.Text, dateTimePicker1.Text, amounttb.Text, frequencytb.Text, routeTb.Text, editMedicationName, editDateStarted, editAmount, editFrequency, editRoute);
         this.Close();
     }
 }
Example #13
0
        private void addDiabeticTestbtn_Click(object sender, EventArgs e)
        {
            if (microalbumintb.Text == "" || footchecktb.Text == "" || cyvtb.Text == "" || eyeexamtb.Text == "" || counselingtb.Text == "" || datetestTaken.Text == "")
            {
                MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
                return;
            }

            else if (editing == false)
            {
                string inserted = InsertFunctions.InsertIntoDiabeticTests(datetestTaken.Text, microalbumintb.Text, footchecktb.Text, cyvtb.Text, eyeexamtb.Text, counselingtb.Text, PatientID);
                MessageBox.Show(inserted);
                this.Close();
            }
            else if (editing == true)
            {
                UpdateFunctions.UpdateDiabeticTestInfo(PatientID, datetestTaken.Text, microalbumintb.Text, footchecktb.Text, cyvtb.Text, eyeexamtb.Text, counselingtb.Text, dateOfTest, microalbiumin, footCheck, currentYearVaccination, diabeticEyeExam, nutritionalCounseling);
                this.Close();
            }
        }
Example #14
0
 /********************************************************************************************
 * Button Click that calls the insert function for allergies and adds new rows to the database
 * based upon the current patient. It then closes this form.
 * ******************************************************************************************/
 private void updateAllergyButton_Click(object sender, EventArgs e)
 {
     if (AllergicTo.Text == "" || Reaction.Text == "")
     {
         MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
         return;
     }
     if (editing == false)
     {
         string insertedRows = InsertFunctions.InsertIntoAllergyInfo(PatientID, AllergicTo.Text, Reaction.Text);
         MessageBox.Show(insertedRows);
         AllergicTo.Clear();
         Reaction.Clear();
     }
     else if (editing == true)
     {
         UpdateFunctions.UpdateAllergyInfo(PatientID, AllergicTo.Text, Reaction.Text, editAllergicTo, editReaction);
         AllergicTo.Clear();
         Reaction.Clear();
         this.Close();
     }
 }
Example #15
0
        private void addLipidInfobtn_Click(object sender, EventArgs e)
        {
            string str  = cholesterolTb.Text.Trim();
            string str1 = HgA1ctb.Text.Trim();
            string str2 = HDLtb.Text.Trim();
            string str3 = LDLtb.Text.Trim();
            string str4 = trigylceridesTb.Text.Trim();

            double cholesterolCheck, hgCheck, HDLCheck, LDLCheck, triglyceridesCheck;

            bool ischolesterolCheck = double.TryParse(str, out cholesterolCheck);
            bool ishgCheck          = double.TryParse(str1, out hgCheck);
            bool isHDLCheck         = double.TryParse(str2, out HDLCheck);
            bool isLDLCheck         = double.TryParse(str3, out LDLCheck);
            bool isTRICheck         = double.TryParse(str4, out triglyceridesCheck);


            if (HgA1ctb.Text == "" || cholesterolTb.Text == "" || HDLtb.Text == "" || LDLtb.Text == "" || trigylceridesTb.Text == "")
            {
                MessageBox.Show("Something must be entered for each field. If patient is not applicable for a certain field enter 'N/A'.", "Attention", MessageBoxButtons.OK);
                return;
            }
            if (ischolesterolCheck && ishgCheck && isHDLCheck && isLDLCheck && isTRICheck && editing == false)
            {
                string inserted = InsertFunctions.InsertIntoLipidTest(DateTime.Parse(dateTimePicker1.Text), double.Parse(HgA1ctb.Text), double.Parse(cholesterolTb.Text), double.Parse(HDLtb.Text), double.Parse(LDLtb.Text), double.Parse(trigylceridesTb.Text), PatientID);
                MessageBox.Show(inserted);
                this.Close();
            }
            else if (editing == true)
            {
                UpdateFunctions.UpdateLipidTestInfo(PatientID, DateTime.Parse(dateTimePicker1.Text), HgA1ctb.Text, cholesterolTb.Text, HDLtb.Text, LDLtb.Text, trigylceridesTb.Text, DateTime.Parse(dateOfTest), HgA1C, cholesterol, HDL, LDL, triglycerides);
                this.Close();
            }
            else
            {
                MessageBox.Show("Must add numerical values for: \n\n HgA1C \n Cholesterol \n HDL \n LDL \n Triglycerides \n", "Error");
            }
        }
Example #16
0
        // Update UC
        public static int U3()
        {
            Console.WriteLine("Update Unidade Curricular");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Data? = ");
            var data = Console.ReadLine();

            Console.Write("Creditos? = ");
            var cr = Console.ReadLine();

            Console.Write("Descricao? = ");
            var desc = Console.ReadLine();

            Console.Write("Regente? = ");
            var reg = Console.ReadLine();
            UnidadeCurricular ans;
            UnidadeCurricular uc = new UnidadeCurricular();

            uc._ID.Sigla = sigla;
            uc._ID.Data  = DateTime.Parse(data);
            uc.Creditos  = int.Parse(cr);
            uc.Descricao = desc;
            uc.Regente   = reg;
            ans          = UpdateFunctions.UpdateUnidadeCurricular(uc);
            if (ans == null)
            {
                Console.WriteLine("An error has ocurred. Unidade Curricular wasn't updated.");
                return(-1);
            }
            else
            {
                Console.WriteLine("Unidade Curricular {0} was updated .", ans._ID.Sigla);
                return(0);
            }
        }
Example #17
0
        /********************************************************************************************
        * button click for updating the date of last visit
        * ******************************************************************************************/
        private void visitDateUpdate_Click(object sender, EventArgs e)
        {
            int DateUpdated = UpdateFunctions.UpdateDateOfLastVisit(Int32.Parse(PatientId), getCurrentDate());

            tbDateOfLastVisit.Text = getCurrentDate();
        }