public override void OnRefreshData(EmsUIDTO headDo, object e) { if (headDo != null) { EmsHeadDO = headDo; } consDo = cof.GetCons(EmsHeadDO.Emsapcons.Id_srv); if (this.Created) { if (consDo != null && this.pageCommands != null) { foreach (XapCommand conmmands in this.pageCommands[0].Commands) { conmmands.Visible = consDo.Fg_deps.Value; conmmands.Enabled = consDo.Fg_deps.Value; } } if (EmsHeadDO.Emsapcons.EmsConsAssistItem == null || EmsHeadDO.Emsapcons.EmsConsAssistItem.Count == 0) { EmsItemInCons itemDO = new EmsItemInCons(); itemDO.Id_org = UserManager.getInstance().CurrentOrg.Id_org; itemDO.Name_org = UserManager.getInstance().CurrentOrg.Name; EmsHeadDO.Emsapcons.EmsConsAssistItem.Add(itemDO); } this.LoadData(); } }
public override void EditEms(CiEmsDTO ems) { base.EditEms(ems); orCiEmsToUiEms.EditCons(uiEmsDTO, ems); this.uiEmsDTO.Status = DOStatus.NEW; this.tableDataSource.Clear(); // 如模型为空 第一次创建 IMedsrvMDOCrudService service = XapServiceMgr.find <IMedsrvMDOCrudService>(); MedSrvDO medSrcDO = service.findById(ems.Id_srv); uiEmsDTO.Emsapcons.Name_srv = medSrcDO.Name; MedSrvConsDO srvcons = this.logicEx.GetCons(this.uiEmsDTO.MedSrvDO.Id_srv); if (srvcons != null) { uiEmsDTO.Emsapcons.Fg_deps = srvcons.Fg_deps; uiEmsDTO.Emsapcons.Fg_inorg = srvcons.Fg_inorg; } if (uiEmsDTO.Emsapcons.EmsConsAssistItem.Count > 0) { uiEmsDTO.Emsapcons.Id_dep_emp = uiEmsDTO.Emsapcons.EmsConsAssistItem[0].Id_dep_emp; uiEmsDTO.Emsapcons.Name_dep_emp = uiEmsDTO.Emsapcons.EmsConsAssistItem[0].Name_dep_emp; uiEmsDTO.Emsapcons.Id_emp_doctor = uiEmsDTO.Emsapcons.EmsConsAssistItem[0].Id_emp_doctor; uiEmsDTO.Emsapcons.Name_emp_doctor = uiEmsDTO.Emsapcons.EmsConsAssistItem[0].Name_emp_doctor; } this.tableDataSource.Add(uiEmsDTO.Emsapcons); }
public void SetTabCommand() { bool enable = false; this.consDo = cof.GetCons(EmsHeadDO.MedSrvDO.Id_srv); if (consDo != null && consDo.Fg_deps != null) { enable = consDo.Fg_deps.Value; } this.pageCommands = new PageCommands[] { new ctlEx.OrdPageCommand().pageCommands( "consorg", delegate { EmsItemInCons itemDO = new EmsItemInCons(); itemDO.Id_org = UserManager.getInstance().CurrentOrg.Id_org; itemDO.Name_org = UserManager.getInstance().CurrentOrg.Name; EmsHeadDO.Emsapcons.EmsConsAssistItem.Add(itemDO); }, delegate { if (assistGrid.GetFocusedRow() != null) { EmsHeadDO.Emsapcons.EmsConsAssistItem.Delete(assistGrid.GetFocusedRow().RowDataSource as EmsItemInCons, true); } }, enable && !IsReadOnly) }; this.xapFormControl.SetupCommands(this.pageCommands); }