public DtoTblDoctor(TblDoctor doctor, HttpStatusCode statusEffect)
        {
            id        = doctor.id;
            Name      = doctor.Name;
            SectionId = doctor.SectionId;
            NowActive = doctor.NowActive;

            StatusEffect = statusEffect;
        }
Exemplo n.º 2
0
        public void DeleteDoctor(TblDoctor doctor)
        {
            if (doctor == null)
            {
                throw new ArgumentNullException(nameof(doctor));
            }

            context.TblDoctors.Remove(doctor);
        }
Exemplo n.º 3
0
        public void Delete_Doctor(int id)
        {
            var DeleteRecord = new TblDoctor {
                DoctorId = id
            };

            context.TblDoctors.Attach(DeleteRecord);
            context.TblDoctors.Remove(DeleteRecord);
            context.SaveChanges();
        }
Exemplo n.º 4
0
        public void Create_Doctor(int Doctor_Number, string Doctor_Name, DateTime birth, DateTime FirstEpisode, DateTime LastEpisode)
        {
            TblDoctor CreateDoctor = new TblDoctor
            {
                DoctorNumber     = Doctor_Number,
                DoctorName       = Doctor_Name,
                BirthDate        = birth,
                FirstEpisodeDate = FirstEpisode,
                LastEpisodeDate  = LastEpisode
            };

            context.Add(CreateDoctor);
            context.SaveChanges();
        }
Exemplo n.º 5
0
        public void AddDoctor(int DoctorId, TblDoctor doctor)
        {
            if (DoctorId == null)
            {
                throw new ArgumentNullException(nameof(DoctorId));
            }

            if (doctor == null)
            {
                throw new ArgumentNullException(nameof(doctor));
            }

            doctor.DoctorId = DoctorId;
            context.TblDoctors.Add(doctor);
        }
Exemplo n.º 6
0
        public IHttpActionResult AddDoctor(TblDoctor doctor)
        {
            var task = Task.Run(() => new DoctorService().AddDoctor(doctor));

            if (task.Wait(TimeSpan.FromSeconds(10)))
            {
                if (task.Result.id != -1)
                {
                    return(Ok(new DtoTblDoctor(task.Result, HttpStatusCode.OK)));
                }
                else
                {
                    return(Conflict());
                }
            }
            return(StatusCode(HttpStatusCode.RequestTimeout));
        }
Exemplo n.º 7
0
        public IHttpActionResult UpdateDoctor(List <object> doctorLogId)
        {
            TblDoctor doctor = JsonConvert.DeserializeObject <TblDoctor>(doctorLogId[0].ToString());
            int       logId  = JsonConvert.DeserializeObject <int>(doctorLogId[1].ToString());
            var       task   = Task.Run(() => new DoctorService().UpdateDoctor(doctor, logId));

            if (task.Wait(TimeSpan.FromSeconds(10)))
            {
                if (task.Result)
                {
                    return(Ok(true));
                }
                else
                {
                    return(Conflict());
                }
            }
            return(StatusCode(HttpStatusCode.RequestTimeout));
        }
        public DoctorLogin Post([FromBody] TblDoctor drLogin)
        {
            TblDoctor doctor = msc.TblDoctor.FromSql("doctorauthentication '" + drLogin.DrUserId + "','" + drLogin.DrPassword + "'").SingleOrDefault();

            if (doctor != null)
            {
                DoctorLogin drdetailsFetch = new DoctorLogin();
                drdetailsFetch.DrUserId              = doctor.DrUserId;
                drdetailsFetch.DrFirstName           = doctor.DrFirstName;
                drdetailsFetch.DrLastName            = doctor.DrLastName;
                drdetailsFetch.SNo                   = doctor.SNo;
                drdetailsFetch.DrMdMedicareServiceId = doctor.DrMdMedicareServiceId;


                return(drdetailsFetch);
            }
            else
            {
                DoctorLogin drdetailsFetch = new DoctorLogin();
                drdetailsFetch = null;
                return(drdetailsFetch);
            }
        }
Exemplo n.º 9
0
 public bool UpdateDoctor(TblDoctor doctor, int logId)
 {
     return(new MainProvider().Update(doctor, logId));
 }
Exemplo n.º 10
0
 public TblDoctor AddDoctor(TblDoctor doctor)
 {
     return((TblDoctor) new MainProvider().Add(doctor));
 }
Exemplo n.º 11
0
 public TblDoctor AddDoctor(TblDoctor doctor)
 {
     return(new DoctorRepo().AddDoctor(doctor));
 }
Exemplo n.º 12
0
 public bool UpdateDoctor(TblDoctor doctor, int logId)
 {
     return(new DoctorRepo().UpdateDoctor(doctor, logId));
 }
 public void Post([FromBody] TblDoctor doctorDetails)
 {
     ms.Database.ExecuteSqlCommand("registerDoctor'" + doctorDetails.DrFirstName + "','" + doctorDetails.DrLastName + "'," + doctorDetails.DrAge + ",'" + doctorDetails.DrGender + "','" + doctorDetails.DrDob + "'," + doctorDetails.DrContactNo + "," + doctorDetails.DrAltContactNo + ",'" + doctorDetails.DrEmail + "','" + doctorDetails.DrPassword + "','" + doctorDetails.DrAddress1 + "','" + doctorDetails.DrAddress2 + "','" + doctorDetails.DrCity + "','" + doctorDetails.DrState + "'," + doctorDetails.DrZipcode + ",'" + doctorDetails.DrDegree + "','" + doctorDetails.DrSpeciality + "','" + doctorDetails.DrWorkHours + "','" + doctorDetails.DrClinicName + "','" + doctorDetails.DrMdMedicareServiceId + "'," + doctorDetails.DrStatus);
 }