Ejemplo n.º 1
0
 public bool Deletedctr(int id)
 {
     using (hms2Entities mm = new hms2Entities())
     {
         var data = mm.doctors.Where(x => x.ID == id).FirstOrDefault();
         if (data != null)
         {
             mm.Entry(data).State = EntityState.Deleted;
             mm.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 2
0
 public bool DeleteStd(int id)
 {
     using (hms2Entities db = new hms2Entities())
     {
         var data = db.patients.Where(x => x.ID == id).FirstOrDefault();
         if (data != null)
         {
             db.Entry(data).State = EntityState.Deleted;
             db.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 3
0
 public bool updatedoc(Adddoctormodel std)
 {
     using (hms2Entities mm = new hms2Entities())
     {
         var data = mm.doctors.Where(x => x.ID == std.SID).FirstOrDefault();
         if (data != null)
         {
             data.FirstName       = std.firstName;
             data.LastName        = std.lastName;
             data.qualification   = std.qualification;
             data.Cellnum         = std.cellnum;
             data.CNIC            = std.cnic;
             data.Gender          = std.gender;
             data.Nationality     = std.nationality;
             mm.Entry(data).State = EntityState.Modified;
             mm.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 4
0
 public bool updatepat(AddpatientModel std)
 {
     using (hms2Entities db = new hms2Entities())
     {
         var data = db.patients.Where(x => x.ID == std.pID).FirstOrDefault();
         if (data != null)
         {
             data.FirstName       = std.firstName;
             data.LastName        = std.lastName;
             data.Disease         = std.Disease;
             data.CNIC            = std.cnic;
             data.Cellnum         = std.cellnum;
             data.Gender          = std.gender;
             data.Nationality     = std.nationality;
             db.Entry(data).State = EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }