/// <summary> /// 显示新建会诊病例页面 /// 从指定用户的草稿箱中试图获取,若无则新建(为了patientcase_id,用于提前保存附件) /// </summary> /// <returns></returns> public ActionResult New() { ViewBag.CurrentUser = CurrentUser; var draft = PatientCaseMgr.GetDraft(CurrentUser.id); if (draft == null) // 尚无草稿,则创建 { draft = new patientcase() { owner_id = CurrentUser.id, owner_name = CurrentUser.name, title = string.Empty, gender = GenderType.未知, created_dt = DateTime.Now, status = PatientCaseStatusType.草稿 }; PatientCaseMgr.InsertPatientCase(draft); } return(View("Edit", draft)); }
public ActionResult SubmitPatientCase([Bind] patientcase obj, int mode) { if (string.IsNullOrEmpty(obj.title) == true) { return(Content("会诊病例的标题不可为空。")); } obj.modified_dt = DateTime.Now; obj.owner_name = CurrentUser.name; if (mode == 1) { obj.status = PatientCaseStatusType.草稿; } if (mode == 2 || mode == 3) { obj.status = PatientCaseStatusType.待审核; // 测试:自动审核通过 // for Test } PatientCaseMgr.UpdatePatientCase(obj); return(Content("OK")); }