Exemple #1
0
 public void DetachDoctor(Doctor obj)
 {
     db.Doctors.Detach(obj);
 }
Exemple #2
0
 public int AddDoctor(Doctor obj)
 {
     obj.DateUpdate = DateTime.Now;
     obj.DateAdd = DateTime.Now;
     obj.Suser = System.Web.Security.Membership.GetUser().ToString();
     db.Doctors.AddObject(obj);
     db.SaveChanges();
     return (obj.DoctorID);
 }
 /// <summary>
 /// Create a new Doctor object.
 /// </summary>
 /// <param name="doctorID">Initial value of the DoctorID property.</param>
 /// <param name="lastname">Initial value of the Lastname property.</param>
 /// <param name="initials">Initial value of the Initials property.</param>
 public static Doctor CreateDoctor(global::System.Int32 doctorID, global::System.String lastname, global::System.String initials)
 {
     Doctor doctor = new Doctor();
     doctor.DoctorID = doctorID;
     doctor.Lastname = lastname;
     doctor.Initials = initials;
     return doctor;
 }
Exemple #4
0
 public dbActionResult EditDoctor(Doctor obj)
 {
     try
     {
         obj.DateUpdate = DateTime.Now;
         obj.Suser = System.Web.Security.Membership.GetUser().ToString();
         db.Doctors.Attach(obj);
         db.ObjectStateManager.ChangeObjectState(obj, EntityState.Modified);
         db.SaveChanges();
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = obj.DoctorID;
         returnObj.exConcur = null;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (OptimisticConcurrencyException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -1;
         returnObj.exConcur = ex;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (DataException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -2;
         returnObj.exConcur = null;
         returnObj.exData = ex;
         return (returnObj);
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Doctors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDoctors(Doctor doctor)
 {
     base.AddObject("Doctors", doctor);
 }