protected override void OnXapFormControl_FormCreated(object sender, EventArgs e) { base.OnXapFormControl_FormCreated(sender, e); endDateTiem = this.GetXapFormControl().GetUserRender("card", "dt_referralperiodend").Renders[0] as XCalendarTimerComboBox; endDateTiem.MinDate = model.MedReferralDO.Dt_open; }
/// <summary> /// 设置时间控件的最大值 /// </summary> /// <param name="xapFormControl1"></param> /// <param name="Context"></param> /// <param name="tabName"></param> /// <param name="itemkey"></param> /// <param name="datetime"></param> public void setMaxTime(XapFormControl xapFormControl1, BaseContext Context, string tabName, string itemkey, DateTime datetime) { UserRender us = xapFormControl1.GetUserRender(tabName, itemkey); if (us.Renders[0] is XCalendarTimerComboBox) { XCalendarTimerComboBox timebox = us.Renders[0] as XCalendarTimerComboBox; if (timebox != null) { if (datetime != null) { timebox.MaxDate = datetime; } else { timebox.MaxDate = null; } } } else if (us.Renders[0] is XCalendarComboBox) { XCalendarComboBox timebox = us.Renders[0] as XCalendarComboBox; if (timebox != null) { if (datetime != null) { timebox.MaxDate = datetime; } else { timebox.MaxDate = null; } } } }
void xapFormControl1_FormCreated(object sender, EventArgs e) { XTabControl tabControl = new XTabControl(); List <ControlTab> tabs = xapFormControl1.FormModel.Tabs; dic = tabs[0].Pages[0].DicUserRenders; XTabControl tab = tabs[0].tabContrl; gv = xapFormControl1.GetGridView("drug");//药品列表 gv.MouseClick += new MouseEventHandler(gv_MouseClick); UserRender btnDelete = xapFormControl1.GetUserRender("drugsUse", "btndelete");//删除 btnDelete.MouseClick += new MouseEventHandler(btnDelete_MouseClick); UserRender btnAdd = this.xapFormControl1.GetUserRender("drugsUse", "btnAdd");//新增按钮 btnAdd.MouseClick += new MouseEventHandler(btnAdd_MouseClick); UserRender ur_begin = xapFormControl1.GetUserRender("drugsUse", "dt_begin_ui"); XCalendarTimerComboBox dt_begin = ur_begin.Renders[0] as XCalendarTimerComboBox; dt_begin.MouseClick += new MouseEventHandler(dt_begin_MouseClick); UserRender ur_end = xapFormControl1.GetUserRender("drugsUse", "dt_end_ui"); XCalendarTimerComboBox dt_end = ur_end.Renders[0] as XCalendarTimerComboBox; dt_end.MouseClick += new MouseEventHandler(dt_end_MouseClick); SetGridPolicy(true); gv.DataTable.ReadOnly = false; gv.DataTable.Columns["Spec_mm"].ReadOnly = true; //gv.DataTable.Columns["Quan_med"].ReadOnly = true; //----------药品说明---------------------- XTabControl tabControl1 = tabs[0].tabContrl; XTabPage xtab = tabControl1.XTabPages[1]; tabControl1.SelectedIndexChanged += new XTabControl.selectedIndexChanged(tabControl1_SelectedIndexChanged); xtab.RemoveRenderAll(); xtab.AddRender(desView); //待歼付数 ((XNumbericUpDown)((XLabelBaseUserRender)xapFormControl1.GetUserRender("drugsUse", "orders_boil")).UserRender).MinValue = 0; ((XNumbericUpDown)((XLabelBaseUserRender)xapFormControl1.GetUserRender("drugsUse", "orders")).UserRender).MinValue = 1; //为医嘱备注绑定事件 ((XLabelBaseUserRender)xapFormControl1.GetUserRender("drugsUse", "note_or")).GotFocus += new EventHandler(OrderHerbsView_GotFocus); ((XLabelBaseUserRender)xapFormControl1.GetUserRender("drugsUse", "note_or")).LostFocus += new EventHandler(OrderHerbsView_LostFocus); xapFormControl1.GotFocus += new EventHandler(xapFormControl1_GotFocus); xapFormControl1.LostFocus += new EventHandler(xapFormControl1_LostFocus); // 注册最后一次的回车换行的操作逻辑 this.RegEnterKeyOverEvent(row => { // 新增一行 btnAdd_MouseClick(this, null); return(true); }, null); }
void dt_begin_MouseClick(object sender, MouseEventArgs e) { if (this.EmsHeadDO.Emsdrugs.Dt_begin_ui == null) { UserRender ur_begin = xapFormControl1.GetUserRender("drugsUse", "dt_begin_ui"); XCalendarTimerComboBox dt_begin = ur_begin.Renders[0] as XCalendarTimerComboBox; dt_begin.TodayDateTime = this.NowTime(); } }
private void xapFormControl_FormCreated(object sender, System.EventArgs e) { xLabTitl = this.xapFormControl.GetUserRender("entprove", "title") as XLabel; xLabTitl.ValueText = "诊断证明"; xLabAtte = this.xapFormControl.GetUserRender("entprove", "labAttention") as XLabel; diproveDateTiem = this.xapFormControl.GetUserRender("entprove", "dt_diprove").Renders[0] as XCalendarTimerComboBox; }
void xapFormControl1_ModelFilled(object sender, EventArgs e) { if (this.model.rptArray.Count() != 0 && this.model.rptArray[0].Sd_su_rpt == CiDictCodeConst.SD_SU_RPT_SIGN) { xapFormControl1.SetEditPolicy(false); } else { xapFormControl1.SetEditPolicy(true); } this.gv_invite.DataTable.DataSource = this.model.consitemList; if (this.model.rptArray.Count() != 0) { // SenMgs(this.model.rptArray[0].Sd_su_rpt); } //判断患者类型 pattp = this.model.getEntpattp(this.ent4BannerDto.Id_ent); if (pattp == "2" || pattp == "9") { this.xapFormControl1.SetEditPolicy(false); SenPattp("unity"); } else { this.xapFormControl1.SetEditPolicy(true); SenPattp("ununity"); if (this.model.rptArray.Count() > 0) { CiOrdConsRptDO conrpt = this.model.rptArray[0]; if (conrpt.Sd_su_rpt == CiDictCodeConst.SD_SU_RPT_SIGN) { this.xapFormControl1.SetEditPolicy(false); } } } UserRender us = xapFormControl1.GetUserRender("consrpt", "dt_plan"); XCalendarTimerComboBox time = us.Renders[0] as XCalendarTimerComboBox; if (time != null) { //会诊记录的最大时间暂时不限制,最小时间大于入科时间 // DateTime datetime = this.NowTime(); // time.TodayDateTime = datetime; time.MinDate = new GetInHosTime().GetPatInHosTime(this.ent4BannerDto.Id_ent); //int maxHours = Context.GetGroupParam<int>(ICiOrdNSysParamConst.SYS_PARAM_OrEarlyEntryMaxHours); //if (maxHours == null) // maxHours = 72; // time.MaxDate = datetime.AddHours(maxHours); } }
public void setMaxMinTime(XapFormControl xapFormControl1, BaseContext Context, string tabName, string itemkey, string id_ent) { UserRender us = xapFormControl1.GetUserRender(tabName, itemkey); if (us != null && us.Renders[0] is XCalendarTimerComboBox) { XCalendarTimerComboBox dt_begin = us.Renders[0] as XCalendarTimerComboBox; if (dt_begin != null) { DateTime datetime = this.NowTime(); dt_begin.TodayDateTime = datetime; dt_begin.MinDate = new GetInHosTime().GetPatInHosTime(id_ent); try { int maxHours = Context.GetGroupParam <int>(ICiOrdNSysParamConst.SYS_PARAM_OrEarlyEntryMaxHours); dt_begin.MaxDate = datetime.AddHours(maxHours); } catch //(Exception e) { this.ShowInfo("无法取得最大开立时间参数!"); } } } else if (us != null && us.Renders[0] is XCalendarComboBox) { XCalendarComboBox dt_begin = us.Renders[0] as XCalendarComboBox; if (dt_begin != null) { DateTime datetime = this.NowTime(); dt_begin.TodayDate = datetime; dt_begin.MinDate = new GetInHosTime().GetPatInHosTime(id_ent); try { int maxHours = Context.GetGroupParam <int>(ICiOrdNSysParamConst.SYS_PARAM_OrEarlyEntryMaxHours); dt_begin.MaxDate = datetime.AddHours(maxHours); } catch //(Exception e) { this.ShowInfo("无法取得最大开立时间参数!"); } } } }
private void setDateTimeLabel(string p) { XLabelBaseUserRender dt_planRender = xapFormControl.GetUserRender("opitem", "dt_plan") as XLabelBaseUserRender; XLabelBaseUserRender dt_creatRender = xapFormControl.GetUserRender("opitem", "dt_creat") as XLabelBaseUserRender; XCalendarTimerComboBox dt_planTimerComboBox = dt_planRender.UserRender as XCalendarTimerComboBox; XCalendarTimerComboBox dt_creatTimerComboBox = dt_creatRender.UserRender as XCalendarTimerComboBox; switch (p) { case "Fg_er_sug": dt_creatRender.Enabled = false; dt_planRender.Enabled = true; //EmsHeadDO.Emsapop.Dt_creat = DateTime.Now; //EmsHeadDO.Emsapop.Dt_plan = DateTime.Now; dt_planTimerComboBox.MaxDate = DateTime.Now; dt_planTimerComboBox.MinDate = DateTime.Now; break; case "Fg_xq_sug": dt_creatRender.Enabled = false; dt_planRender.Enabled = true; //EmsHeadDO.Emsapop.Dt_creat = DateTime.Now; //EmsHeadDO.Emsapop.Dt_plan = DateTime.Now; break; case "Fg_zq_sug": dt_creatRender.Enabled = true; dt_planRender.Enabled = true; string d2 = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo); dt_planTimerComboBox.MaxDate = null; dt_planTimerComboBox.MinDate = null; //EmsHeadDO.Emsapop.Dt_creat = DateTime.Now.AddDays(1); //EmsHeadDO.Emsapop.Dt_plan = DateTime.Now.AddDays(1); //DateTime dt = DateTime.Now; //设定最小时间的天数时,是day-1天 dt_creatTimerComboBox.MinDate = DateTime.Now; break; } }
private void XapFormControl_ModelFilled(object sender, EventArgs e) { SetIndicatorControl(); var opitem = EmsHeadDO.Emsapop.OpEmpItem; if (!opitem.Any(t => t.Id_role == CiDictCodeConst.ID_OP_ROLE_ZDYS)) { EmsItemInOp addnew = new EmsItemInOp { Id_role = CiDictCodeConst.ID_OP_ROLE_ZDYS, Sd_role = CiDictCodeConst.SD_OP_ROLE_ZDYS, Name_role = "主刀医师" }; opitem.Insert(0, addnew); } if (!opitem.Any(t => t.Id_role == CiDictCodeConst.ID_OP_ROLE_DYZS)) { EmsItemInOp addnew = new EmsItemInOp { Id_role = CiDictCodeConst.ID_OP_ROLE_DYZS, Sd_role = CiDictCodeConst.SD_OP_ROLE_DYZS, Name_role = "第一助手" }; opitem.Insert(1, addnew); } //人员 gv_emp.DataTable.DataSource = EmsHeadDO.Emsapop.OpEmpItem; //卫材 gv_mm.DataTable.DataSource = EmsHeadDO.Emsapop.OpMmItem; //附加手术 gv_oper.DataTable.DataSource = EmsHeadDO.Emsapop.OpAppendOpItem; XLabelBaseUserRender dt_planRender = xapFormControl.GetUserRender("opitem", "dt_plan") as XLabelBaseUserRender; dt_planRender.Focus(); XCalendarTimerComboBox dt_planTimerComboBox = dt_planRender.UserRender as XCalendarTimerComboBox; //dt_planTimerComboBox.MaxDate = DateTime.Now.AddDays(-1); dt_planTimerComboBox.MinDate = EmsHeadDO.Emsapop.Dt_creat; if (EmsHeadDO.IsNEW || this.CiEmsDTO.Sd_su_or == null || this.CiEmsDTO.Sd_su_or == "0") { //计划手术时间大于申请时间即可 //if (EmsHeadDO.Emsapop.Fg_er_sug != null && EmsHeadDO.Emsapop.Fg_er_sug == true) //{ // setDateTimeLabel("Fg_er_sug"); //} //else if (EmsHeadDO.Emsapop.Fg_zq_sug != null && EmsHeadDO.Emsapop.Fg_zq_sug == true) //{ // setDateTimeLabel("Fg_zq_sug"); //} //else if (EmsHeadDO.Emsapop.Fg_xq_sug != null && EmsHeadDO.Emsapop.Fg_xq_sug == true) //{ // setDateTimeLabel("Fg_xq_sug"); //} SetGridPolicy(true); } else { indicatorControl.Enabled = false; xapFormControl.SetEditPolicy(false); SetGridPolicy(false); } (xapFormControl.GetUserRender("opitem", "name_diag") as XLabelBaseUserRender).Focus(); //限制开始时间的时间范围,入院日期,最大提前日期 TimerComboBoxMaxAndMin.GetInstance().setMaxMinTime(xapFormControl, this.Context, "opitem", "dt_plan", EmsHeadDO.PatInfo.Id_ent); TimerComboBoxMaxAndMin.GetInstance().setMinTime(xapFormControl, this.Context, "opitem", "dt_plan", EmsHeadDO.Emsapop.Dt_creat); if (this.pageCommands != null) { foreach (PageCommands pageCommands in this.pageCommands) { foreach (XapCommand conmmands in pageCommands.Commands) { conmmands.Visible = !IsReadOnly; } } } }