Esempio n. 1
0
 public void updatsdata()
 {
     try
     {
         int idss = int.Parse(mcerteficatid.Text);
         mc                   = hn.medicalcerteficateees.Where(p => p.medcertefiID == idss).First();
         mc.PatientID         = int.Parse(paitentid.Text);
         mc.PatientName       = name.Text;
         mc.FatherName        = fathername.Text;
         mc.Sex               = sex.Text;
         mc.Age               = int.Parse(Age.Text);
         mc.Date              = DateTime.Parse(dates.Text);
         mc.PhysicianName     = physicianname.Text;
         mc.DiseaseType       = disesetype.Text;
         mc.MedicineStartFrom = DateTime.Parse(medicinstart.Text);
         mc.UpTo              = DateTime.Parse(uptos.Text);
         mc.Reason            = Reason.Text;
         mc.ApprovedBy        = Approvedby.Text;
         hn.SaveChanges();
         clear();
     }
     catch (Exception wy)
     {
         MessageBox.Show(wy.Message.ToString());
         clear();
     }
 }
Esempio n. 2
0
 public void removedatsa()
 {
     try
     {
         int idss = int.Parse(mcerteficatid.Text);
         mc = hn.medicalcerteficateees.Where(p => p.medcertefiID == idss).First();
         hn.medicalcerteficateees.Remove(mc);
         hn.SaveChanges();
         clear();
     }
     catch (Exception op)
     {
         MessageBox.Show(op.Message.ToString());
         clear();
     }
 }