예제 #1
0
 protected void printReceipt_btn_Click(object sender, EventArgs e)
 {
     if (patientId_txt.Text != "")
     {
         findvisitnumber obj1 = new findvisitnumber();
         int             pat  = obj1.findpatientid("SELECT patient_reg  FROM visit where patient_reg='" + patientId_txt.Text + "' and checks=0 and visit.visit_date='" + DateTime.Today + "';");
         if (pat == 0)
         {
             getvisitid();
             if (assignDoctor_dd.Text != "" && patientId_txt.Text != "")
             {
                 try
                 {
                     SqlConnection myConn        = new SqlConnection(constring);
                     String        query         = "insert into visit(patient_reg,visit_date,visit_no,employee_id,user_name,noti)values(@patient_reg, @date, @visit, @Refdoc, @userName,@noti);  insert into receipt (token_no,patient_reg,employee_id,total,Date,visit_no,receiptdate )values (@token, @patient_reg, @Refdoc, @fee, @date, @visit, @date);INSERT INTO Formulation (id,medication,investigation,counselling,direction,visit_no)VALUES(@patient_reg,'1','1','1','1',@visit)  ;";
                     SqlCommand    SelectCommand = new SqlCommand(query, myConn);
                     SqlDataReader myReader;
                     myConn.Open();
                     int token   = maxvalue.max("select max(token_no) from receipt where Date = '" + DateTime.Today.ToString("yyyy-MM-dd") + "';") + 1;
                     int reciept = maxvalue.max("select max(Receipt_id) from receipt") + 1;
                     SelectCommand.Parameters.Add(new SqlParameter("@token", Convert.ToInt32(token)));
                     SelectCommand.Parameters.Add(new SqlParameter("@patient_reg", Convert.ToInt32(patientId_txt.Text)));
                     SelectCommand.Parameters.Add(new SqlParameter("@Refdoc", assignDoctor_dd.SelectedValue));
                     SelectCommand.Parameters.Add(new SqlParameter("@date", DateTime.Today));
                     SelectCommand.Parameters.Add(new SqlParameter("@userName", "muaz"));
                     SelectCommand.Parameters.Add(new SqlParameter("@noti", 1));
                     SelectCommand.Parameters.Add(new SqlParameter("@visit", Convert.ToInt32(visit)));
                     SelectCommand.Parameters.Add(new SqlParameter("@fee", fee.Text));
                     myReader = SelectCommand.ExecuteReader();
                     myConn.Close();
                     Session["reciept"] = reciept;
                     Response.Redirect("../Receptionist/PatientInvoice.aspx");
                 }
                 catch (Exception ex)
                 {
                     errorMsg_alert.Visible = true;
                     error_lb.Text          = ex.Message;
                 }
             }
             else
             {
                 errorMsg_alert.Visible = true;
                 error_lb.Text          = "Fill Required Fields";
             }
         }
         else
         {
             errorMsg_alert.Visible = true;
             error_lb.Text          = "Patient Already Exists";
         }
     }
     else
     {
         errorMsg_alert.Visible = true;
         error_lb.Text          = "Please Select patient";
     }
 }
