/// <summary> /// 增加和保存数据 /// </summary> /// <returns></returns> public string SaveInfo() { return(base.ExecuteActionJsonResult("保存信息", () => { CD_FormEmrTemplate entity = base.GetPageData <CD_FormEmrTemplate>(0); entity.TemplateId = string.IsNullOrWhiteSpace(entity.TemplateId) ? null : entity.TemplateId; entity.ParentId = string.IsNullOrWhiteSpace(entity.ParentId) ? null : entity.ParentId; entity.CreateTime = DateTime.Now; entity.Creator = UserTokenManager.GetUserToken(Request["token"]).UserId; formEmrTemplateService.SaveInfo(entity); return new WebApi_Result(); })); }
/// <summary> /// 增加和保存 /// </summary> /// <param name="entity"></param> public void SaveInfo(CD_FormEmrTemplate entity) { if (!string.IsNullOrWhiteSpace(entity.TemplateId) && entity.TemplateId != "null") { entity.UpdateM("TemplateId"); } else { entity.TemplateId = CommonService.GetPrimaryId(new GI_SerialInfo() { Name = "CD_FormEmrTemplate", ColumnName = "TemplateId", OrganID = entity.OrganID }) + ""; entity.ParentId = (string.IsNullOrWhiteSpace(entity.ParentId) ? "0" : entity.ParentId); entity.SaveModelM(); } }