/// <summary> /// 索引改变事件 /// </summary> /// <param name="sender">控件对象</param> /// <param name="e">事件参数</param> private void cmbExecStoreRoom_SelectedIndexChanged(object sender, EventArgs e) { int deptid = Convert.ToInt32(cmbExecStoreRoom.SelectedValue); PresTemplateDbHelper presHelper = new Controller.PresTemplateDbHelper(deptid); WestPresControl.InitDbHelper(presHelper); }
/// <summary> /// 窗体打开前事件 /// </summary> /// <param name="sender">控件对象</param> /// <param name="e">事件参数</param> private void FrmPresTemplate_OpenWindowBefore(object sender, EventArgs e) { TemplateName.Text = string.Empty; MidTemplateName.Text = string.Empty; //树控件初始化 advWestDrugLevel.SelectedNode = ndPeople; GetPresTemplate(2, 0, treWestDrug); cmbExecStoreRoom.SelectedIndexChanged -= new EventHandler(cmbExecStoreRoom_SelectedIndexChanged); cbbMidDrugRoom.SelectedIndexChanged -= new EventHandler(cbbMidDrugRoom_SelectedIndexChanged); //初始化药房执行科室下拉框,默认为西药处方执行科室 DataTable dt = (DataTable)InvokeController("GetDrugStoreRoom", 0); DataTable dtMidDrug = (DataTable)InvokeController("GetDrugStoreRoom", 1); BindDrugStoreRoom(dt, dtMidDrug); //初始化系统参数 InvokeController("GetSystemParameter"); //初始化处方控件 int presCount = Convert.ToInt32(InvokeController("GetPresCount")); int deptid = Convert.ToInt32(cmbExecStoreRoom.SelectedValue); int midDrugDeptid = Convert.ToInt32(cbbMidDrugRoom.SelectedValue); PresTemplateDbHelper presHelper = new Controller.PresTemplateDbHelper(deptid); WestPresControl.InitDbHelper(presHelper); WestPresControl.PresCount = presCount; WestPresControl.IsShowFootText = false; WestPresControl.Enabled = false; PresTemplateDbHelper midPresHelper = new Controller.PresTemplateDbHelper(midDrugDeptid); MidDrugPresControl.InitDbHelper(midPresHelper); MidDrugPresControl.IsShowFootText = false; cmbExecStoreRoom.SelectedIndexChanged += new EventHandler(cmbExecStoreRoom_SelectedIndexChanged); cbbMidDrugRoom.SelectedIndexChanged += new EventHandler(cbbMidDrugRoom_SelectedIndexChanged); }