Exemplo n.º 1
0
        public string CreatePIN(string patientloginid, string SurgeryDate, string PIN)
        {
            string result = string.Empty;

            try
            {
                var _patient = (from p in context.Patient.Where(p => p.PatientLoginId == patientloginid && Convert.ToDateTime(p.SurgeryDate).ToString("dd/MM/yyyy") == Convert.ToDateTime(SurgeryDate).ToString("dd/MM/yyyy"))
                                select p).FirstOrDefault();
                if (_patient != null)
                {
                    _patient.Pin = !String.IsNullOrEmpty(PIN) ? int.Parse(PIN) : 0;
                    context.Entry(_patient).State = EntityState.Modified;
                    context.SaveChanges();


                    result = "success";
                }
                else
                {
                    result = "fail";
                }
            }
            catch (Exception ex)
            {
                result = "error";
            }
            return(result);
        }
Exemplo n.º 2
0
        public Vtransact getVTransactbyTherapistAndPatientId(string therapistId, string patientId)
        {
            Vtransact ltransact = (from p in context.Vtransact
                                   where p.TherapistId == therapistId && p.Status == 0
                                   select p).FirstOrDefault();

            if (ltransact != null)
            {
                ltransact.PatientId            = patientId;
                context.Entry(ltransact).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                if (context.SaveChanges() > 0)
                {
                    return(ltransact);
                }
            }
            return(null);
        }
        public User userLogin(string lUserID, string password, int type)
        {
            User luser = (from p in context.User
                          where p.UserId == lUserID && p.Password == password && p.Type == type
                          select p).FirstOrDefault();

            if (luser != null)
            {
                luser.LoginSessionId       = Guid.NewGuid().ToString();
                context.Entry(luser).State = EntityState.Modified;
                int result = context.SaveChanges();
                if (result > 0)
                {
                    return(luser);
                }
            }
            return(null);
        }
 public void UpdatePain(Pain pPain)
 {
     //var _pain = (from p in context.Pain
     //             where p.PainId == pPain.PainId
     //             select p).FirstOrDefault();
     //if (_pain != null)
     //{
     context.Entry(pPain).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
     //}
 }
 public void UpdateSession(Session pSession)
 {
     //var _session = (from p in context.Session
     //                where p.SessionId == pSession.SessionId
     //                select p).FirstOrDefault();
     //if (_session != null)
     //{
     context.Entry(pSession).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
     //}
 }
        public int UpdatePatientReview(PatientReview pPatientReview)
        {
            var _PatientReview = (from p in context.PatientReview
                                  where p.ReviewId == pPatientReview.ReviewId
                                  select p).FirstOrDefault();

            if (_PatientReview != null)
            {
                context.Entry(_PatientReview).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                return(context.SaveChanges());
            }
            return(0);
        }
Exemplo n.º 7
0
 public string UpdateEquipmentAssignment(EquipmentAssignment pEquipmentAssignment)
 {
     try
     {
         context.Entry(pEquipmentAssignment).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         context.SaveChanges();
         return("success");
     }
     catch (Exception ex)
     {
         return("fail");
     }
 }
Exemplo n.º 8
0
        public int UpdateSessionAuditTrail(SessionAuditTrail pSessionAuditTrail)
        {
            var _auditTrail = (from p in context.SessionAuditTrail
                               where p.AuditTrailId == pSessionAuditTrail.AuditTrailId
                               select p).FirstOrDefault();

            if (_auditTrail != null)
            {
                context.Entry(_auditTrail).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                return(context.SaveChanges());
            }
            return(0);
        }
Exemplo n.º 9
0
        public int UpdateUserActivityLog(UserActivityLog pUserActivityLog)
        {
            var _activity = (from p in context.UserActivityLog
                             where p.ActivityId == pUserActivityLog.ActivityId
                             select p).FirstOrDefault();

            if (_activity != null)
            {
                context.Entry(pUserActivityLog).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                return(context.SaveChanges());
            }
            return(0);
        }
