public void DeleteOrderedTestByStudy(long idStudy) { string query = $@" delete OrderedTests where IdStudy = {idStudy} "; BaseDAO.InsertOrUpdate(query, false); }
public void DeleteStudiesByOrder(long idOrder) { string query = $@" delete Studies where IdOrder = {idOrder} "; BaseDAO.InsertOrUpdate(query, false); }
public void InsertUser(UserModel u) { string query = $@" insert into Users(IdEmployee, Login, Password, DateOfChange, InUse, IdPatient) values({BaseDAO.SetNullableLong(u.IdEmployee)},{BaseDAO.SetString(u.Login)},{BaseDAO.SetString(u.Password)},{BaseDAO.SetDate(DateTime.Now)},1,{BaseDAO.SetNullableLong(u.IdPatient)}); "; BaseDAO.InsertOrUpdate(query, false); }
public void ChangeOrderStatus(long IdOrder, long IdStatus) { string query = $@" update Orders set IdStatus={IdStatus} where IdOrder={IdOrder} "; BaseDAO.InsertOrUpdate(query, false); }
public void SetNotUseSession(long idUser) { string query = $@" update Sessions set InUse = 0 where IdUser = {idUser} "; BaseDAO.InsertOrUpdate(query, false); }
public void UpdateSample(SampleModel s) { string query = $@" update Samples set Code={BaseDAO.SetString(s.Code)} where IdSample={s.IdSample} "; BaseDAO.InsertOrUpdate(query, false); }
public void InsertResultUnit(ResultUnitModel r) { string query = $@" insert into ResultUnits(IdOrderedTests, IdResult, Value) values({r.IdOrderedTest},{r.IdResult},{BaseDAO.SetNullableDouble(r.Value)}); "; BaseDAO.InsertOrUpdate(query, false); }
public void ChangeStudyStatus(long IdStudy, long IdStatus) { string query = $@" update Studies set IdStatus={IdStatus} where IdStudy={IdStudy} "; BaseDAO.InsertOrUpdate(query, false); }
public void InsertVerify(VerificationModel v) { string query = $@" insert into Verifications(IdResult, IdEmployee, DateOfVerification, Description, Positive) values({v.IdResult},{v.IdEmployee},{BaseDAO.SetDate(DateTime.Now)},{BaseDAO.SetString(v.Description)}, {BaseDAO.SetBool(v.Positive)}); "; BaseDAO.InsertOrUpdate(query, false); }
public void InsertSession(SessionModel s) { string query = $@" insert into Sessions(Token, ExpirationDate, IdUser, InUse) values({BaseDAO.SetString(s.Token)},{BaseDAO.SetDate(s.ExpirationDate)},{s.IdUser}, 1); "; BaseDAO.InsertOrUpdate(query, false); }
public void UpdateUser(UserModel u) { string query = $@" update Users set Password = {BaseDAO.SetString(u.Password)}, DateOfChange = {BaseDAO.SetDate(DateTime.Now)}, InUse = {BaseDAO.SetBool(u.InUse)} where IdUser = {u.IdUser}; "; BaseDAO.InsertOrUpdate(query, false); }
public void FullUpdateOrder(OrderModel o) { string query = $@" update Orders set IdPatient={o.IdPatient}, IdWard={BaseDAO.SetNullableLong(o.IdWard)}, Institution={BaseDAO.SetString(o.Institution)}, Comment={BaseDAO.SetString(o.Comment)}, IdPriority={o.IdPriority} where IdOrder={o.IdOrder} "; BaseDAO.InsertOrUpdate(query, false); }
public long?InsertStudy(StudyModel study) { string query = $@" insert into Studies(IdOrder, IdProfile, IdStatus, Actual, PreviousId) output INSERTED.IdStudy values({study.IdOrder}, {study.IdProfile}, {(long)StatusTypeEnum.Ordered}, 1, {BaseDAO.SetNullableLong(study.PreviousId)}); "; return(BaseDAO.InsertOrUpdate(query, true)); }
public long?InsertOrderedTest(long idStudy, long idTest) { string query = $@" insert into OrderedTests(IdStudy, IdTest) output INSERTED.IdOrderedTest values({idStudy}, {idTest}) ; "; return(BaseDAO.InsertOrUpdate(query, true)); }
public long?InsertConsultant(long idEmployee, long idOrder) { string query = $@" insert into Consultants(IdEmployee, IdOrder) output INSERTED.IdConsultant values({idEmployee},{idOrder}) ; "; return(BaseDAO.InsertOrUpdate(query, true)); }
public long?InsertSample(SampleModel s) { string query = $@" insert into Samples(IdStudy, IdEmployee, DateOfCollection) output INSERTED.IdSample values({s.IdStudy}, {s.IdEmployee},{BaseDAO.SetDate(s.DateOfCollection)} ) ; "; return(BaseDAO.InsertOrUpdate(query, true)); }
public long?InsertResult(ResultModel r) { string query = $@" insert into Results(IdEmployee, IdStudy, DateOfResult, Description) output INSERTED.IdResult values({r.IdEmployee},{r.IdStudy},{BaseDAO.SetDate(DateTime.Now)}, {BaseDAO.SetString(r.Description)}); "; return(BaseDAO.InsertOrUpdate(query, true)); }
public void SetReorederDataOfStudy(StudyModel study) { string query = $@" update Studies set IdRepeatEmployee={study.IdRepeatEmployee}, IdStatus={(long)StatusTypeEnum.ReOrdered}, ReasonForRepeat={BaseDAO.SetString(study.ReasonForRepeat)}, Actual={BaseDAO.SetBool(false)}, DateOfEnd={BaseDAO.SetDate(DateTime.Now)} where IdStudy={study.IdStudy} "; BaseDAO.InsertOrUpdate(query, false); }
public long?InsertOrder(OrderModel o) { string query = $@" insert into Orders(IdPatient, IdEmployee, IdWard, Institution, Comment, DateOfOrder, IdStatus, IdPriority) output INSERTED.IdOrder values({o.IdPatient},{o.IdEmployee},{BaseDAO.SetNullableLong(o.IdWard)},{BaseDAO.SetString(o.Institution)}, {BaseDAO.SetString(o.Comment)},{BaseDAO.SetDate(DateTime.Now)}, 1, {o.IdPriority}); "; return(BaseDAO.InsertOrUpdate(query, true)); }
public void UpdateEmployee(EmployeeModel e) { string query = $@" update Employees set FirstName={BaseDAO.SetString(e.FirstName)}, Surname={BaseDAO.SetString(e.Surname)}, Pesel={BaseDAO.SetString(e.Pesel)}, Sex={BaseDAO.SetString(e.Sex)}, Street={BaseDAO.SetString(e.Street)}, HouseNumber={BaseDAO.SetString(e.HouseNumber)}, City={BaseDAO.SetString(e.City)}, PostalCode={BaseDAO.SetString(e.PostalCode)}, Country={BaseDAO.SetString(e.Country)}, Phone={BaseDAO.SetString(e.Phone)}, IdPosition={e.IdPosition}, Email={BaseDAO.SetString(e.Email)}, LicenseNumber={BaseDAO.SetString(e.LicenseNumber)}, IdWard={BaseDAO.SetNullableLong(e.IdWard)} where IdEmployee={e.IdEmployee} "; BaseDAO.InsertOrUpdate(query, false); }
public void UpdateStudy(StudyModel study) { string query = $@" update Studies set IdEmployee={study.IdDoctor}, IdStatus={study.IdStatus}, DateOfStudy={BaseDAO.SetDate(study.DateOfStudy)}, ReasonForRepeat={BaseDAO.SetString(study.ReasonForRepeat)}, Actual={BaseDAO.SetBool(study.Actual)}, PreviousId={BaseDAO.SetNullableLong(study.PreviousId)}, DateOfEnd={BaseDAO.SetDate(study.DateOfEnd)}, IdRepeatEmployee={BaseDAO.SetNullableLong(study.IdRepeatEmployee)} where IdStudy={study.IdStudy} "; BaseDAO.InsertOrUpdate(query, false); }
public void UpdatePatient(PatientModel p) { string query = $@" update Patients set FirstName={BaseDAO.SetString(p.FirstName)}, Surname={BaseDAO.SetString(p.Surname)}, Pesel={BaseDAO.SetString(p.Pesel)}, Sex={BaseDAO.SetString(p.Sex)}, Street={BaseDAO.SetString(p.Street)}, HouseNumber={BaseDAO.SetString(p.HouseNumber)}, City={BaseDAO.SetString(p.City)}, PostalCode={BaseDAO.SetString(p.PostalCode)}, Country={BaseDAO.SetString(p.Country)}, Phone={BaseDAO.SetString(p.Phone)}, IdCardNumber={BaseDAO.SetString(p.IdCardNumber)}, ContactPersonFirstName={BaseDAO.SetString(p.ContactPersonFirstName)}, ContactPersonSurname={BaseDAO.SetString(p.ContactPersonSurname)}, ContactPersonPesel={BaseDAO.SetString(p.ContactPersonPesel)}, ContactPersonPhone={BaseDAO.SetString(p.ContactPersonPhone)} where IdPatient={p.IdPatient} "; BaseDAO.InsertOrUpdate(query, false); }
public void InsertHistoryDataOfEmployee(EmployeeModel e, string user) { string query = $@" insert into HistoryPersonalData(FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, Email, LicenseNumber, IdEmployee, DateOfChange, UserOfChange) values({BaseDAO.SetString(e.FirstName)},{BaseDAO.SetString(e.Surname)},{BaseDAO.SetString(e.Pesel)},{BaseDAO.SetString(e.Sex)}, {BaseDAO.SetString(e.Street)},{BaseDAO.SetString(e.HouseNumber)},{BaseDAO.SetString(e.City)},{BaseDAO.SetString(e.PostalCode)}, {BaseDAO.SetString(e.Country)},{BaseDAO.SetString(e.Phone)}, {BaseDAO.SetString(e.Email)}, {BaseDAO.SetString(e.LicenseNumber)}, {e.IdEmployee}, {BaseDAO.SetDate(DateTime.Now)},{BaseDAO.SetString(user)}); "; BaseDAO.InsertOrUpdate(query, false); }
public long?InsertEmployee(EmployeeModel e) { string query = $@" insert into Employees(FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, IdPosition, Email, DateOfEmployment, LicenseNumber, IdWard) output INSERTED.IdEmployee values({BaseDAO.SetString(e.FirstName)},{BaseDAO.SetString(e.Surname)},{BaseDAO.SetString(e.Pesel)},{BaseDAO.SetString(e.Sex)}, {BaseDAO.SetString(e.Street)},{BaseDAO.SetString(e.HouseNumber)},{BaseDAO.SetString(e.City)},{BaseDAO.SetString(e.PostalCode)}, {BaseDAO.SetString(e.Country)},{BaseDAO.SetString(e.Phone)},{e.IdPosition},{BaseDAO.SetString(e.Email)}, {BaseDAO.SetDate(DateTime.Now)},{BaseDAO.SetString(e.LicenseNumber)},{BaseDAO.SetNullableLong(e.IdWard)}) ; "; return(BaseDAO.InsertOrUpdate(query, true)); }
public void InsertHistoryDataOfPatient(PatientModel p, string user) { string query = $@" insert into HistoryPersonalData(FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, IdCardNumber, ContactPersonFirstName, ContactPersonSurname, ContactPersonPesel, ContactPersonPhone, IdPatient, DateOfChange, UserOfChange) values({BaseDAO.SetString(p.FirstName)},{BaseDAO.SetString(p.Surname)},{BaseDAO.SetString(p.Pesel)},{BaseDAO.SetString(p.Sex)}, {BaseDAO.SetString(p.Street)},{BaseDAO.SetString(p.HouseNumber)},{BaseDAO.SetString(p.City)},{BaseDAO.SetString(p.PostalCode)}, {BaseDAO.SetString(p.Country)},{BaseDAO.SetString(p.Phone)},{BaseDAO.SetString(p.IdCardNumber)}, {BaseDAO.SetString(p.ContactPersonFirstName)},{BaseDAO.SetString(p.ContactPersonSurname)},{BaseDAO.SetString(p.ContactPersonPesel)}, {BaseDAO.SetString(p.ContactPersonPhone)},{p.IdPatient},{BaseDAO.SetDate(DateTime.Now)},{BaseDAO.SetString(user)}); "; BaseDAO.InsertOrUpdate(query, false); }
public long?InsertPatient(PatientModel p) { string query = $@" insert into Patients(FirstName, Surname, Pesel, Sex, Street, HouseNumber, City, PostalCode, Country, Phone, IdCardNumber, ContactPersonFirstName, ContactPersonSurname, ContactPersonPesel, ContactPersonPhone) output INSERTED.IdPatient values({BaseDAO.SetString(p.FirstName)},{BaseDAO.SetString(p.Surname)},{BaseDAO.SetString(p.Pesel)},{BaseDAO.SetString(p.Sex)}, {BaseDAO.SetString(p.Street)},{BaseDAO.SetString(p.HouseNumber)},{BaseDAO.SetString(p.City)},{BaseDAO.SetString(p.PostalCode)}, {BaseDAO.SetString(p.Country)},{BaseDAO.SetString(p.Phone)},{BaseDAO.SetString(p.IdCardNumber)}, {BaseDAO.SetString(p.ContactPersonFirstName)},{BaseDAO.SetString(p.ContactPersonSurname)},{BaseDAO.SetString(p.ContactPersonPesel)}, {BaseDAO.SetString(p.ContactPersonPhone)}); "; return(BaseDAO.InsertOrUpdate(query, true)); }