예제 #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ppl.path_id                 = Session["path_id"].ToString();
        ppl.pateint_code            = Session["pateint_code"].ToString();
        ppl.slave_id                = Session["slave_id"].ToString();
        ppl.total_cholestrol        = Convert.ToDecimal(TextBox1.Text);
        ppl.triglycerides           = Convert.ToDecimal(TextBox2.Text);
        ppl.hdl_cholestrol          = Convert.ToDecimal(TextBox3.Text);
        ppl.ldl_cholestrol          = Convert.ToDecimal(TextBoxp.Text);
        ppl.vldl_cholestrol         = Convert.ToDecimal(textbox.Text);
        ppl.tc_hdl_cholestrol_ratio = Convert.ToDecimal(TextBox5.Text);
        ppl.ldl_hdl_ratio           = Convert.ToDecimal((TextBox6.Text));

        rt.palm_pathology_lps.InsertOnSubmit(ppl);
        rt.SubmitChanges();
        palm_opd_pathlogy_slave pos = new palm_opd_pathlogy_slave();

        pos         = rt.palm_opd_pathlogy_slaves.Single(palm_opd_pathlogy_slave => palm_opd_pathlogy_slave.slave_id == Convert.ToInt32(Session["slave_id"]));
        pos.date    = d.Text;
        pos.is_done = "Completed";
        rt.SubmitChanges();
        //print form

        ppl = rt.palm_pathology_lps.Single(palm_pathology_lp => palm_pathology_lp.slave_id == Session["slave_id"].ToString());

        Label164.Text = Session["pateint_name"].ToString();
        Label168.Text = Session["ref_doctor"].ToString();
        Label166.Text = d.Text;
        Label200.Text = Convert.ToString(ppl.total_cholestrol);
        Label201.Text = Convert.ToString(ppl.triglycerides);
        Label202.Text = Convert.ToString(ppl.hdl_cholestrol);
        Label203.Text = Convert.ToString(ppl.ldl_cholestrol);
        Label204.Text = Convert.ToString(ppl.vldl_cholestrol);
        Label205.Text = Convert.ToString(ppl.tc_hdl_cholestrol_ratio);
        Label206.Text = Convert.ToString(ppl.ldl_hdl_ratio);
        MultiView1.ActiveViewIndex = 1;
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["emp_code"] == null)
        {
            Response.Redirect("~/home.aspx");
        }
        if (Session["pateint_name"] == null && Session["ref_doctor"] == null && Session["slave_id"] == null)
        {
            Response.Redirect("~/home.aspx");
        }

        if (Session["print"] == null)
        {
            labe1.Text = Session["pateint_name"].ToString();
            palm_doctor_employee pde = new palm_doctor_employee();
            // palm_doctor_employee pde = new palm_doctor_employee();
            // label0.Text = Session["pateint_name"].ToString();
            try
            {
                pde                   = rt.palm_doctor_employees.Single(palm_doctor_employee => palm_doctor_employee.emp_code == Session["ref_doctor"].ToString());
                Label8.Text           = pde.doctor_name;
                Session["ref_doctor"] = pde.doctor_name;
            }
            catch (InvalidOperationException rtt)
            {
                palm_pateints_profile ppp = new palm_pateints_profile();
                ppp                   = rt.palm_pateints_profiles.Single(palm_pateints_profile => palm_pateints_profile.pateint_code == Session["pateint_code"].ToString());
                Label8.Text           = ppp.ref_doc;
                Session["ref_doctor"] = ppp.ref_doc;
            }
            // Label11.Text = DateTime.Now.ToString();
        }
        else
        {
            Session["print"] = null;
            palm_doctor_employee pde = new palm_doctor_employee();
            //   palm_doctor_employee pde = new palm_doctor_employee();
            // palm_doctor_employee pde = new palm_doctor_employee();
            // label0.Text = Session["pateint_name"].ToString();
            try
            {
                pde                   = rt.palm_doctor_employees.Single(palm_doctor_employee => palm_doctor_employee.emp_code == Session["ref_doctor"].ToString());
                Label168.Text         = pde.doctor_name;
                Session["ref_doctor"] = pde.doctor_name;
            }
            catch (InvalidOperationException rtt)
            {
                palm_pateints_profile ppp = new palm_pateints_profile();
                ppp                   = rt.palm_pateints_profiles.Single(palm_pateints_profile => palm_pateints_profile.pateint_code == Session["pateint_code"].ToString());
                Label168.Text         = ppp.ref_doc;
                Session["ref_doctor"] = ppp.ref_doc;
            }
            Session["ref_doctor"] = pde.doctor_name;
            Label164.Text         = Session["pateint_name"].ToString();
            // Label168.Text = Session["ref_doctor"].ToString();
            palm_pathology_lp ppm = new palm_pathology_lp();
            ppm           = rt.palm_pathology_lps.Single(palm_pathology_lp => palm_pathology_lp.slave_id == Session["slave_id"].ToString());
            Label200.Text = ppm.total_cholestrol.ToString();
            Label201.Text = ppm.triglycerides.ToString();
            Label202.Text = ppm.hdl_cholestrol.ToString();
            Label203.Text = ppm.ldl_cholestrol.ToString();
            Label204.Text = ppm.vldl_cholestrol.ToString();
            Label205.Text = ppm.tc_hdl_cholestrol_ratio.ToString();
            Label206.Text = ppm.ldl_hdl_ratio.ToString();


            palm_opd_pathlogy_slave pps = new palm_opd_pathlogy_slave();
            pps           = rt.palm_opd_pathlogy_slaves.Single(palm_opd_pathlogy_slave => palm_opd_pathlogy_slave.slave_id == Convert.ToInt32(Session["slave_id"]));
            Label166.Text = Convert.ToString(pps.date);
            MultiView1.ActiveViewIndex = 1;
        }
    }