protected void Button1_Click(object sender, EventArgs e) { pph.path_id = Session["path_id"].ToString(); pph.pateint_code = Session["pateint_code"].ToString(); pph.slave_id = Session["slave_id"].ToString(); try { pph.vitamin_d3 = Convert.ToDecimal(TextBox1.Text); rt.palm_pathology_vitd3s.InsertOnSubmit(pph); 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 page pph = rt.palm_pathology_vitd3s.Single(palm_pathology_vitd3 => palm_pathology_vitd3.slave_id == Session["slave_id"].ToString()); Label2.Text = Session["pateint_name"].ToString(); Label00.Text = Session["ref_doctor"].ToString(); Label0.Text = d.Text; Label253.Text = Convert.ToString(pph.vitamin_d3); MultiView1.ActiveViewIndex = 1; } catch (Exception err) { Response.Write("<script>alert('Enter Valid Readings')</script>"); } }
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) { Label1.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()); Label00.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()); Label00.Text = ppp.ref_doc; Session["ref_doctor"] = ppp.ref_doc; } Label2.Text = Session["pateint_name"].ToString(); Label00.Text = Session["ref_doctor"].ToString(); pph = rt.palm_pathology_vitd3s.Single(palm_pathology_vitd3 => palm_pathology_vitd3.slave_id == Session["slave_id"].ToString()); Label253.Text = pph.vitamin_d3.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"])); Label0.Text = Convert.ToString(pps.date); MultiView1.ActiveViewIndex = 1; } }