protected void addRecord(object sender, EventArgs e)
        {
            string j;

            if (referDistrHosp.SelectedValue == "N")
            {
                j = "null";
            }
            else
            {
                j = distrHospitals.SelectedValue;
            }
            HttpCookie cookie = Request.Cookies["userInfo"];
            string     ee     = DataClass.SelectRecord("select em_id from employee where em_login='******'", "em_id");

            if (Request.RawUrl.Contains("field"))

            {
                DataClass.insertRecord(
                    "update patient set pa_fname='" + fname.Text + "', pa_lname='" + lname.Text + "', pa_mhr='" + mhr.Text + "', pa_gender='" + DropDownList5.SelectedValue +
                    "', pa_age=" + age.Text + ", pa_birth='" + birth.Text + "', pa__address='" + TextBox1.Text + "', pa_province=" + DropDownList6.SelectedValue +
                    ", pa_district=" + DropDownList3.SelectedValue + " where pa_id=" + Convert.ToInt32(Request.QueryString["field1"]) + "");
                DataClass.insertRecord(
                    "update hospital_admission set ho_id=" + Convert.ToInt32(hospitalBox.SelectedValue) + ", ha_icu_hdu=" + Convert.ToInt32(icuHdu.SelectedValue) + ", ha_date='" + adDate.Text + " " + adTime.Text +
                    "', ha_ICU_HDU_date='" + icuhdudatebox.Text + "', ha_type=" + Convert.ToInt32(DropDownList1.SelectedValue) +
                    ", ha_ref_district_hospital='" + referDistrHosp.SelectedValue + "', ha_district_hospital=" + j + ", in_id=" + Convert.ToInt32(DropDownList2.SelectedValue) +
                    ", ha_1sequence=" + Convert.ToInt32(ee) + " where ha_id=" + Convert.ToInt32(Request.QueryString["field2"]) + "");
            }
            else
            {
                if (GridView1.Rows.Count > 0)
                {
                    s = Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text);
                    DataClass.insertRecord(
                        "insert into hospital_admission (ho_id, pa_id, ha_icu_hdu, ha_date, ha_ICU_HDU_date, ha_type, ha_ref_district_hospital, ha_district_hospital, in_id, em_id, ha_patient_age, ha_1sequence) values("
                        + Convert.ToInt32(hospitalBox.SelectedValue) + ", "
                        + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + ", " + Convert.ToInt32(icuHdu.SelectedValue) + ", '"
                        + adDate.Text + " " + adTime.Text + "', '" + icuhdudatebox.Text + "', " + Convert.ToInt32(DropDownList1.SelectedValue) + ", '" + referDistrHosp.SelectedValue + "', " + j + ", " + Convert.ToInt32(DropDownList2.SelectedValue) + ", " + Convert.ToInt32(ee) + ", " + Convert.ToInt32(age.Text) + ", " + Convert.ToInt32(ee) + ")");
                }

                else
                {
                    DataClass.insertRecord(
                        "insert into patient (pa_fname, pa_lname, pa_mhr, pa_gender, pa_age, pa_birth, pa__address, pa_province, pa_district) values('" +
                        fname.Text + "', '" + lname.Text + "', '" + mhr.Text + "', '" + DropDownList5.SelectedValue + "', " + age.Text + ", '" + birth.Text + "', '" + TextBox1.Text + "', " + Convert.ToInt32(DropDownList6.SelectedValue) + ", " + Convert.ToInt32(DropDownList3.SelectedValue) + ")");
                    s = Convert.ToInt32(DataClass.SelectRecord("select max(pa_id) as pa from patient", "pa"));
                    DataClass.insertRecord(
                        "insert into hospital_admission (ho_id, pa_id, ha_icu_hdu, ha_date, ha_ICU_HDU_date, ha_type, ha_ref_district_hospital, ha_district_hospital, in_id, em_id, ha_patient_age, ha_1sequence) values("
                        + Convert.ToInt32(hospitalBox.SelectedValue) + ", " + s + ", " + Convert.ToInt32(icuHdu.SelectedValue) + ", '"
                        + adDate.Text + " " + adTime.Text + "', '" + icuhdudatebox.Text + "', " + Convert.ToInt32(DropDownList1.SelectedValue) + ", '" + referDistrHosp.SelectedValue + "', " + j + ", " + Convert.ToInt32(DropDownList2.SelectedValue) + ", " + Convert.ToInt32(ee) + ", " + Convert.ToInt32(age.Text) + ", " + Convert.ToInt32(ee) + ")");
                }
            }
        }
