public Response <ChiefComplaintModel> UpdateChiefComplaint(ChiefComplaintModel chiefComplaint) { var repository = _unitOfWork.GetRepository <ChiefComplaintModel>(SchemaName.Clinical); var procParams = BuildAddUpdSpParams(chiefComplaint); return(_unitOfWork.EnsureInTransaction(repository.ExecuteNQStoredProc, "usp_UpdateChiefComplaint", procParams, forceRollback: chiefComplaint.ForceRollback.GetValueOrDefault(false))); }
private List <SqlParameter> BuildAddUpdSpParams(ChiefComplaintModel chiefComplaint) { var spParameters = new List <SqlParameter> { new SqlParameter("ChiefComplaintID", chiefComplaint.ChiefComplaintID), new SqlParameter("ContactID", chiefComplaint.ContactID), new SqlParameter("ChiefComplaint", chiefComplaint.ChiefComplaint), new SqlParameter("TakenBy", chiefComplaint.TakenBy), new SqlParameter("TakenTime", chiefComplaint.TakenTime), new SqlParameter("EncounterID", (object)chiefComplaint.EncounterID ?? DBNull.Value), new SqlParameter("ModifiedOn", chiefComplaint.ModifiedOn ?? DateTime.Now) }; return(spParameters); }
public IHttpActionResult UpdateChiefComplaint(ChiefComplaintModel chiefComplaint) { if (ModelState.IsValid) { return(new HttpResult <Response <ChiefComplaintModel> >(_ruleEngine.UpdateChiefComplaint(chiefComplaint), Request)); } else { var errorMessage = ModelState.ParseError(); var validationResponse = new Response <ChiefComplaintModel>() { DataItems = new List <ChiefComplaintModel>(), ResultCode = -1, ResultMessage = errorMessage }; return(new HttpResult <Response <ChiefComplaintModel> >(validationResponse, Request)); } }
public static ChiefComplaintModel ToModel(this ChiefComplaintViewModel model) { if (model == null) { return(null); } var entity = new ChiefComplaintModel { ChiefComplaintID = model.ChiefComplaintID, ContactID = model.ContactID, TakenBy = model.TakenBy, TakenTime = model.TakenTime, ChiefComplaint = model.Complaint, ModifiedOn = model.ModifiedOn }; return(entity); }
public static ChiefComplaintViewModel ToViewModel(this ChiefComplaintModel entity) { if (entity == null) { return(null); } var model = new ChiefComplaintViewModel { ChiefComplaintID = entity.ChiefComplaintID, ContactID = entity.ContactID, TakenBy = entity.TakenBy, TakenDate = entity.TakenTime, TakenTime = entity.TakenTime, Complaint = entity.ChiefComplaint, ModifiedOn = entity.ModifiedOn }; return(model); }
public Response <ChiefComplaintModel> UpdateChiefComplaint(ChiefComplaintModel chiefComplaint) { return(_service.UpdateChiefComplaint(chiefComplaint)); }
public Response <ChiefComplaintModel> AddChiefComplaint(ChiefComplaintModel chiefComplaint) { return(_service.AddChiefComplaint(chiefComplaint)); }
public IHttpActionResult UpdateChiefComplaint(ChiefComplaintModel chiefComplaint) { return(new HttpResult <Response <ChiefComplaintModel> >(_dataProvider.UpdateChiefComplaint(chiefComplaint), Request)); }
public Response <ChiefComplaintModel> UpdateChiefComplaint(ChiefComplaintModel chiefComplaint) { const string apiUrl = BaseRoute + "UpdateChiefComplaint"; return(_communicationManager.Put <ChiefComplaintModel, Response <ChiefComplaintModel> >(chiefComplaint, apiUrl)); }