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 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?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 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 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 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 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)); }