예제 #2
0
        protected void printReceipt_btn_Click(object sender, EventArgs e)
        {
            int           token         = max.max("select max(token_no) from receipt where Date = '" + DateTime.Today.ToString("yyyy-MM-dd") + "';") + 1;
            int           reciept       = max.max("select max(Receipt_id) from receipt") + 1;
            SqlConnection myConn        = new SqlConnection(constring);
            String        query         = "insert into visit(patient_reg,visit_date,visit_no,employee_id,user_name,noti)values(@PatientId,@date,@VisitNo,@DoctorAssign,@user_name,@noti);insert into receipt(token_no, patient_reg, employee_id, total, Date, visit_no, receiptdate)values(@tokenNo, @PatientId, @DoctorAssign, @fee, @date, @VisitNo, @reciptNo);INSERT INTO Formulation (id,medication,investigation,counselling,direction,visit_no)VALUES(@PatientId,'1','1','1','1',@VisitNo)";
            SqlCommand    SelectCommand = new SqlCommand(query, myConn);
            SqlDataReader myReader;

            SelectCommand.Parameters.Add(new SqlParameter("@PatientId", Convert.ToInt32(Request.QueryString["id"])));
            SelectCommand.Parameters.Add(new SqlParameter("@date", DateTime.Today));
            SelectCommand.Parameters.Add(new SqlParameter("@VisitNo", Convert.ToInt32("1")));
            SelectCommand.Parameters.Add(new SqlParameter("@DoctorAssign", assignDoctor_dd.SelectedValue));
            SelectCommand.Parameters.Add(new SqlParameter("@user_name", "*****@*****.**"));
            SelectCommand.Parameters.Add(new SqlParameter("@tokenNo", token));
            SelectCommand.Parameters.Add(new SqlParameter("@noti", 1));
            SelectCommand.Parameters.Add(new SqlParameter("@fee", Convert.ToInt32(totalFee_txt.Text)));
            SelectCommand.Parameters.Add(new SqlParameter("@reciptNo", reciept));
            myConn.Open();
            myReader = SelectCommand.ExecuteReader();
            myConn.Close();
            Session["reciept"] = reciept;
            Response.Redirect("../Receptionist/PatientInvoice.aspx");
        }
