Esempio n. 1
0
    public bool CheckDoctorDetailByID(string ID)
    {
        DoctorDetail t = null;

        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            var conflist = conf.DoctorDetails;
            try
            {
                t = (from n in conflist where n.DoctorName == ID select n).First();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                //   throw;
            }


            if (t == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
    }
Esempio n. 2
0
    public List <AppointmentDetail> GetAllAppointments()
    {
        List <AppointmentDetail> conflist = new List <AppointmentDetail>();

        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            conflist = conf.AppointmentDetails.ToList();
            return(conflist);
        }
    }
Esempio n. 3
0
 public bool createAppointment(AppointmentDetail a)
 {
     using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
     {
         a.AppointmentID = Guid.NewGuid().ToString();
         conf.AppointmentDetails.Add(a);
         conf.SaveChanges();
     }
     return(true);
 }
Esempio n. 4
0
    public IEnumerable <DoctorDetail> GetAllDcotors()
    {
        List <DoctorDetail> conflist = new List <DoctorDetail>();

        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            conflist = conf.DoctorDetails.ToList();
            return(conflist);
        }
    }
Esempio n. 5
0
    public DoctorDetail getDoctorDetailByID(string ID)
    {
        DoctorDetail t = new DoctorDetail();

        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            var conflist = conf.DoctorDetails;
            t = (from n in conflist where n.DoctorName == ID select n).First();


            return(t);
        }
    }
Esempio n. 6
0
    public bool addPatient(PatientViewModel d)
    {
        using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
        {
            PatientDetail p = new PatientDetail();
            p.PatientID = Guid.NewGuid().ToString();

            p.PatientName      = d.PatientName;
            p.HealthConditions = d.HealthConditions;
            p.Age    = d.Age;
            p.Gender = d.Gender.ToString();
            conf.PatientDetails.Add(p);
            conf.SaveChanges();
            return(true);
        }
    }
Esempio n. 7
0
 public bool addDoctor(DoctorViewModel d)
 {
     using (AppointmentSchedulerEntities3 conf = new AppointmentSchedulerEntities3())
     {
         DoctorDetail e = new DoctorDetail();
         e.DoctorID   = Guid.NewGuid().ToString();
         e.DoctorName = d.DoctorName;
         e.Specaility = d.Specaility.ToString();
         if (d.isAvailable == true)
         {
             e.IsAvailable = "yes";
         }
         else
         {
             e.IsAvailable = "no";
         }
         conf.DoctorDetails.Add(e);
         conf.SaveChanges();
         return(true);
     }
 }