private void xapFormControl1_FormCreated(object sender, EventArgs e) { EmsHeadDO.Emsdrugs.Fg_treat = true;//默认为治疗用药 XTabControl tabControl = new XTabControl(); List <ControlTab> tabs = xapFormControl1.FormModel.Tabs; dic = tabs[0].Pages[0].DicUserRenders; gv = xapFormControl1.GetGridView("drug");//药品列表 gv.MouseClick += new MouseEventHandler(gv_MouseClick); gv.DataTable.DataDisplay += new EventHandler <XDataDisplayEventArgs>(xapFormControl1_DataDisplay); //gv.DataTable.CellValueChanged += new CellValueChangedEventHandler(cellValueChanged); SetGridPolicy(true); gv.ReadOnly = false; gv.DataTable.ReadOnly = false; XTabControl tabControl1 = tabs[0].tabContrl; XTabPage xtab = tabControl1.XTabPages[1]; tabControl1.SelectedIndexChanged += new XTabControl.selectedIndexChanged(tabControl1_SelectedIndexChanged); xtab.Controls.Clear(); xtab.Controls.Add(desView); // 关联总量单元格编辑控件 AttachQuanCurEditor(); cof.getControlByName(xapFormControl1, "drugsUse", "note_or").GotFocus += new EventHandler(Note_or_GotFocus); cof.getControlByName(xapFormControl1, "drugsUse", "note_or").LostFocus += new EventHandler(Note_or_LostFocus); }
private void initData(string id_hp = null) { HPSrvorcaDO hp = viewModel.getHpSrvOrCaDO(id_hp, this.drug.Id_srv); string sdhp = ""; string des = ""; string str = ""; if (hp != null) { sdhp = hp.Sd_hpsrvtp; des = hp.Des; str = ""; if (!string.IsNullOrEmpty(sdhp)) { str += hp.Hpsrvtp_name; } if (!string.IsNullOrEmpty(des)) { if (string.IsNullOrEmpty(str)) { str += des; } else { str += ",\r\n" + des; } } lincStr = str; } bool Fg_anti = this.drug.Fg_anti == null ? false : this.drug.Fg_anti.Value; flag = "0"; //抗生素 if (Fg_anti) { //是抗生素的药 if (hp != null) { flag = "0"; //存在医保计划,拼接字符串 cof.getControlByName(this.xapFormControl, "fg_propc", "lincText").ValueText = str; } else { flag = "1"; (this.xapFormControl.GetUserRender("fg_propc", "linc") as XLabel).Visible = false; cof.getControlByName(this.xapFormControl, "fg_propc", "lincText").Visible = false; cof.getControlByName(this.xapFormControl, "fg_propc", "fg_treat").Visible = false; } } else { //(this.xapFormControl.GetUserRender("fg_propc", "propc") as XLabel).Visible = false; cof.getControlByName(this.xapFormControl, "fg_propc", "fg_propc").Visible = false; if (hp != null) { flag = "2"; cof.getControlByName(this.xapFormControl, "fg_propc", "lincText").ValueText = str; } else { flag = "3"; (this.xapFormControl.GetUserRender("fg_propc", "linc") as XLabel).Visible = false; cof.getControlByName(this.xapFormControl, "fg_propc", "lincText").Visible = false; cof.getControlByName(this.xapFormControl, "fg_propc", "fg_treat").Visible = false; } } }