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); }
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); }
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); }
public bool UpdateRecord(Guid id,RegistrCard regCard) { try { db.Update(regCard); } catch (Exception) { return false; } return true; }
public bool AddRecordToCard(RegistrCard regCard) { try { regCard.ID = Guid.NewGuid(); regCard.VisitDate = DateTime.UtcNow; db.Insert(regCard); } catch (Exception) { return false; } return true; }
public bool Delete(RegistrCard registrCard) { throw new NotImplementedException(); }
public bool Insert(RegistrCard registrCard) { throw new NotImplementedException(); }
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; }
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; }
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; }