public double getbalance() { linkDataContext datacon = new linkDataContext(); var o = from d in datacon.FincialRecords where d.P_id == pa.p_id select d.Balance; return(Convert.ToDouble(o.First())); }
public String getexaminationdata() { linkDataContext datacon = new linkDataContext(); var r = from g in datacon.App_datas select g.Examination_data; datacon.SubmitChanges(); return(r.Last()); }
private void button2_Click(object sender, EventArgs e) { String r = resultdatatext.Text.Trim(); linkDataContext datacon = new linkDataContext(); var rr = from g in datacon.App_datas select g; datacon.App_datas.DeleteOnSubmit(rr.Last()); rr.Last().Result_data = r; datacon.App_datas.InsertOnSubmit(rr.Last()); datacon.SubmitChanges(); }
private void button1_Click(object sender, EventArgs e) { String emp_name = Emp_nametextbox.Text.Trim(); String emp_pass = Emp_passtextbox.Text.Trim(); if (emp_name.Length <= 0 || emp_pass.Length <= 0) { MessageBox.Show("The Name Or The Password is Messing Make Sure You Enter It", "Warrning", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } linkDataContext link = new linkDataContext(); var s = from d in link.Employees where d.Emp_FirstName.Trim() + " " + d.Emp_LastName.Trim() == emp_name && d.Password == emp_pass select d; // MessageBox.Show("this employee " + s.Count().ToString()+ " is a doctor"); int ee = Convert.ToInt32(s.First().Emp_id); var type1 = from w in link.Doctors where w.Emp_id == ee select w; var type2 = from w in link.Nurses where w.Emp_id == ee select w; var type3 = from w in link.Secritaries where w.Emp_id == ee select w; if (type1.Count() > 0) { Doctor d = type1.First(); //we have a docotr Doctor_profile doc = new Doctor_profile(s.First()); doc.Show(); } else if (type2.Count() > 0) { Nurse N = type2.First(); //we have a Nurse Nurse_Profile n = new Nurse_Profile(); n.Show(); } else if (type3.Count() > 0) { Secritary N = type3.First(); //we have a Secritary } else { // incorrect password or emp doen'nt exist } MessageBox.Show("this employee " + type1.First().Extra_info + " is a doctor"); Doctor_profile f = new Doctor_profile(s.First()); f.Show(); // this.Close(); }
private void button1_Click(object sender, EventArgs e) { int appid = 0; linkDataContext db = new linkDataContext(); var q = from a in db.Appointments where a.Patient_id == this.id select a.App_id; foreach (var item in q) { appid = item; } App_data apdt = new App_data(); apdt.App_id = appid; apdt.P_id = this.id; apdt.Examination_data = richTextBox1.Text; db.App_datas.InsertOnSubmit(apdt); db.App_datas.Context.SubmitChanges(); MessageBox.Show("Data Inserted"); }