예제 #3
0
        public void GetHistory()
        {
            maxvisit = obj1.max("Select max(visit_no) from investigation where id='" + patientId_txt.Text + "';");
            if (maxvisit == Convert.ToInt32(visitNumber_txt.Text))
            {
                submit_btn.Visible = false;
                update_btn.Visible = true;
            }
            else
            {
                update_btn.Visible = false;
                submit_btn.Visible = true;
            }
            if (maxvisit > 0)
            {
                try
                {
                    patientId_txt.Text = id;
                    SqlConnection con = new SqlConnection(constring);
                    SqlCommand    cmd = new SqlCommand("SELECT * FROM investigation where id='" + id + "' and visit_no='" + maxvisit + "'", con);
                    cmd.Connection = con;
                    SqlDataReader dr;
                    con.Open();
                    dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        completeBloodExaminationComments_area.InnerText = dr["completeBloodExamination"].ToString();
                        completeUrineExaminationComments_area.InnerText = dr["completeUrineExamination"].ToString();
                        liverTestComments_area.InnerText = dr["liverFunctionTest"].ToString();
                        ecgComments_area.InnerText       = dr["ecg"].ToString();

                        if ((Convert.ToInt32(dr["bloodSugarRb"].ToString()) == 1))
                        {
                            fasting_radio.Checked = true;
                            random_radio.Checked  = false;
                        }
                        else
                        {
                            random_radio.Checked = true;
                        }

                        bloodSugarComments_area.InnerText      = dr["bloodSugarArea"].ToString();
                        thyroidFunctionComments_area.InnerText = dr["thyroidFuctionTest"].ToString();
                        radiographyComments_area.InnerText     = dr["radiography"].ToString();
                        ulgrasonographyComments_area.InnerText = dr["ulgranSonography"].ToString();
                        ctScanComments_area.InnerText          = dr["ctScan"].ToString();
                        otherComments_area.InnerText           = dr["otherComments"].ToString();

                        if (Convert.ToInt32(dr["completeBloodRadio"]) == 1)
                        {
                            yesCompleteBloodExamination_radio.Checked = true;
                        }
                        else
                        {
                            noCompleteBloodExamination_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["completeUrineRadio"]) == 1)
                        {
                            yesCompleteUrineExamination_radio.Checked = true;
                        }
                        else
                        {
                            noCompleteUrineExamination_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["liverFunctionRadio"]) == 1)
                        {
                            yesLiverFunction_radio.Checked = true;
                        }
                        else
                        {
                            noLiverFuntion_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["ecgRadio"]) == 1)
                        {
                            yesECG_radio.Checked = true;
                        }
                        else
                        {
                            noECG_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["bloodSugarRadio"]) == 1)
                        {
                            yesBloodSugar_radio.Checked = true;
                        }
                        else
                        {
                            noBloodSugar_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["thyroidFunctionRadio"]) == 1)
                        {
                            yesThyroid_radio.Checked = true;
                        }
                        else
                        {
                            noThyroid_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["radiographyRadio"]) == 1)
                        {
                            yesRadiography_radio.Checked = true;
                        }
                        else
                        {
                            noRadiography_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["ulgraRadio"]) == 1)
                        {
                            yesUlgra_radio.Checked = true;
                        }
                        else
                        {
                            noUlgra_radio.Checked = true;
                        }

                        if (Convert.ToInt32(dr["ctScanRadio"]) == 1)
                        {
                            yesCT_radio.Checked = true;
                        }
                        else
                        {
                            noCT_radio.Checked = true;
                        }
                    }
                    else
                    {
                        completeBloodExaminationComments_area.InnerText = "";
                        completeUrineExaminationComments_area.InnerText = "";
                        liverTestComments_area.InnerText       = "";
                        ecgComments_area.InnerText             = "";
                        bloodSugarComments_area.InnerText      = "";
                        thyroidFunctionComments_area.InnerText = "";
                        radiographyComments_area.InnerText     = "";
                        ulgrasonographyComments_area.InnerText = "";
                        ctScanComments_area.InnerText          = "";
                        otherComments_area.InnerText           = "";
                    }

                    con.Close();
                }
                catch (Exception ex)
                {
                    alert_fail.Visible = true;
                    error.Text         = "Error! " + ex.ToString();
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
                }
            }
        }
        public void GetHistory()
        {
            maxvisit = obj1.max("Select max(visit_no) from systematicExamination where id='" + patientId_txt.Text + "';");
            if (maxvisit == Convert.ToInt32(visitNumber_txt.Text))
            {
                submit_btn.Visible = false;
                update_btn.Visible = true;
            }
            else
            {
                update_btn.Visible = false;
                submit_btn.Visible = true;
            }

            if (maxvisit > 0)
            {
                try
                {
                    SqlConnection con = new SqlConnection(constring);
                    SqlCommand    cmd = new SqlCommand("SELECT * FROM systematicExamination where id='" + id + "' and visit_no='" + maxvisit + "'", con);
                    cmd.Connection = con;
                    SqlDataReader dr;
                    con.Open();
                    dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        signsOfMeningial_dd.SelectedValue = dr["meningialIrritation"].ToString();
                        if ((Convert.ToInt32(dr["cranialNervesRadio"].ToString()) == 1))
                        {
                            nocranialNerves_radio.Checked  = false;
                            yescranialNerves_radio.Checked = true;
                        }
                        else
                        {
                            nocranialNerves_radio.Checked = true;
                        }
                        sensorySystem_area.InnerText = dr["sensorySystem"].ToString();
                        if ((Convert.ToInt32(dr["motorSystemRadio"].ToString()) == 1))
                        {
                            noMotorSystem_radio.Checked  = false;
                            yesMotorSystem_radio.Checked = true;
                        }
                        else
                        {
                            noMotorSystem_radio.Checked = true;
                        }
                        TextBox1.Text       = dr["carnivalNervers"].ToString();
                        Textarea2.InnerText = dr["motorSystem"].ToString();
                        superficialReflexesComments_txt.Text = dr["superficialReflexes"].ToString();
                        TextBox3.Text = dr["deepReflexes"].ToString();
                        cerebellarFunctions_area.InnerText = dr["cerebellarFunctions"].ToString();
                        Textarea3.InnerText = dr["fundoscopy"].ToString();
                        cardiovascularSystem_area.InnerText   = dr["cardioVascularSystem"].ToString();
                        respiratorySystem_area.InnerText      = dr["respiratorySystem"].ToString();
                        gastrointestinalSystem_area.InnerText = dr["gastroIntestinalSystem"].ToString();
                        urogenitalSystem_area.InnerText       = dr["urogenitalSystem"].ToString();
                        if ((Convert.ToInt32(dr["sensorySystemRadio"].ToString()) == 1))
                        {
                            nosensorySystem_radio.Checked  = false;
                            yessensorySystem_radio.Checked = true;
                        }
                        else
                        {
                            nosensorySystem_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["motorSystemRadio"].ToString()) == 1))
                        {
                            noMotorSystem_radio.Checked  = false;
                            yesMotorSystem_radio.Checked = true;
                        }
                        else
                        {
                            noMotorSystem_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["superficialRadio"].ToString()) == 1))
                        {
                            noSuperficial_radio.Checked  = false;
                            yesSuperficial_radio.Checked = true;
                        }
                        else
                        {
                            noSuperficial_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["deepReflexRadio"].ToString()) == 1))
                        {
                            noDeepReflexes_radio.Checked  = false;
                            yesDeepReflexes_radio.Checked = true;
                        }
                        else
                        {
                            noDeepReflexes_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["cerebellarRadio"].ToString()) == 1))
                        {
                            noCerebellar_radio.Checked  = false;
                            yesCerebellar_radio.Checked = true;
                        }
                        else
                        {
                            noCerebellar_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["fundoscopyRadio"].ToString()) == 1))
                        {
                            noFundoscopy_radio.Checked  = false;
                            yesFundoscopy_radio.Checked = true;
                        }
                        else
                        {
                            noFundoscopy_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["cardiovascularRadio"].ToString()) == 1))
                        {
                            noCardiovascular_radio.Checked  = false;
                            yesCardiovascular_radio.Checked = true;
                        }
                        else
                        {
                            noCardiovascular_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["respiratoryRadio"].ToString()) == 1))
                        {
                            noRespiratory_radio.Checked  = false;
                            yesRespiratory_radio.Checked = true;
                        }
                        else
                        {
                            noRespiratory_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["gastrointestinalRadio"].ToString()) == 1))
                        {
                            noGastrointes_radio.Checked  = false;
                            yesGastrointes_radio.Checked = true;
                        }
                        else
                        {
                            noGastrointes_radio.Checked = true;
                        }
                        if ((Convert.ToInt32(dr["urogenitalRadio"].ToString()) == 1))
                        {
                            noUrogenital_radio.Checked  = false;
                            yesUrogenital_radio.Checked = true;
                        }
                        else
                        {
                            noUrogenital_radio.Checked = true;
                        }
                    }
                    else
                    {
                        sensorySystem_area.InnerText         = "";
                        Textarea2.InnerText                  = "";
                        superficialReflexesComments_txt.Text = "";
                        TextBox3.Text = "";
                        cerebellarFunctions_area.InnerText = "";
                        Textarea3.InnerText = "";
                        cardiovascularSystem_area.InnerText   = "";
                        respiratorySystem_area.InnerText      = "";
                        gastrointestinalSystem_area.InnerText = "";
                        urogenitalSystem_area.InnerText       = "";
                    }

                    con.Close();
                }
                catch (Exception ex)
                {
                    alert_fail.Visible = true;
                    error.Text         = "Error! " + ex.ToString();
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
                }
            }
        }
        public void GetHistory()
        {
            maxvisit = obj1.max("Select max(visit_no) from generalPhysicalExamination where id='" + patientId_txt.Text + "';");
            if (maxvisit == Convert.ToInt32(visitNumber_txt.Text))
            {
                submit_btn.Visible = false;
                update_btn.Visible = true;
            }
            else
            {
                update_btn.Visible = false;
                submit_btn.Visible = true;
            }

            if (maxvisit > 0)
            {
                try
                {
                    SqlConnection con = new SqlConnection(constring);
                    SqlCommand    cmd = new SqlCommand("SELECT  * FROM generalPhysicalExamination where id='" + id + "' and visit_no='" + maxvisit + "'", con);
                    cmd.Connection = con;
                    SqlDataReader dr;
                    con.Open();
                    dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        height_dd.SelectedValue      = dr["height"].ToString();
                        weight_dd.SelectedValue      = dr["weight"].ToString();
                        pulse_dd.SelectedValue       = dr["pulse"].ToString();
                        skinEruption_txt.Text        = dr["skinEruption"].ToString();
                        skinEruption_dd.Text         = dr["skinErruptionDd"].ToString();
                        lyingSystolic_txt.Text       = dr["lyingSystolic"].ToString();
                        sittingSystolic_txt.Text     = dr["sittingSystolic"].ToString();
                        standingSystolic_txt.Text    = dr["standingSystolic"].ToString();
                        lyingDiastolic_txt.Text      = dr["lyingDiastolic"].ToString();
                        sittingDiastolic_txt.Text    = dr["sittingDiastolic"].ToString();
                        standingDiastolic_txt.Text   = dr["standingDiastolic"].ToString();
                        temperatureComments_txt.Text = dr["temperature"].ToString();
                        dehydrationComments_txt.Text = dr["dehydration"].ToString();
                        pallorComment_txt.Text       = dr["pallorTxt"].ToString();
                        if ((Convert.ToInt32(dr["pallorRb"].ToString()) == 1))
                        {
                            pallorNo_radio.Checked  = false;
                            pallorYes_radio.Checked = true;
                        }
                        else
                        {
                            pallorNo_radio.Checked = true;
                        }
                        jaundiceComment_txt.Text = dr["jaundiceTxt"].ToString();
                        if ((Convert.ToInt32(dr["jaundiceRb"].ToString()) == 1))
                        {
                            jaundiceNo_radio.Checked  = false;
                            jaundiceYes_radio.Checked = true;
                        }
                        else
                        {
                            jaundiceNo_radio.Checked = true;
                        }
                        oedemaComments_txt.Text = dr["oedemaTxt"].ToString();
                        if ((Convert.ToInt32(dr["oedemaRb"].ToString()) == 1))
                        {
                            oedemaNo_radio.Checked  = false;
                            oedemaYes_radio.Checked = true;
                        }
                        else
                        {
                            oedemaNo_radio.Checked = true;
                        }
                        kylonchiaComments_txt.Text = dr["kylonychiaTxt"].ToString();
                        if ((Convert.ToInt32(dr["kylonychiaRb"].ToString()) == 1))
                        {
                            kylonchiaNo_radio.Checked   = false;
                            kylonychiaYes_radio.Checked = true;
                        }
                        else
                        {
                            kylonchiaNo_radio.Checked = true;
                        }
                        thyroidComments_txt.Text = dr["thyroidGlandTxt"].ToString();
                        if ((Convert.ToInt32(dr["thyroidGlandRb"].ToString()) == 1))
                        {
                            thyroidNo_radio.Checked  = false;
                            thyroidYes_radio.Checked = true;
                        }
                        else
                        {
                            thyroidNo_radio.Checked = true;
                        }
                        clubbingComments_txt.Text = dr["clubbingTxt"].ToString();
                        if ((Convert.ToInt32(dr["clubbingRb"].ToString()) == 1))
                        {
                            clubbingNo_radio.Checked  = false;
                            clubbingYes_radio.Checked = true;
                        }
                        else
                        {
                            clubbingNo_radio.Checked = true;
                        }
                        respirationComments_txt.Text = dr["respirationRateTxt"].ToString();
                        if ((Convert.ToInt32(dr["respirationRateRb"].ToString()) == 1))
                        {
                            respirationNo_radio.Checked  = false;
                            respirationYes_radio.Checked = true;
                        }
                        else
                        {
                            respirationNo_radio.Checked = true;
                        }
                        lymphComments_txt.Text = dr["lymphNodeTxt"].ToString();
                        if ((Convert.ToInt32(dr["lymphNodeRb"].ToString()) == 1))
                        {
                            lymphNo_radio.Checked  = false;
                            lymphYes_radio.Checked = true;
                        }
                        else
                        {
                            lymphNo_radio.Checked = true;
                        }
                        jvp1_dd.Text         = dr["jvpTxt"].ToString();
                        jvp_dd.SelectedValue = dr["jvpDD"].ToString();
                        if ((Convert.ToInt32(dr["dehydrationRadio"].ToString()) == 1))
                        {
                            yesDehydration_radio.Checked = true;
                            noDehydration_radio.Checked  = false;
                        }
                        else
                        {
                            noDehydration_radio.Checked = true;
                        }

                        if ((Convert.ToInt32(dr["swellingRadio"].ToString()) == 1))
                        {
                            yesSwelling_radio.Checked = true;
                            noSwelling_radio.Checked  = false;
                        }
                        else
                        {
                            noSwelling_radio.Checked = true;
                        }

                        if ((Convert.ToInt32(dr["pigmentationRadio"].ToString()) == 1))
                        {
                            yesPigmentation_radio.Checked = true;
                            noPigmentation_radio.Checked  = false;
                        }
                        else
                        {
                            noPigmentation_radio.Checked = true;
                        }

                        if ((Convert.ToInt32(dr["repigmentationRadio"].ToString()) == 1))
                        {
                            yesRepigmentation_radio.Checked = true;
                            noRepigmentation_radio.Checked  = false;
                        }
                        else
                        {
                            noRepigmentation_radio.Checked = true;
                        }
                    }
                    else
                    {
                        //height_dd.Text = "";
                        //weight_dd.Text = "";
                        //pulse_dd.Text = "";
                        skinEruption_txt.Text        = "";
                        lyingDiastolic_txt.Text      = "";
                        sittingDiastolic_txt.Text    = "";
                        standingDiastolic_txt.Text   = "";
                        lyingSystolic_txt.Text       = "";
                        sittingSystolic_txt.Text     = "";
                        standingSystolic_txt.Text    = "";
                        temperatureComments_txt.Text = "";
                        dehydrationComments_txt.Text = "";
                        pallorComment_txt.Text       = "";
                        jaundiceComment_txt.Text     = "";
                        oedemaComments_txt.Text      = "";
                        kylonchiaComments_txt.Text   = "";
                        thyroidComments_txt.Text     = "";
                        clubbingComments_txt.Text    = "";
                        respirationComments_txt.Text = "";
                        lymphComments_txt.Text       = "";
                    }

                    con.Close();
                }
                catch (Exception ex)
                {
                    alert_fail.Visible = true;
                    error.Text         = "Error! " + ex.ToString();
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
                }
            }
        }
예제 #6
0
        public void GetHistory()
        {
            string query1 = "Select max(visit_no) from Formulation where id='" + patient.Text + "';";

            maxvisit           = obj1.max(query1);
            submit_btn.Visible = false;
            update.Visible     = true;
            if (maxvisit > 0)
            {
                try
                {
                    string        query = "Select * from Formulation where id='" + id + "' and visit_no='" + maxvisit + "'";
                    SqlConnection con   = new SqlConnection(constring);
                    SqlCommand    cmd   = new SqlCommand(query, con);
                    cmd.Connection = con;
                    SqlDataReader dr;
                    con.Open();
                    dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        if (dr["investigation"].ToString() == "1")
                        {
                            investigation_cb.Checked = true;
                        }
                        else
                        {
                            investigation_cb.Checked = false;
                        }
                        if (dr["medication"].ToString() == "1")
                        {
                            medication_cb.Checked = true;
                        }
                        else
                        {
                            medication_cb.Checked = false;
                        }
                        if (dr["counselling"].ToString() == "1")
                        {
                            counseliing_cb.Checked = true;
                        }
                        else
                        {
                            counseliing_cb.Checked = false;
                        }
                        if (dr["direction"].ToString() == "1")
                        {
                            direction_cb.Checked = true;
                        }
                        else
                        {
                            direction_cb.Checked = false;
                        }
                    }
                    else
                    {
                        direction_cb.Checked     = false;
                        counseliing_cb.Checked   = false;
                        investigation_cb.Checked = false;
                        medication_cb.Checked    = false;
                    }

                    con.Close();
                }
                catch (Exception ex)
                {
                    alert_fail.Visible = true;
                    error.Text         = "Error! " + ex.ToString();
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
                }
            }
        }
