public string SaveConsultationInfo() { return(base.ExecuteActionJsonResult("会诊单信息保存", () => { CD_Consultation entity = base.GetPageData <CD_Consultation>(0); if (!string.IsNullOrWhiteSpace(entity.InpatientId)) { CD_Inpatient inpatient = EntityOperate <CD_Inpatient> .GetEntityById(Request["InpatientId"], "InpatientId"); if (string.IsNullOrWhiteSpace(entity.ConsultationId) || entity.ConsultationId == "null") { entity.ConsultationState = "1"; entity.DeptId = inpatient.CurrentDeptID; entity.WardId = inpatient.CurrentWardID; entity.RequesterCode = UserTokenManager.GetUserToken(Request["token"]).UserId; GI_UserInfo user = EntityOperate <GI_UserInfo> .GetEntityById(entity.RequesterCode, "USERID"); entity.RequestDepartCode = user.DpetID; entity.OrganID = UserTokenManager.GetUserToken(Request["token"]).ORGANID; } entity.Del = 0; service.SaveInfo(entity); msgHub hub = new msgHub(); // hub.SendGroup(entity.ApplyDepartCode, "Con", "", ""); } return new WebApi_Result(); })); }
/// <summary> /// 保存会诊单 /// </summary> /// <param name="entity"></param> public void SaveInfo(CD_Consultation entity) { if (!string.IsNullOrWhiteSpace(entity.ConsultationId) && entity.ConsultationId != "null") { entity.UpdateM("ConsultationId"); } else { entity.ConsultationId = CommonService.GetPrimaryId(new GI_SerialInfo() { Name = "CD_Consultation", ColumnName = "ConsultationId", OrganID = entity.OrganID }) + ""; entity.SaveModelM(); string[] userId = new string[] { entity.ApplyDoctorCode }; msgHub msg = new msgHub(); msg.Send(userId, "", entity.ApplyDoctorCode, ""); } }