public async Task <IActionResult> RxCusM(RxMobileInputModel model) { if (model.IsAgreement == false) { return(View("RxCustomerInputMobile", model)); } if (model.CustomerId == 0) { var cus = await _cusSvr.CreateCustomerAsync( model.CustomerName, model.CustomerMobile, model.CustomerIdCode, sysSources.处方药记录快录, 0, ""); model.CustomerId = cus.CustomerID; } var rxModel = new CHIS_DrugStore_RxSave( model.Station.StationID, model.Doctor.DoctorId, model.CustomerId, model.CustomerName, model.CustomerIdCode, model.CustomerMobile, model.CustomerGenderStr, model.RxPicUrl1, model.RxPicUrl2, model.RxPicUrl3); var rxSaveId = _rxSvr.SaveCustomer(rxModel); try { var rlt = MyDynamicResult(true, "录入成功"); rlt.RxSaveId = rxSaveId; return(Ok(rlt)); }catch (Exception e) { var rlt = MyDynamicResult(e); return(BadRequest(rlt)); } }
public async Task <IActionResult> RxCusM(RxMobileInputModel model) { if (model.IsAgreement == false) { ModelState.AddModelError("IsAgreement", "同意后才能录入信息"); return(View("RxCustomerInputMobile", model)); } if (model.CustomerId == 0) { var cus = await _cusSvr.CreateCustomerAsync( model.CustomerName, model.CustomerMobile, model.CustomerIdCode, sysSources.处方药记录快录, 0, ""); model.CustomerId = cus.CustomerID; } var cusGenderStr = Ass.Data.Utils.GetIdCardInfo(model.CustomerIdCode).GenderString; var rxModel = new CHIS_DrugStore_RxSave( model.Station.StationID, model.Doctor.DoctorId, model.CustomerId, model.CustomerName, model.CustomerIdCode, model.CustomerMobile, cusGenderStr, model.RxPicUrl1, model.RxPicUrl2, model.RxPicUrl3); _rxSvr.SaveCustomer(rxModel); return(RedirectToAction("CustomerInfoCompleted")); }