public ActionResult SubmitResponse(SubmitResponseViewModel model)
        {
            try
            {
                InsertFunctions inserts      = new InsertFunctions();
                int             complaint_id = (int)Session["Complaint"];

                int response_id = inserts.InsertResponse(model.response, complaint_id);

                if (response_id != 0)
                {
                    foreach (var item in model.attachments)
                    {
                        //ATTACHEMENTS DOCUMENTS INSERT
                        string path          = Server.MapPath("~") + "attachments\\";
                        int    attachment_id = inserts.InsertAttachment(item, response_id, path);
                    }
                }

                return(View("Index"));
            }
            catch (Exception)
            {
                return(View("Index"));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Checks if each field is filled, if complete inserts data into database.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void insertButton_Click_1(object sender, EventArgs e)
        {
            if (dvtb.Text == "" || fnTb.Text == "" || lnTB.Text == "" || gtb.Text == "" || ptb.Text == "" || stb.Text == "" || sttb.Text == "" || ctb.Text == "" || ztb.Text == "" || dbtb.Text == "" || pitb.Text == "" || sitb.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;
            }
            string rowsInserted = InsertFunctions.InsertIntoDemographics(fnTb.Text, lnTB.Text, gtb.Text, dvtb.Text, stb.Text, ctb.Text, sttb.Text, ztb.Text, dbtb.Text, ptb.Text, pitb.Text, sitb.Text, ntb.Text);

            MessageBox.Show(rowsInserted);
            this.Close();
        }
Esempio n. 3
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");
            }
        }
Esempio n. 4
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();
     }
 }
Esempio n. 5
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();
     }
 }
Esempio n. 6
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();
            }
        }
Esempio n. 7
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();
     }
 }
Esempio n. 8
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");
            }
        }