/// <summary> /// 新增处方记录-添加一个处方药 /// </summary> /// <returns></returns> public IActionResult RxDrugSaveAddDrug(long rxSaveId, RxDrugViewModel model) { var rxSaveDrugsId = _rxSvr.SaveDrug(rxSaveId, model); //if (rxSaveId <= 0) //{ // return PartialView("partialError",new Exception("录入药品不能为空或重复!")); //} model.RxSaveDrugsId = rxSaveDrugsId; return(PartialView("_pvRxDrugSaveBase_Drug", model)); }
/// <summary> /// 保存药品信息 /// </summary> /// <param name="rxSaveId"></param> /// <param name="rxDrug"></param> /// <returns>RxSaveDrugsId,返回-1则出错</returns> public long SaveDrug(long rxSaveId, RxDrugViewModel rxDrug) { var model = new CHIS_DrugStore_RxSave_Drugs { DrugDeadTime = rxDrug.DrugDeadTime, DrugId = rxDrug.DrugId, DrugManufacture = rxDrug.DrugManufacture, DrugModel = rxDrug.DrugModel, DrugName = rxDrug.DrugName, DrugPiNo = rxDrug.DrugPiNo, DrugQty = rxDrug.DrugQty, DrugUnitName = rxDrug.DrugUnitName, RxSaveId = rxSaveId }; var entity = _db.CHIS_DrugStore_RxSave_Drugs.Add(model); _db.SaveChanges(); return(entity.Entity.RxSaveDrugsId); }