Exemplo n.º 10
0
        public string UpdateProtocol(Protocol pProtocol)
        {
            var _protocol = (from p in context.Protocol
                             where p.ProtocolId == pProtocol.ProtocolId
                             select p).FirstOrDefault();

            if (_protocol != null)
            {
                _protocol.ProtocolName = pProtocol.ProtocolName;
                _protocol.PatientId    = pProtocol.PatientId;

                _protocol.EquipmentType = pProtocol.EquipmentType;

                _protocol.MaxUpLimit   = pProtocol.MaxUpLimit;
                _protocol.MaxDownLimit = pProtocol.MaxDownLimit;

                _protocol.FlexUpLimit   = pProtocol.FlexUpLimit;
                _protocol.FlexDownLimit = pProtocol.FlexDownLimit;


                _protocol.StretchUpLimit      = pProtocol.StretchUpLimit;
                _protocol.StretchDownLimit    = pProtocol.StretchDownLimit;
                _protocol.StretchUpHoldtime   = pProtocol.StretchUpHoldtime;
                _protocol.StretchDownHoldtime = pProtocol.StretchDownHoldtime;

                _protocol.RestPosition = pProtocol.RestPosition;
                _protocol.Reps         = pProtocol.Reps;
                _protocol.RestAt       = pProtocol.RestAt;
                _protocol.RepsAt       = pProtocol.RepsAt;
                _protocol.Speed        = pProtocol.Speed;


                if (pProtocol != null && pProtocol.Time != null && !String.IsNullOrEmpty(pProtocol.Time.ToString()))
                {
                    _protocol.Time = pProtocol.Time;
                }

                context.Entry(_protocol).State = EntityState.Modified;
                context.SaveChanges();
            }
            return("success");
        }
Exemplo n.º 11
0
 public void UpdateDeviceCalibration(DeviceCalibration pDeviceCalibration)
 {
     context.Entry(pDeviceCalibration).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
 }
Exemplo n.º 12
0
 public void UpdatePatientConfiguration(PatientConfiguration pPatientConfiguration)
 {
     context.Entry(pPatientConfiguration).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
 }
 public void UpdatePatientLibrary(PatientLibrary pLibrary)
 {
     context.Entry(pLibrary).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
 }
        public Protocol CreateProtocol(NewProtocol protocol)
        {
            try
            {
                Protocol pro = new Protocol();
                if (String.IsNullOrEmpty(protocol.ProtocolId))
                {
                    //generating protocol id
                    pro.ProtocolId   = Guid.NewGuid().ToString();
                    pro.ProtocolEnum = Convert.ToInt32(protocol.ExcerciseName);
                }
                else
                {
                    pro = (from p in context.Protocol
                           where p.ProtocolId == protocol.ProtocolId
                           select p).FirstOrDefault();
                }
                pro.ProtocolName        = protocol.ProtocolName;
                pro.LaymanName          = protocol.LaymanName;
                pro.PatientId           = protocol.PatientId;
                pro.RxId                = protocol.RxId;
                pro.FlexUpLimit         = protocol.FlexUpLimit;
                pro.StretchUpLimit      = protocol.StretchUpLimit;
                pro.FlexDownLimit       = protocol.FlexDownLimit;
                pro.StretchDownLimit    = protocol.StretchDownLimit;
                pro.FlexDownHoldtime    = protocol.FlexDownHoldtime;
                pro.FlexUpHoldtime      = protocol.FlexUpHoldtime;
                pro.EquipmentType       = protocol.EquipmentType;
                pro.DeviceConfiguration = protocol.ExcerciseEnum;
                pro.StretchUpHoldtime   = protocol.StretchUpHoldtime;
                pro.StretchDownHoldtime = protocol.StretchDownHoldtime;
                pro.RestPosition        = protocol.RestPosition;

                pro.StartDate = protocol.StartDate;
                pro.EndDate   = protocol.EndDate;
                pro.RestAt    = protocol.RestAt;
                pro.RepsAt    = protocol.RepsAt;
                pro.Speed     = protocol.Speed;
                pro.Time      = protocol.Time;
                pro.RestTime  = protocol.RestTime;
                pro.Reps      = protocol.Reps;
                pro.Plane     = protocol.Plane;
                if (String.IsNullOrEmpty(protocol.ProtocolId))
                {
                    context.Protocol.Add(pro);
                }
                else
                {
                    context.Entry(pro).State = EntityState.Modified;
                }
                int res = context.SaveChanges();
                if (res > 0)
                {
                    return(pro);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }