Esempio n. 1
0
        public bool Delete(RegistrCard registrCard)
        {
            string sqlQuery = "Delete from [dbo].[registrcards] where [id] = @ID";
            var    result   = false;

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                             new
                {
                    registrCard.ID,
                });
                result = true;
            }
            return(result);
        }
Esempio n. 2
0
        public bool Update(RegistrCard registrCard)
        {
            string sqlQuery = "Update [dbo].[registrcards] set [patientid] = @PatientID,[doctorid] = @DoctorID,[diagnosise] = @Diagnosise, [visitdate] = @VisitDate  where [id] = @ID";
            var    result   = false;

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                             new
                {
                    registrCard.ID,
                    registrCard.PatientID,
                    registrCard.DoctorID,
                    registrCard.Diagnosise,
                    registrCard.VisitDate
                });
                result = true;
            }
            return(result);
        }
Esempio n. 3
0
        public bool Insert(RegistrCard registrCard)
        {
            string sqlQuery = "INSERT INTO [dbo].[registrcards]([id],[patientid],[doctorid],[diagnosise],[visitdate]) VALUES (@ID,@PatientID,@DoctorID, @Diagnosise,@VisitDate)";
            var    result   = false;

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                             new
                {
                    registrCard.ID,
                    registrCard.PatientID,
                    registrCard.DoctorID,
                    registrCard.Diagnosise,
                    registrCard.VisitDate
                });
                result = true;
            }
            return(result);
        }
Esempio n. 4
0
        public bool UpdateRecord(Guid id,RegistrCard regCard)
        {
            try
            {
                db.Update(regCard);

            }
            catch (Exception)
            {

                return false;
            }
            return true;

        }
Esempio n. 5
0
        public bool AddRecordToCard(RegistrCard regCard)
        {
            try
            {
                regCard.ID = Guid.NewGuid();
                regCard.VisitDate = DateTime.UtcNow;
                db.Insert(regCard);

            }
            catch (Exception)
            {

                return false;
            }
            return true;
        }
Esempio n. 6
0
 public bool Delete(RegistrCard registrCard)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public bool Insert(RegistrCard registrCard)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
        public bool Delete(RegistrCard registrCard)
        {
            string sqlQuery = "Delete from [dbo].[registrcards] where [id] = @ID";
            var result = false;
            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                new
                {
                    registrCard.ID,

                });
                result = true;
            }
            return result;
        }
Esempio n. 9
0
        public bool Update(RegistrCard registrCard)
        {
            string sqlQuery = "Update [dbo].[registrcards] set [patientid] = @PatientID,[doctorid] = @DoctorID,[diagnosise] = @Diagnosise, [visitdate] = @VisitDate  where [id] = @ID";
            var result = false;
            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                new
                {
                    registrCard.ID,
                    registrCard.PatientID,
                    registrCard.DoctorID,
                    registrCard.Diagnosise,
                    registrCard.VisitDate
                });
                result = true;
            }
            return result;
        }
Esempio n. 10
0
        public bool Insert(RegistrCard registrCard)
        {
            string sqlQuery = "INSERT INTO [dbo].[registrcards]([id],[patientid],[doctorid],[diagnosise],[visitdate]) VALUES (@ID,@PatientID,@DoctorID, @Diagnosise,@VisitDate)";
            var result = false;
            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                conn.Execute(sqlQuery,
                new
                {
                    registrCard.ID,
                    registrCard.PatientID,
                    registrCard.DoctorID,
                    registrCard.Diagnosise,
                    registrCard.VisitDate
                });
                result = true;
            }
            return result;
        }