public BaseResponse UpdateRegInfo(CareInsInfo baserequest) { BaseResponse response = new BaseResponse(); var dt = new DateTime(0001, 1, 1); if (baserequest.appCertInfo.CertNo == null || baserequest.appCertInfo.InHospDate == null || baserequest.appCertInfo.InHospDate == dt) { RegNCIInfo req = new RegNCIInfo(); req.Feeno = baserequest.FeeNo; SaveRegNCIInfo(req); } else { RegNCIInfo req = new RegNCIInfo(); req.Feeno = baserequest.FeeNo; req.Certno = baserequest.appCertInfo.CertNo; req.CertStartTime = Convert.ToDateTime(baserequest.appCertInfo.CertStartTime); req.CertexpiredTime = Convert.ToDateTime(baserequest.appCertInfo.CertExpiredTime); req.Caretypeid = baserequest.appCertInfo.AgencyapprovedcareType.ToString(); req.NCIPaylevel = baserequest.appCertInfo.NCIPayLevel; req.NCIPayscale = baserequest.appCertInfo.NCIPayScale; req.ApplyHosTime = baserequest.appCertInfo.InHospDate; SaveRegNCIInfo(req); UpdateRegIpd(baserequest); } return(response); }
public BaseResponse UpdateAppHospCertInfo(RegNCIInfo request) { var response = new BaseResponse(); var caretype = Convert.ToInt16(request.Caretypeid); var appHosp = unitOfWork.GetRepository <NCIA_APPHOSP>().dbSet.Where(x => x.ENTRYTIME == request.ApplyHosTime && x.ISDELETE != true && x.IDNO.ToUpper().Trim() == request.IdNo.ToUpper().Trim() && x.AGENCYRESULT == (int)ApplicationEnum.ExaminationPassed && x.CARETYPE == caretype).FirstOrDefault(); appHosp.ISDELETE = true; appHosp.UPDATEBY = "结案作业"; appHosp.UPDATETIME = DateTime.Now; appHosp.LEAVETIME = request.ipdoutTime; unitOfWork.GetRepository <NCIA_APPHOSP>().Update(appHosp); var nursingHomeAsstRecord = unitOfWork.GetRepository <NCIA_APPLICANT>().dbSet.FirstOrDefault(m => m.IDNO.ToUpper().Trim() == request.IdNo.ToUpper().Trim() && m.ISDELETE != true); nursingHomeAsstRecord.LASTHOSPRESULT = (int)ApplicationEnum.AuditNotPassed; unitOfWork.GetRepository <NCIA_APPLICANT>().Update(nursingHomeAsstRecord); var supervise = unitOfWork.GetRepository <NCI_SUPERVISE>().dbSet.Where(x => x.APPCERTID == appHosp.APPCERTID && appHosp.APPHOSPID == appHosp.APPHOSPID && x.VALID == true).FirstOrDefault(); if (supervise != null) { supervise.VALID = false; unitOfWork.GetRepository <NCI_SUPERVISE>().Update(supervise); NCI_SUPERVISE model = new NCI_SUPERVISE(); model.APPCERTID = appHosp.APPCERTID; model.APPHOSPID = appHosp.APPHOSPID; model.REASON = "结案作业取消资格"; model.STATUS = 1; model.VALID = true; model.CREATEBY = "API"; model.CREATETIME = DateTime.Now; unitOfWork.GetRepository <NCI_SUPERVISE>().Insert(model); } else { NCI_SUPERVISE model = new NCI_SUPERVISE(); model.APPCERTID = appHosp.APPCERTID; model.APPHOSPID = appHosp.APPHOSPID; model.REASON = "结案作业取消资格"; model.STATUS = 1; model.VALID = true; model.CREATEBY = "API"; model.CREATETIME = DateTime.Now; unitOfWork.GetRepository <NCI_SUPERVISE>().Insert(model); } unitOfWork.Save(); return(response); }
public BaseResponse SaveRegNCIInfo(RegNCIInfo baseRequest) { BaseResponse response = new BaseResponse(); Mapper.CreateMap <RegNCIInfo, LTC_REGNCIINFO>(); var model = unitOfWork.GetRepository <LTC_REGNCIINFO>().dbSet.Where(x => x.FEENO == baseRequest.Feeno && x.STATUS == 0).FirstOrDefault(); if (model == null) { UpdateRegBalance(baseRequest.Feeno, true); baseRequest.Createby = SecurityHelper.CurrentPrincipal.EmpNo; baseRequest.Createtime = DateTime.Now; baseRequest.Status = 0; model = Mapper.Map <LTC_REGNCIINFO>(baseRequest); unitOfWork.GetRepository <LTC_REGNCIINFO>().Insert(model); unitOfWork.Save(); } else { UpdateRegBalance(baseRequest.Feeno, false); model.STATUS = 1; model.UPDATEBY = SecurityHelper.CurrentPrincipal.EmpNo; model.UPDATETIME = DateTime.Now; unitOfWork.GetRepository <LTC_REGNCIINFO>().Update(model); if (baseRequest.Certno != null) { UpdateRegBalance(baseRequest.Feeno, true); baseRequest.Createby = SecurityHelper.CurrentPrincipal.EmpNo; baseRequest.Createtime = DateTime.Now; baseRequest.Status = 0; var basereq = Mapper.Map <LTC_REGNCIINFO>(baseRequest); unitOfWork.GetRepository <LTC_REGNCIINFO>().Insert(basereq); } unitOfWork.Save(); } return(response); }
public IHttpActionResult Post(RegNCIInfo baseRequest) { var response = service.UpdateAppHospCertInfo(baseRequest); return(Ok(response)); }
public IHttpActionResult Post(RegNCIInfo baseRequest) { var response = service.SaveRegNCIInfo(baseRequest); return(Ok(response)); }