protected void Button2_Click(object sender, EventArgs e) { EMRDataClassesDataContext db = new EMRDataClassesDataContext(); GridView1.DataSource = from a in db.Patients where a.PersonalInfo.FirstName.StartsWith(TextBox2.Text) select new { a.PersonalInfo.Fax, a.PersonalInfo.Gender }; GridView1.DataBind(); }
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { int I = e.NewSelectedIndex; string pid = GridView1.Rows[I].Cells[1].Text; EMRDataClassesDataContext emr = new EMRDataClassesDataContext(); Session["Pharmacist"] = (from a in emr.Pharmacists where a.Id == Convert.ToInt32(pid) select a).Single(); Response.Redirect("View_pharmacist_info.aspx"); }
protected void Button1_Click1(object sender, EventArgs e) { MedicalRecord mr = new MedicalRecord(); EMRDataClassesDataContext dd = new EMRDataClassesDataContext(); // Label1.Text = (String)Session["mySessionVar"]; var gg = from a in dd.MedicalRecords where a.Id == 2 select a; Session["nnn"] = gg.Single(); Response.Redirect("Session_test.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { PersonalInfo p = new PersonalInfo(); p.Address = TextBox1.Text; //p.Age = 25; p.FirstName = TextBox2.Text;; p.LastName = TextBox3.Text; EMRDataClassesDataContext q = new EMRDataClassesDataContext(); q.PersonalInfos.InsertOnSubmit(p); q.SubmitChanges(); }
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { int i = e.NewSelectedIndex; string pid = GridView1.Rows[i].Cells[1].Text; EMRDataClassesDataContext pa = new EMRDataClassesDataContext(); MedicalRecord m = new MedicalRecord(); m = pa.MedicalRecords.Where(w => w.Id == Convert.ToInt32(pid)).SingleOrDefault(); //m = pa.MedicalRecords.Where(w => w.Id == 1).SingleOrDefault(); var pe = (from a in m.Prescriptions select new { a.Id, a.PharmacistId, a.PrescriptionText, a.description, a.DateOfPrescription, }); GridView2.DataSource = pe; GridView2.DataBind(); EMRDataClassesDataContext ne = new EMRDataClassesDataContext(); // m = pa.MedicalRecords.Where(w => w.Id == 1).SingleOrDefault(); m = pa.MedicalRecords.Where(w => w.Id == Convert.ToInt32(pid)).SingleOrDefault(); var na = (from a in m.NursePreviews select new { a.Id, a.NurseId, a.TypeOfOperation, a.DateOfOperation, a.Test, a.XRayPhotoPath, }); EMRDataClassesDataContext ce = new EMRDataClassesDataContext(); // m = pa.MedicalRecords.Where(w => w.Id == 1).SingleOrDefault(); m = pa.MedicalRecords.Where(w => w.Id == Convert.ToInt32(pid)).SingleOrDefault(); var ca = (from a in m.SicknessMedicalRecords select new { a.Sickness.Id, a.Sickness.Disease, a.Sickness.LevelOfRisk, }); GridView4.DataSource = ca; GridView4.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { EMRDataClassesDataContext dc = new EMRDataClassesDataContext(); var de = (from a in dc.Doctors where a.PersonalInfo.FirstName.StartsWith(TextBox1.Text) select new { a.PersonalInfo.Id, a.PersonalInfo.FirstName, a.PersonalInfo.LastName, a.PersonalInfo.DateOfBrith, }); GridView1.DataSource = de; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { EMRDataClassesDataContext dd = new EMRDataClassesDataContext(); Label1.Text = (String)Session["mySessionVar"]; var gg = from a in dd.MedicalRecords where a.Id == 2 select a; Session["nnn"] = gg.Single(); //MedicalRecord fff= (MedicalRecord)Session["nnn"]; }
protected void Login1_LoggedIn(object sender, EventArgs e) { EMRDataClassesDataContext Q = new EMRDataClassesDataContext(); aspnet_User a = new aspnet_User(); if (Roles.IsUserInRole(Login1.UserName, "Doctor")) { // System.Web.HttpContext.Current.User.Identity.Name; a = Q.aspnet_Users.Where(d => d.UserName == Login1.UserName).SingleOrDefault(); Session["doct"] = a; Response.Redirect("~/Doctor/PersonalInfo/View_doctor_info.aspx"); } else if (Roles.IsUserInRole(Login1.UserName, "AdminDoctor")) { a = Q.aspnet_Users.Where(d => d.UserName == Login1.UserName).SingleOrDefault(); Session["admdoc"] = a; Response.Redirect("~/Admin_doctor/PersonalInfo/View_doctor_info.aspx"); } else if (Roles.IsUserInRole(Login1.UserName, "Nurse")) { a = Q.aspnet_Users.Where(d => d.UserName == Login1.UserName).SingleOrDefault(); Session["nu"] = a; Response.Redirect("~/Nurse/PersonalInfo/Nurse_View_info.aspx"); } else if (Roles.IsUserInRole(Login1.UserName, "Patient")) { a = Q.aspnet_Users.Where(d => d.UserName == User.Identity.Name).SingleOrDefault(); Session["pa"] = a; Response.Redirect("~/Patient/PersonalInfo/View_patient_info.aspx"); } else if (Roles.IsUserInRole(Login1.UserName, "Pharmacist")) { a = Q.aspnet_Users.Where(d => d.UserName == User.Identity.Name).SingleOrDefault(); Session["pha"] = a; Response.Redirect("~/Pharmacist/PersonalInfo/View_pharmacist_info.aspx"); } else if (Roles.IsUserInRole(Login1.UserName, "Admin")) { Label1.Text = " Welcome Admin " + Login1.UserName; } else { Label1.Text = "Invalid Username or/and Password"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EMRDataClassesDataContext na = new EMRDataClassesDataContext(); var ne = (from a in na.Pharmacists select new { a.Id, a.PersonalInfo.FirstName, a.PersonalInfo.LastName, a.PersonalInfo.DateOfBrith, }); GridView1.DataSource = ne; GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { d = (Doctor)Session["doctor"]; if (!IsPostBack) { EMRDataClassesDataContext dc = new EMRDataClassesDataContext(); var de = (from a in dc.Patients select new { a.Id, a.PersonalInfo.FirstName, a.PersonalInfo.LastName, a.PersonalInfo.DateOfBrith, }); GridView1.DataSource = de; GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EMRDataClassesDataContext dc = new EMRDataClassesDataContext(); var de = (from a in dc.Doctors select new { a.Id, a.PersonalInfo.FirstName, a.PersonalInfo.LastName, a.PersonalInfo.DateOfBrith, }); GridView1.DataSource = de; GridView1.DataBind(); GridView1.AllowPaging.ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { PersonalInfo p = new PersonalInfo(); p.FirstName = TextBox1.Text; p.LastName = TextBox2.Text; p.Gender = RadioButtonList1.SelectedItem.Value; p.Phone = TextBox3.Text; p.Mobile = TextBox4.Text; p.Address = TextBox5.Text; //p.DateOfBrith = Calendar1.SelectedDate; //p.DateOfBrith = DateTime.Parse(TextBox6.Text); p.DateOfBrith = DateTime.Parse(TextBox6.Text); // p.DateOfBrith = System.Convert.ToDateTime(TextBox6.Text); p.Note = TextBox7.Text; p.Fax = TextBox8.Text; p.Email = TextBox9.Text; p.FacebookURL = TextBox10.Text; p.TwitterURL = TextBox11.Text; //p.Image = TextBox12.Text; p.BloodType = DropDownList1.Text; p.BusinessPhone = TextBox15.Text; if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0) { p.Image = "~/pics/" + FileUpload1.FileName; FileUpload1.SaveAs(Server.MapPath("~/pics/" + p.Id + ".png")); Label22.Text = "Photo is UpLoaded !! " + FileUpload1.FileName; } EMRDataClassesDataContext Q = new EMRDataClassesDataContext(); Q.PersonalInfos.InsertOnSubmit(p); Q.SubmitChanges(); Patient x = new Patient(); x.PersonalInfoId = p.Id; Q.Patients.InsertOnSubmit(x); Q.SubmitChanges(); Label21.Text = "Data is Saved"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Patient x = (Patient)Session["pateint"]; EMRDataClassesDataContext md = new EMRDataClassesDataContext(); //x = md.Patients.Where(w => w.Id == x.Id).SingleOrDefault(); x = md.Patients.Where(w => w.Id == x.Id).SingleOrDefault(); var me = (from a in x.MedicalRecords select new { a.Id, a.Description, a.DateOfPreview, }); GridView1.DataSource = me; GridView1.DataBind(); } }
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { int I = e.NewSelectedIndex; Sickness x = new Sickness(); x.Id = I; string rrr = GridView1.Rows[I].Cells[1].Text; EMRDataClassesDataContext emr = new EMRDataClassesDataContext(); Session["sick"] = (from a in emr.Sicknesses where a.Id == Convert.ToInt32(rrr) select a).Single(); // string FFF= ""+GridView1.Rows[I].Cells[1]; // Label1.Text = GridView1.SelectedDataKey.Value.ToString(); //int x = (int)GridView1.SelectedValue; //Session["x"] = GridView1.SelectedValue; // Session["x"] = GridView1.d // Label1.Text = GridView1.SelectedIndex.ToString(); Response.Redirect("View_sickness.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0) { PersonalInfo p = new PersonalInfo(); p.FirstName = "image"; p.LastName = "image"; p.Image = "~/pics/" + FileUpload1.FileName; EMRDataClassesDataContext Q = new EMRDataClassesDataContext(); Q.PersonalInfos.InsertOnSubmit(p); Q.SubmitChanges(); Patient x = new Patient(); x.PersonalInfoId = p.Id; Q.Patients.InsertOnSubmit(x); Q.SubmitChanges(); FileUpload1.SaveAs(Server.MapPath("~/pics/" + p.Id + ".png")); Label22.Text = "shit is UpLoaded !! " + FileUpload1.FileName; } }
protected void Button1_Click(object sender, EventArgs e) { PersonalInfo p = new PersonalInfo(); p.FirstName = TextBox1.Text; p.LastName = TextBox2.Text; p.Gender = RadioButtonList1.SelectedItem.Value; p.Phone = TextBox4.Text; p.Mobile = TextBox5.Text; p.Address = TextBox6.Text; p.DateOfBrith = DateTime.Parse(TextBox7.Text); p.Note = TextBox8.Text; p.Fax = TextBox9.Text; p.Email = TextBox10.Text; p.FacebookURL = TextBox11.Text; p.TwitterURL = TextBox12.Text; //p.Image = TextBox13.Text; p.BloodType = DropDownList1.Text; p.BusinessPhone = TextBox15.Text; EMRDataClassesDataContext Q = new EMRDataClassesDataContext(); Q.PersonalInfos.InsertOnSubmit(p); Q.SubmitChanges(); if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0) { string fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName); if (fileExtension.ToLower() != ".png" && fileExtension.ToLower() != ".jpg") { Label22.Text = "Please select a photo to upload !! " + FileUpload1.FileName; } else { p.Image = "~/pics/" + p.Id + fileExtension; FileUpload1.SaveAs(Server.MapPath("~/pics/" + p.Id + fileExtension)); Label22.Text = "Photo is UpLoaded !! " + FileUpload1.FileName; } } Doctor doc = new Doctor(); doc.PersonalInfoId = p.Id; if (RadioButton1.Checked) { doc.Type = 0; } else if (RadioButton2.Checked) { doc.Type = 1; } doc.Compertence = TextBox17.Text; if (RadioButton1.Checked == true) { MembershipCreateStatus status; MembershipUser newuser = Membership.CreateUser(TextBox16.Text, TextBox18.Text, "*****@*****.**", "none", "none", false, out status); Roles.AddUserToRole(TextBox16.Text, "AdminDoctor"); var uid = (from a in Q.aspnet_Users where a.UserName == TextBox16.Text select a.UserId).Single(); p.UserId = uid; } else if (RadioButton2.Checked == true) { MembershipCreateStatus status; MembershipUser newuser = Membership.CreateUser(TextBox16.Text, TextBox18.Text, "*****@*****.**", "none", "none", false, out status); Roles.AddUserToRole(TextBox16.Text, "Doctor"); var uid = (from a in Q.aspnet_Users where a.UserName == TextBox16.Text select a.UserId).Single(); p.UserId = uid; } Q.Doctors.InsertOnSubmit(doc); Q.SubmitChanges(); Label23.Text = "Data is Saved"; }