Exemple #2
0
        protected void addingRecord(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];
            string     ee     = DataClass.SelectRecord("select em_id from employee where em_login='******'", "em_id");

            DataClass.insertRecord("update hospital_admission set ha_sepsis_body_temp='" + bodytemp.SelectedValue +
                                   "', ha_sepsis_hr='" + heartRateSep.SelectedValue +
                                   "', ha_sepsis_resp_rate='" + respRateSep.SelectedValue +
                                   "', ha_sepsis_wbc='" + wbcSep.SelectedValue +
                                   "', ha_sepsis_infection='" + suspinfection.SelectedValue +
                                   "', is_id=" + infection.SelectedValue +
                                   ", ha_3sequence=" + ee + " where ha_id=" + Convert.ToInt32(Request.QueryString["field2"]) + "");
        }
Exemple #3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt16(DataClass.SelectRecord("SELECT EXISTS(SELECT * FROM employee WHERE em_login='******') as expr", "expr")) == 1)
     {
         Label1.Visible = true;
     }
     else
     {
         DataClass.insertRecord("insert into employee (em_fname, em_lname, em_login, em_pwd, jo_id, em_mobile, em_status, eg_id, hosp) values('" +
                                firstName.Text + "', '" + lastName.Text + "', '" + loginName.Text + "', '" + pwd.Text + "', " + DropDownList1.SelectedValue + ", '" +
                                mobile.Text + "', " + DropDownList3.SelectedValue + ", " + DropDownList2.SelectedValue + ", " + DropDownList4.SelectedValue + ")");
         Response.Redirect("~/adminPanel.aspx");
     }
 }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DateTime j = Convert.ToDateTime(DataClass.SelectRecord("select pa_birth from patient where pa_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + "", "pa_birth"));

            fname.Text = GridView1.SelectedRow.Cells[2].Text;
            lname.Text = GridView1.SelectedRow.Cells[3].Text;
            DropDownList5.SelectedValue = GridView1.SelectedRow.Cells[4].Text;
            mhr.Text      = DataClass.SelectRecord("select pa_mhr from patient where pa_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + "", "pa_mhr");
            birth.Text    = j.ToString("yyyy-MM-dd");
            age.Text      = (DateTime.Now.Year - j.Year).ToString();
            TextBox1.Text = DataClass.SelectRecord("select pa__address from patient where pa_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + "", "pa__address");
            DropDownList6.SelectedValue = DataClass.SelectRecord("select pa_province from patient where pa_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + "", "pa_province");
            DropDownList3.SelectedValue = DataClass.SelectRecord("select pa_district from patient where pa_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text) + "", "pa_district");
            s = Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];

            if (cookie != null)
            {
                if (Convert.ToInt32(cookie["group"]) > 4)
                {
                    Response.Redirect("~/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
            string u = Request.QueryString["field1"];
            string i = Request.QueryString["field2"];

            Label1.Text  = DataClass.SelectRecord("select pa_fname from patient where pa_id=" + u + "", "pa_fname");
            Label1.Text += " " + DataClass.SelectRecord("select pa_lname from patient where pa_id=" + u + "", "pa_lname");
            try
            {
                if (Convert.ToInt32(DataClass.SelectRecord("select ha_2sequence from hospital_admission where ha_id=" + i + "", "ha_2sequence")) > 0)
                {
                    befoicu.SelectedValue = DataClass.SelectRecord("select be_id from hospital_admission where ha_id=" + i + "", "be_id");
                    reason.SelectedValue  = DataClass.SelectRecord("select re_id from hospital_admission where ha_id=" + i + "", "re_id");
                    temperatureBox.Text   = DataClass.SelectRecord("select ha_vitals_temp from hospital_admission where ha_id=" + i + "", "ha_vitals_temp");
                    heartRate.Text        = DataClass.SelectRecord("select ha_vitals_heartrate from hospital_admission where ha_id=" + i + "", "ha_vitals_heartrate");
                    systolic.Text         = DataClass.SelectRecord("select ha_vitals_sys_bp from hospital_admission where ha_id=" + i + "", "ha_vitals_sys_bp");
                    diastolic.Text        = DataClass.SelectRecord("select ha_vitals_dia_bp from hospital_admission where ha_id=" + i + "", "ha_vitals_dia_bp");
                    respRate.Text         = DataClass.SelectRecord("select ha_vitals_rr from hospital_admission where ha_id=" + i + "", "ha_vitals_rr");
                    oxigen.Text           = DataClass.SelectRecord("select ha_vitals_oxy_sat from hospital_admission where ha_id=" + i + "", "ha_vitals_oxy_sat");
                    oxydrop.SelectedValue = DataClass.SelectRecord("select ha_receiv_oxy from hospital_admission where ha_id=" + i + "", "ha_receiv_oxy");
                    OxyVent.SelectedValue = DataClass.SelectRecord("select ha_receive_oxy_type from hospital_admission where ha_id=" + i + "", "ha_receive_oxy_type");
                    glasgow.SelectedValue = DataClass.SelectRecord("select ha_gcs from hospital_admission where ha_id=" + i + "", "ha_gcs");
                    gcs.SelectedValue     = DataClass.SelectRecord("select ha_gcs_score from hospital_admission where ha_id=" + i + "", "ha_gcs_score");
                    gcst.SelectedValue    = DataClass.SelectRecord("select ha_gsc_scoreT from hospital_admission where ha_id=" + i + "", "ha_gsc_scoreT");
                }
                else
                {
                }
            }
            catch (Exception) { }
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];

            if (cookie != null)
            {
                if (Convert.ToInt32(cookie["group"]) > 4)
                {
                    Response.Redirect("~/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
            string u = Request.QueryString["field1"];
            string i = Request.QueryString["field2"];

            Label2.Text  = DataClass.SelectRecord("select pa_fname from patient where pa_id=" + u + "", "pa_fname");
            Label2.Text += " " + DataClass.SelectRecord("select pa_lname from patient where pa_id=" + u + "", "pa_lname");
            try
            {
                if (Convert.ToInt32(DataClass.SelectRecord("select ha_3sequence from hospital_admission where ha_id=" + i + "", "ha_3sequence")) > 0)
                {
                    if (!IsPostBack)
                    {
                        bodytemp.SelectedValue      = DataClass.SelectRecord("select ha_sepsis_body_temp from hospital_admission where ha_id=" + i + "", "ha_sepsis_body_temp");
                        heartRateSep.SelectedValue  = DataClass.SelectRecord("select ha_sepsis_hr from hospital_admission where ha_id=" + i + "", "ha_sepsis_hr");
                        respRateSep.SelectedValue   = DataClass.SelectRecord("select ha_sepsis_resp_rate from hospital_admission where ha_id=" + i + "", "ha_sepsis_resp_rate");
                        wbcSep.SelectedValue        = DataClass.SelectRecord("select ha_sepsis_wbc from hospital_admission where ha_id=" + i + "", "ha_sepsis_wbc");
                        suspinfection.SelectedValue = DataClass.SelectRecord("select ha_sepsis_infection from hospital_admission where ha_id=" + i + "", "ha_sepsis_infection");
                        infection.SelectedValue     = DataClass.SelectRecord("select is_id from hospital_admission where ha_id=" + i + "", "is_id");
                    }
                }
                else
                {
                }
            }
            catch (Exception) { }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];

            if (cookie != null)
            {
                if (Convert.ToInt32(cookie["group"]) > 4)
                {
                    Response.Redirect("~/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
            string u = Request.QueryString["field1"];

            GridView1.Visible = false;
            diagnosis.Enabled = true;
            Button1.Visible   = false;
            Label2.Text       = DataClass.SelectRecord("select pa_fname from patient where pa_id=" + u + "", "pa_fname");
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            //if (s < 1) {
            //s=Convert.ToInt32(DataClass.SelectRecord("select max(pa_id) as ma from patient", "ma");
            //}
            addRecord(sender, e);
            int w; int z;

            if (Request.RawUrl.Contains("field"))
            {
                w = Convert.ToInt32(Request.QueryString["field2"]);
                z = Convert.ToInt32(Request.QueryString["field1"]);
            }
            else
            {
                w = Convert.ToInt32(DataClass.SelectRecord("select max(ha_id) as ha from hospital_admission", "ha"));
                z = Convert.ToInt32(DataClass.SelectRecord("select max(pa_id) as pa from patient", "pa"));
            }


            Response.Redirect("~/adAdmission1.aspx?field1=" + z + "&field2=" + w + "");
        }
Exemple #9
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int z; int r;

            if (die.SelectedValue == "N" & referred.SelectedValue == "No")
            {
                z = 1;
            }
            else
            {
                z = 0;
            }
            if (referred.SelectedValue != "No")
            {
                r = 1;
            }
            else
            {
                r = 0;
            }
            HttpCookie cookie = Request.Cookies["userInfo"];
            string     ee     = DataClass.SelectRecord("select em_id from employee where em_login='******'", "em_id");

            DataClass.insertRecord("update hospital_admission set ha_interv_surgery='" +
                                   surgery.SelectedValue + "', ha_interv_ventilation='" + ventilation.SelectedValue +
                                   "', ha_interv_vasopressors='" + vasopressor.SelectedValue + "', ha_interv_inv_monitoring='" +
                                   invmonitoring.SelectedValue + "', ha_interv_hemodyalis='" + hemodyalisis.SelectedValue +
                                   "', ha_interv_tpn='" + tpn.SelectedValue + "', ha_qi_new_bed='" + newbed.SelectedValue +
                                   "', ha_qi_have_bed='" + havebed.SelectedValue + "', ha_qi_fever='" + fever.SelectedValue +
                                   "', ha_qi_culture='" + culture.SelectedValue + "', ha_dis_date='" + disDate.Text +
                                   "', ha_dis_die='" + die.SelectedValue + "', ha_dis_referred='" + referred.SelectedValue +
                                   "', ha_dis_diagnosis='" + diagnosis.Text + "', ha_4sequence=" + ee + ", ha_disch=" + z + ", ha_ref=" + r + " where ha_id=" +
                                   Convert.ToInt32(Request.QueryString["field2"]) + "");

            Response.Redirect("~/hospitalAdmission.aspx");
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            string d = DataClass.SelectRecord("select pa_id from hospital_admission where ha_id=" + Convert.ToInt32(GridView1.SelectedRow.Cells[2].Text) + "", "pa_id");

            Response.Redirect("~/adAdmission.aspx?field1=" + d + "&field2=" + GridView1.SelectedRow.Cells[2].Text + "&field3=0");
        }
Exemple #11
0
        protected void Button1_click(object sender, EventArgs e)
        {
            try
            {
                string x = DataClass.SelectRecord("select em_pwd from employee where em_login='******'", "em_pwd");
                if (x == pass.Text)
                {
                    //Response.Cookies["userName"].Value = textBox1.Text;
                    //Response.Cookies["userName"].Expires = DateTime.Now.AddHours(1);
                    HttpCookie cookies = new HttpCookie("userInfo");
                    cookies["Name"]  = textBox1.Text;
                    cookies["group"] = DataClass.SelectRecord("select eg_id from employee where em_login='******'", "eg_id");
                    cookies["hosp"]  = DataClass.SelectRecord("select hosp from employee where em_login='******'", "hosp");
                    cookies.Expires  = DateTime.Now.AddHours(1);
                    Response.Cookies.Add(cookies);
                    HttpCookie cookie = Request.Cookies["userInfo"];

                    Table1.Visible  = false;
                    hello.Visible   = true; user.Visible = true;
                    user.Text       = DataClass.SelectRecord("select em_fname from employee where em_login='******'", "em_fname");
                    signout.Visible = true;
                    Label2.Text     = DataClass.SelectRecord("select eg_id from employee where em_login='******'", "eg_id");

                    if (cookie["group"] == "1")
                    {
                        NavigationMenu.Visible          = true;
                        NavigationMenu.Items[2].Enabled = true;
                        NavigationMenu.Items[4].Enabled = true;
                        NavigationMenu.Items[3].Enabled = true;
                    }
                    else if (cookie["group"] == "2")
                    {
                        NavigationMenu.Visible          = true;
                        NavigationMenu.Items[2].Enabled = true;
                        NavigationMenu.Items[4].Enabled = true;
                        NavigationMenu.Items[3].Enabled = true;
                    }
                    else if (cookie["group"] == "3")
                    {
                        NavigationMenu.Visible          = true;
                        NavigationMenu.Items[2].Enabled = true;
                        NavigationMenu.Items[4].Enabled = false;
                        NavigationMenu.Items[3].Enabled = true;
                    }
                    else if (cookie["group"] == "4")
                    {
                        NavigationMenu.Visible          = true;
                        NavigationMenu.Items[2].Enabled = true;
                        NavigationMenu.Items[4].Enabled = false;
                        NavigationMenu.Items[3].Enabled = false;
                    }
                }
                else
                {
                    error.Visible = true; Label2.Text = "0";
                    error.Text    = "Password was not typed correctly!";
                }
            }
            catch (Exception)
            {
                error.Visible = true;
                error.Text    = "There is no user registered with this name";
            }
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //try
            //{
            HttpCookie cookie = Request.Cookies["userInfo"];

            if (cookie != null)
            {
                user.Visible = true; hello.Visible = true; signout.Visible = true; error.Visible = false;
                string j = cookie["name"];
                user.Text   = j;
                Label2.Text = DataClass.SelectRecord("select eg_id from employee where em_login='******'", "eg_id");

                Table1.Visible = false;
                if (cookie["goup"] == "3")
                {
                    MenuItemCollection menuItems = NavigationMenu.Items;
                    MenuItem           adminItem = new MenuItem();
                    foreach (MenuItem menuItem in menuItems)
                    {
                        if (menuItem.Text == "Administration panel")
                        {
                            adminItem = menuItem;
                        }
                    }
                    menuItems.Remove(adminItem);
                }
                if (cookie["group"] == "1")
                {
                    NavigationMenu.Visible          = true;
                    NavigationMenu.Items[2].Enabled = true;
                    NavigationMenu.Items[4].Enabled = true;
                    NavigationMenu.Items[3].Enabled = true;
                }
                else if (cookie["group"] == "2")
                {
                    NavigationMenu.Visible          = true;
                    NavigationMenu.Items[2].Enabled = true;
                    NavigationMenu.Items[4].Enabled = true;
                    NavigationMenu.Items[3].Enabled = true;
                }
                else if (cookie["group"] == "3")
                {
                    NavigationMenu.Visible          = true;
                    NavigationMenu.Items[2].Enabled = true;
                    NavigationMenu.Items[4].Enabled = false;
                    NavigationMenu.Items[3].Enabled = true;
                }
                else if (cookie["group"] == "4")
                {
                    NavigationMenu.Visible          = true;
                    NavigationMenu.Items[2].Enabled = true;
                    NavigationMenu.Items[4].Enabled = false;
                    NavigationMenu.Items[3].Enabled = false;
                }
                else
                {
                    NavigationMenu.Visible          = false;
                    hello.Visible                   = false; user.Visible = false; Label2.Text = "0"; signout.Visible = false; Table1.Visible = true; error.Visible = false;
                    NavigationMenu.Items[4].Enabled = false;
                    NavigationMenu.Items[3].Enabled = false;
                    NavigationMenu.Items[2].Enabled = false;
                }
            }
            else
            {
                NavigationMenu.Visible          = false;
                hello.Visible                   = false; user.Visible = false; Label2.Text = "0"; signout.Visible = false; Table1.Visible = true; error.Visible = false;
                NavigationMenu.Items[4].Enabled = false;
                NavigationMenu.Items[3].Enabled = false;
                NavigationMenu.Items[2].Enabled = false;
            }
        }
        protected void addRecording(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];
            string     ee = DataClass.SelectRecord("select em_id from employee where em_login='******'", "em_id");
            string     temperature; string heartr; string systol; string diasto; string resp; string oxy;

            if (temperatureBox.Text.Length < 1)
            {
                temperature = "0";
            }
            else
            {
                temperature = temperatureBox.Text.Replace(',', '.');
            }
            if (heartRate.Text.Length < 1)
            {
                heartr = "0";
            }
            else
            {
                heartr = heartRate.Text.Replace(',', '.');
            }
            if (systolic.Text.Length < 1)
            {
                systol = "0";
            }
            else
            {
                systol = systolic.Text.Replace(',', '.');
            }
            if (diastolic.Text.Length < 1)
            {
                diasto = "0";
            }
            else
            {
                diasto = diastolic.Text.Replace(',', '.');
            }
            if (respRate.Text.Length < 1)
            {
                resp = "0";
            }
            else
            {
                resp = respRate.Text.Replace(',', '.');
            }
            if (oxigen.Text.Length < 1)
            {
                oxy = "0";
            }
            else
            {
                oxy = oxigen.Text.Replace(',', '.');
            }
            DataClass.insertRecord("update hospital_admission set be_id=" + Convert.ToInt32(befoicu.SelectedValue) +
                                   ", re_id=" + Convert.ToInt32(reason.SelectedValue) +
                                   ", ha_vitals_temp=" + temperature + ", ha_vitals_heartrate=" + heartr +
                                   ", ha_vitals_sys_bp=" + systol + ", ha_vitals_dia_bp=" + diasto +
                                   ", ha_vitals_rr=" + resp + ", ha_vitals_oxy_sat=" + oxy +
                                   ", ha_receiv_oxy='" + oxydrop.SelectedValue +
                                   "', ha_receive_oxy_type='" + OxyVent.SelectedValue +
                                   "', ha_gcs='" + glasgow.SelectedValue + "', ha_gcs_score = '" +
                                   gcs.SelectedValue + "', ha_gsc_scoreT='" + gcst.SelectedValue +
                                   "', ha_2sequence=" + ee + " where ha_id=" + Convert.ToInt32(Request.QueryString["field2"]) + "");
        }
Exemple #14
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string i = DataClass.SelectRecord("select pa_id from hospital_admission where ha_id=" + GridView1.SelectedRow.Cells[1].Text + "", "pa_id");

            Response.Redirect("~/PatientInformation.aspx?pp=" + i + "&hh=" + GridView1.SelectedRow.Cells[1].Text + "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie cookie = Request.Cookies["userInfo"];

            if (cookie != null)
            {
                if (Convert.ToInt32(cookie["group"]) > 4)
                {
                    Response.Redirect("~/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
            int x = Convert.ToInt16(cookie["group"]);
            int j = Convert.ToInt16(cookie["hosp"]);

            if (x > 1)
            {
                SqlDataSource1.FilterExpression = "ho_id = " + j + "";
            }
            if (referDistrHosp.SelectedValue == "Y")
            {
                distrHospitals.Visible = true;
            }
            else
            {
                distrHospitals.Visible = false;
            }
            //this.adDate.Text = DateTime.Today.ToString("MM/dd/yyyy");
            adDate.Text        = System.DateTime.Today.ToString("yyyy-MM-dd");
            adTime.Text        = DateTime.Now.ToString("HH:mm");
            icuhdudatebox.Text = System.DateTime.Today.ToString("yyyy-MM-dd");
            if (!IsPostBack)
            {
                SqlDataSource5.FilterExpression = "pa_lname like 'cccccccccccccccccccccc'";
                SqlDataSource5.FilterExpression = "pa_mhr like 'ccccccccccccc'";
            }
            //birth.Text = Server.HtmlEncode("" + (Convert.ToInt16(DateTime.Now.Year) - Convert.ToInt16(age.Text)).ToString() + "-01-01");
            try
            {
                int pid = Convert.ToInt32(Request.QueryString["field1"]);
                int hid = Convert.ToInt32(Request.QueryString["field2"]);

                if (Request.QueryString["field1"].Length > 0)
                {
                    SqlDataSource5.FilterExpression = "pa_id=" + pid + "";
                    fname.Text = DataClass.SelectRecord("select pa_fname from patient where pa_id=" + pid + "", "pa_fname");
                    lname.Text = DataClass.SelectRecord("select pa_lname from patient where pa_id=" + pid + "", "pa_lname");
                    mhr.Text   = DataClass.SelectRecord("select pa_mhr from patient where pa_id=" + pid + "", "pa_mhr");
                    DropDownList5.SelectedValue = DataClass.SelectRecord("select pa_gender from patient where pa_id=" + pid + "", "pa_gender");
                    age.Text      = DataClass.SelectRecord("select pa_age from patient where pa_id=" + pid + "", "pa_age");
                    birth.Text    = Convert.ToDateTime(DataClass.SelectRecord("select pa_birth from patient where pa_id=" + pid + "", "pa_birth")).ToString("yyyy-MM-dd");
                    TextBox1.Text = DataClass.SelectRecord("select pa__address from patient where pa_id=" + pid + "", "pa__address");
                    DropDownList6.SelectedValue = DataClass.SelectRecord("select pa_province from patient where pa_id=" + pid + "", "pa_province");
                    DropDownList3.SelectedValue = DataClass.SelectRecord("select pa_district from patient where pa_id=" + pid + "", "pa_district");

                    hospitalBox.SelectedValue = DataClass.SelectRecord("select ho_id from hospital_admission where ha_id=" + hid + "", "ho_id");
                    icuHdu.SelectedValue      = DataClass.SelectRecord("select ha_icu_hdu from hospital_admission where ha_id=" + hid + "", "ha_icu_hdu");
                    adDate.Text                 = Convert.ToDateTime(DataClass.SelectRecord("select ha_date from hospital_admission where ha_id=" + hid + "", "ha_date")).ToString("yyyy-MM-dd");
                    adTime.Text                 = Convert.ToDateTime(DataClass.SelectRecord("select ha_date from hospital_admission where ha_id=" + hid + "", "ha_date")).ToString("HH:mm");
                    icuhdudatebox.Text          = Convert.ToDateTime(DataClass.SelectRecord("select ha_ICU_HDU_date from hospital_admission where ha_id=" + hid + "", "ha_ICU_HDU_date")).ToString("yyyy-MM-dd");
                    DropDownList1.SelectedValue = DataClass.SelectRecord("select ha_type from hospital_admission where ha_id=" + hid + "", "ha_type");
                    //if (referDistrHosp.AutoPostBack) { }
                    //else
                    //{
                    if (!IsPostBack)
                    {
                        if (DataClass.SelectRecord("select ha_ref_district_hospital from hospital_admission where ha_id=" + hid + "", "ha_ref_district_hospital") == "Y")
                        {
                            referDistrHosp.SelectedValue = DataClass.SelectRecord("select ha_ref_district_hospital from hospital_admission where ha_id=" + hid + "", "ha_ref_district_hospital");

                            distrHospitals.Visible       = true;
                            distrHospitals.SelectedValue = DataClass.SelectRecord("select ha_district_hospital from hospital_admission where ha_id=" + hid + "", "ha_district_hospital");
                        }
                        else
                        {
                            distrHospitals.Visible = false;
                        }
                    }
                }
                DropDownList2.SelectedValue = DataClass.SelectRecord("select in_id from hospital_admission where ha_id=" + hid + "", "in_id");
                //}
                //else { }
            }
            catch (NullReferenceException) { }
        }