예제 #7
0
        void pasthistory()
        {
            maxvisit = obj1.max("Select max(visit_no) from general_history where patient_reg='" + patientId_txt.Text + "';");
            if (maxvisit == Convert.ToInt32(visitNumber_txt.Text))
            {
                saveBtn.Visible   = false;
                updateBtn.Visible = true;
            }
            else
            {
                updateBtn.Visible = false;
                saveBtn.Visible   = true;
            }

            if (maxvisit > 0)
            {
                try
                {
                    string        query = "SELECT * FROM general_history where patient_reg=@patientId_txt and visit_no=@visitNumber_txt;";
                    SqlConnection con   = new SqlConnection(constring);
                    SqlCommand    cmd   = new SqlCommand();
                    cmd.Parameters.Add(new SqlParameter("@patientId_txt", Convert.ToInt32(patientId_txt.Text)));
                    cmd.Parameters.Add(new SqlParameter("@visitNumber_txt", Convert.ToInt32(visitNumber_txt.Text)));
                    cmd.Connection  = con;
                    cmd.CommandText = query;
                    con.Open();
                    SqlDataReader dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        if (dr["diabetes"].ToString() == "1")
                        {
                            diabetesYes_radio.Checked = true;
                            diabetesNo_radio.Checked  = false;
                            diabetesDuration_dd.Text  = dr["diabetes_duration"].ToString();
                            diabetesControl_dd.Text   = dr["diabetes_control"].ToString();
                            hbAic_dd.Text             = dr["hbaic"].ToString();
                            diabetesFbs_txt.Text      = dr["FBS"].ToString();
                            if (dr["insulin"].ToString() == "1")
                            {
                                insulinYes_radio.Checked = true;
                                insulinNo_radio.Checked  = false;
                                insulinDosage_txt.Text   = dr["insulin_dosage"].ToString();
                            }
                            else
                            {
                                insulinYes_radio.Checked = false;
                                insulinNo_radio.Checked  = true;

                                diabtesControl_leb.Visible  = false;
                                diabetesControl_dd.Visible  = false;
                                diabetesDuration_dd.Visible = false;
                                diabtesDuration_leb.Visible = false;

                                insulinDosage_txt.Text = "";
                            }
                        }
                        else
                        {
                            diabetesDuration_dd.Text  = "";
                            diabetesControl_dd.Text   = "";
                            hbAic_dd.Text             = "";
                            diabetesFbs_txt.Text      = "";
                            diabetesYes_radio.Checked = false;
                            diabetesNo_radio.Checked  = true;
                        }
                        if (dr["hypertention"].ToString() == "1")
                        {
                            Hypertensionyes.Checked     = true;
                            HypertensionNo.Checked      = false;
                            hypertensionControl_dd.Text = dr["hypertention_duration"].ToString();
                            Hypertension_duration.Text  = dr["hypertention_control"].ToString();
                        }
                        else
                        {
                            Hypertensionyes.Checked = false;
                            HypertensionNo.Checked  = true;

                            hypertensionControl_dd.Text = "";
                            Hypertension_duration.Text  = "";
                        }

                        cardiac_txt.Text      = dr["cardiac"].ToString();
                        respiratory_txt.Text  = dr["respiratory"].ToString();
                        renal_txt.Text        = dr["rinal"].ToString();
                        cancer_txt.Text       = dr["cancer"].ToString();
                        OtherIllness_txt.Text = dr["other_illness"].ToString();
                        con.Close();
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }