コード例 #1
0
        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)));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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));
     }
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public Response <ChiefComplaintModel> UpdateChiefComplaint(ChiefComplaintModel chiefComplaint)
 {
     return(_service.UpdateChiefComplaint(chiefComplaint));
 }
コード例 #7
0
 public Response <ChiefComplaintModel> AddChiefComplaint(ChiefComplaintModel chiefComplaint)
 {
     return(_service.AddChiefComplaint(chiefComplaint));
 }
コード例 #8
0
 public IHttpActionResult UpdateChiefComplaint(ChiefComplaintModel chiefComplaint)
 {
     return(new HttpResult <Response <ChiefComplaintModel> >(_dataProvider.UpdateChiefComplaint(chiefComplaint), Request));
 }
コード例 #9
0
        public Response <ChiefComplaintModel> UpdateChiefComplaint(ChiefComplaintModel chiefComplaint)
        {
            const string apiUrl = BaseRoute + "UpdateChiefComplaint";

            return(_communicationManager.Put <ChiefComplaintModel, Response <ChiefComplaintModel> >(chiefComplaint, apiUrl));
        }