void OrderTemplateListView_Checkchanged(OrderRender render, bool flag)
 {
     if (render.Check)
     {
         if (!render.IsParent && render.ParentOrderRender != null && !render.ParentOrderRender.Check)
         {
             if (!SelectOrder.ContainsKey(render.ParentOrderRender.Id))
             {
                 this.SelectOrder.Add(render.ParentOrderRender.Id, render.ParentOrderRender);
             }
         }
     }
     else
     {
         if (!render.IsParent && render.ParentOrderRender != null)
         {
             if (SelectOrder.ContainsKey(render.ParentOrderRender.Id))
             {
                 SelectOrder.Remove(render.ParentOrderRender.Id);
             }
             foreach (OrderRender irender in render.ParentOrderRender.OrderRenderList)
             {
                 if (irender.Check)
                 {
                     if (!SelectOrder.ContainsKey(render.ParentOrderRender.Id))
                     {
                         SelectOrder.Add(render.ParentOrderRender.Id, render.ParentOrderRender);
                         break;
                     }
                 }
             }
         }
     }
 }
        protected override void ThreadRender_Checkchanged(OrderRender render, bool flag)
        {
            base.ThreadRender_Checkchanged(render, flag);
            if (this.ownerView != null && render.ObjDo is MedSrvDO)
            {
                List <EmsCreatedParameter> paramList = new List <EmsCreatedParameter>();
                paramList.Add(new EmsCreatedParameter(render.ObjDo as MedSrvDO, null));

                AssToolEx.SentMessage(this.ownerView, EventCodeType.EVENT_EMS_CREATE, EmsCreatedParameter.TAGKEYLIST, paramList);
            }
        }
 private void OrderTemplateListView_Checkchanged(OrderRender render, bool flag)
 {
     if (!render.IsParent)
     {
         if (render.Check && !SelectOrderDic.ContainsKey(render.Id))
         {
             this.SelectOrderDic.Add(render.Id, render);
         }
         else if (!render.Check && SelectOrderDic.ContainsKey(render.Id))
         {
             this.SelectOrderDic.Remove(render.Id);
         }
     }
 }
 void ThreadRender_Checkchanged(OrderRender render, bool flag)
 {
     if (render.IsParent)
     {
         if (render.Check && !SelectOrder.ContainsKey(render.Id))
         {
             this.SelectOrder.Add(render.Id, render);
         }
         else if (!render.Check && SelectOrder.ContainsKey(render.Id))
         {
             this.SelectOrder.Remove(render.Id);
         }
     }
 }
        void ThreadRender_Checkchanged(OrderRender render, bool flag)
        {
            if (!render.IsParent)
            {
                if (render.Check && !SelectOrderDic.ContainsKey(render.Id))
                {
                    this.SelectOrderDic.Add(render.Id, render);
                }
                else if (!render.Check && SelectOrderDic.ContainsKey(render.Id))
                {
                    this.SelectOrderDic.Remove(render.Id);
                }
            }
            //else
            //{
            //    if (render.OrderRenderList != null && render.OrderRenderList.Count > 0)
            //    {
            //        if (render.Check)
            //        {

            //            foreach (OrderRender irender in render.OrderRenderList)
            //            {
            //                if (!SelectOrderDic.ContainsKey(irender.Id))
            //                {

            //                         SelectOrderDic.Add(irender.Id, irender);


            //                }
            //            }
            //        }
            //        else
            //        {
            //            foreach (OrderRender irender in render.OrderRenderList)
            //            {
            //                if (SelectOrderDic.ContainsKey(irender.Id))
            //                {
            //                    SelectOrderDic.Remove(irender.Id);
            //                    break;
            //                }
            //            }
            //        }
            //    }
            //}
        }
示例#6
0
 protected virtual void ThreadRender_Checkchanged(OrderRender render, bool flag)
 {
     foreach (string Id_srv in this.OrderRenderlist.Keys)
     {
         if (OrderRenderlist[Id_srv] == render)
         {
             OrderRenderlist[Id_srv].Check = true;
             //按钮做相应处理时,字母选中和title选中也作相应改变
             if (OrderRenderlist[Id_srv].ObjDo is MedSrvDO)
             {
                 string text = (OrderRenderlist[Id_srv].ObjDo as MedSrvDO).Pycode.Substring(0, 1);
                 if (this.topAlphabetRenderGroup.AlphabetRenderDict != null)
                 {
                     foreach (string alphabetText in this.topAlphabetRenderGroup.AlphabetRenderDict.Keys)
                     {
                         if (alphabetText == text)
                         {
                             this.topAlphabetRenderGroup.AlphabetRenderDict[alphabetText].IsSelected = true;
                         }
                         else
                         {
                             this.topAlphabetRenderGroup.AlphabetRenderDict[alphabetText].IsSelected = false;
                         }
                     }
                     this.topAlphabetRenderGroup.Invalidate();
                 }
                 this.ContainerControl.Invalidate();
             }
             this.Id_srv = Id_srv;
         }
         else
         {
             OrderRenderlist[Id_srv].CancelChecked -= new OrderRender.CheckValuechanged(ThreadRender_CancelChecked);
             OrderRenderlist[Id_srv].Checkchanged  -= new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
             OrderRenderlist[Id_srv].Check          = false;
             OrderRenderlist[Id_srv].CancelChecked += new OrderRender.CheckValuechanged(ThreadRender_CancelChecked);
             OrderRenderlist[Id_srv].Checkchanged  += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
         }
     }
 }
示例#7
0
 protected void ThreadRender_CancelChecked(OrderRender render, bool flag)
 {
     this.Id_srv = string.Empty;
 }
示例#8
0
        protected virtual OrderRender createOrderRender()
        {
            OrderRender ThreadRender = new OrderRender(this, true);

            return(ThreadRender);
        }
示例#9
0
        private void FillData(AlphabetRender render)
        {
            string alphaText = render.Text;

            this.MaxStartX = 0;
            this.ContainerControl.hScroll.Value = 0;
            this.ContainerControl.RemoveRenderAll();
            this.ContainerControl.getScrollBarRect();
            this.ContainerControl.Invalidate();
            this.OrderRenderlist.Clear();
            if (this.alphabetDict != null && this.alphabetDict.ContainsKey(alphaText))
            {
                List <MedSrvDO> data   = this.alphabetDict[alphaText];
                int             startX = 1;
                int             startY = 10;
                OrderRender     TMP    = null;
                if (data.Count > 0)
                {
                    this.MaxStartX = 0;
                    //添加标题栏
                    OrderTitleRender orderTitleRender = new OrderTitleRender();
                    if (alphaText == "OTHER")
                    {
                        orderTitleRender.Text = "其他";
                    }
                    else
                    {
                        orderTitleRender.Text = alphaText;
                    }
                    orderTitleRender.Size     = new Size(216, 24);
                    orderTitleRender.Location = new Point(startX, startY);
                    startY += orderTitleRender.Size.Height;
                    if (this.MaxStartX <= startX)
                    {
                        this.MaxStartX = startX;
                    }
                    this.ContainerControl.AddRender(orderTitleRender);
                    for (int i = 0; i < data.Count; i++)
                    {
                        OrderRender ThreadRender = createOrderRender();
                        ThreadRender.Checkchanged  += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                        ThreadRender.CancelChecked += new OrderRender.CheckValuechanged(ThreadRender_CancelChecked);
                        ThreadRender.ObjDo          = data[i];
                        ThreadRender.Size           = new Size(216, 24);
                        if (TMP != null && startY + ThreadRender.Size.Height > this.ContainerControl.Size.Height - 5)
                        {
                            startX = TMP.Bound.Right;
                            startY = 10;
                        }
                        ThreadRender.Location = new Point(startX, startY);
                        startY += ThreadRender.Size.Height;
                        if (this.MaxStartX <= startX)
                        {
                            this.MaxStartX = startX;
                        }
                        this.OrderRenderlist.Add(data[i].Id_srv, ThreadRender);
                        this.ContainerControl.AddRender(ThreadRender);
                        TMP = ThreadRender;
                        // 判断是否包含不可用的服务,如果存在,禁用服务
                        if (this.model.SrvStatusMap.Keys.Contains(data[i].Id_srv))
                        {
                            ThreadRender.Enabled     = false;
                            ThreadRender.ForeColor   = Color.Red;
                            ThreadRender.TooltipText = this.model.SrvStatusMap[data[i].Id_srv] as string;
                        }
                    }
                }
                this.ContainerControl.getScrollBarRect();
                this.ContainerControl.Invalidate();
            }
        }
        /// <summary>
        /// CreateView执行完毕后,用LoadData的数据填充界面
        /// </summary>
        protected override void OnFillData()
        {
            NewOrderTemplateDTO[] data = this.model.newOrderTemplate;
            int startX = 0;
            int startY = 10;

            this.Container.RemoveRenderAll();
            this.Nulldata = true;
            // {{不跨页选择项目
            this.OrderRenderList.Clear();
            this.OrTplDodic.Clear();
            this.SelectOrderDic.Clear();
            // }}
            OrderRender TMP = new OrderRender(this);

            if (data != null)
            {
                if (data.Length > 0)
                {
                    //首先先要判断进来的数据类型是否是草药类型,然后根据类型创建当前view的显示方式
                    this.isHerb = data[0].Templatetype.Value;
                    ResetControl(this.isHerb, data[0]);
                }
                else
                {
                    this.isHerb = false;
                    ResetControl(this.isHerb, null);
                }
                foreach (NewOrderTemplateDTO tpl in data)
                {
                    this.MaxStartX = 0;
                    this.Nulldata  = false;
                    if (tpl.Ui_flag == "2" || tpl.Ui_flag == "1" || tpl.Ui_flag == "5")
                    {
                        OrderRender ThreadRender = new OrderRender(this.Container);
                        ThreadRender.Size     = new Size(280, 24);
                        ThreadRender.IsParent = true;
                        ThreadRender.ListDo   = tpl.Itemlist.ToArray();
                        this.SetOrTplDodic(tpl.Itemlist.ToArray());
                        ThreadRender.ObjDo         = tpl;
                        ThreadRender.Id            = tpl.Id;
                        ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                        if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                        {
                            startX = TMP.Bound.Right;
                            startY = 10;// TMP.Bound.Bottom;
                        }
                        ThreadRender.Location = new Point(startX, startY);
                        startY += ThreadRender.Size.Height + 6;
                        if (this.MaxStartX <= startX)
                        {
                            this.MaxStartX = startX;
                        }
                        this.Container.AddRender(ThreadRender);
                        this.OrderRenderList.Add(ThreadRender);
                        if (ThreadRender.OrderRenderList != null && ThreadRender.OrderRenderList.Count > 0)
                        {
                            foreach (OrderRender render in ThreadRender.OrderRenderList)
                            {
                                render.Checkchanged += new OrderRender.CheckValuechanged(OrderTemplateListView_Checkchanged);
                            }
                        }
                        TMP = ThreadRender;
                    }
                    if (tpl.Ui_flag == "3")
                    {
                        //if (!OrTplDodic.ContainsKey(tpl.Id))
                        //{
                        //    OrTplDodic.Add(tpl.Id, tpl);
                        //}
                        OrderRender ThreadRender = new OrderRender(this.Container);
                        ThreadRender.Size     = new Size(280, 24);
                        ThreadRender.IsParent = true;
                        ThreadRender.ListDo   = tpl.Itemlist.ToArray();
                        this.SetOrTplDodic(tpl.Itemlist.ToArray());
                        ThreadRender.ObjDo = tpl;
                        //ThreadRender.Id = tpl.Id;
                        ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                        if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                        {
                            startX = TMP.Bound.Right;
                            startY = 10;// TMP.Bound.Bottom;
                        }
                        ThreadRender.Location = new Point(startX, startY);
                        startY += ThreadRender.Size.Height + 6;
                        if (this.MaxStartX <= startX)
                        {
                            this.MaxStartX = startX;
                        }
                        this.Container.AddRender(ThreadRender);
                        this.OrderRenderList.Add(ThreadRender);
                        if (ThreadRender.OrderRenderList != null && ThreadRender.OrderRenderList.Count > 0)
                        {
                            foreach (OrderRender render in ThreadRender.OrderRenderList)
                            {
                                render.Checkchanged += new OrderRender.CheckValuechanged(OrderTemplateListView_Checkchanged);
                            }
                        }
                        TMP = ThreadRender;
                    }
                    if (tpl.Ui_flag == "4" || tpl.Ui_flag == "6")
                    {
                        //if (!OrTplDodic.ContainsKey(tpl.Id))
                        //{
                        //    OrTplDodic.Add(tpl.Id, tpl);
                        //}
                        OrderRender ThreadRender = new OrderRender(this.Container);
                        ThreadRender.Size   = new Size(280, 24);
                        ThreadRender.ListDo = tpl.Itemlist.ToArray();
                        ThreadRender.ObjDo  = tpl;
                        this.SetOrTplDodic(tpl.Itemlist.ToArray());
                        //ThreadRender.Id = tpl.Id;
                        ThreadRender.Note          = tpl.Str;
                        ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                        if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                        {
                            startX = TMP.Bound.Right;
                            startY = 10;// TMP.Bound.Bottom;
                        }
                        ThreadRender.Location = new Point(startX, startY);
                        startY += ThreadRender.Size.Height + 6;
                        if (this.MaxStartX <= startX)
                        {
                            this.MaxStartX = startX;
                        }
                        this.Container.AddRender(ThreadRender);
                        this.OrderRenderList.Add(ThreadRender);
                        TMP = ThreadRender;
                    }
                }
            }
            else
            {
                this.isHerb = false;
                ResetControl(this.isHerb, null);
            }
            if (this.Container.Size.Width <= TMP.Bound.Right)
            {
                this.Container.Size = new Size(TMP.Bound.Right, ContainerControl.Size.Height);
            }
            this.Container.Invalidate();
            this.ContainerControl.getScrollBarRect();
        }
示例#11
0
        /// <summary>
        /// CreateView执行完毕后,用LoadData的数据填充界面
        /// </summary>
        protected override void OnFillData()
        {
            XapDataList <SrvortplitemAggDO> data = this.model.SrvortplitemAggDOList;
            int startX = 0;
            int startY = 10;

            this.Container.RemoveRenderAll();
            this.Nulldata = true;
            this.OrTplDodic.Clear();
            OrderRender TMP = new OrderRender(this);

            foreach (SrvortplitemAggDO tpl in data)
            {
                //if(tpl.ParentDO)
                this.MaxStartX = 0;
                this.Nulldata  = false;
                if (tpl.getParentDO().Ui_flag == "2" || tpl.getParentDO().Ui_flag == "1")
                {
                    if (!OrTplDodic.ContainsKey(tpl.getParentDO().Id_srv))
                    {
                        OrTplDodic.Add(tpl.getParentDO().Id_srv, tpl);
                    }
                    OrderRender ThreadRender = new OrderRender(this);
                    ThreadRender.IsParent      = true;
                    ThreadRender.ListDo        = tpl.getOrTplItmDtDO();
                    ThreadRender.ObjDo         = tpl;
                    ThreadRender.Id            = tpl.getParentDO().Id_srv;
                    ThreadRender.Size          = new Size(280, 24);
                    ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                    if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                    {
                        startX = TMP.Bound.Right;
                        startY = 10;// TMP.Bound.Bottom;
                    }
                    ThreadRender.Location = new Point(startX, startY);
                    startY += ThreadRender.Size.Height + 6;
                    if (this.MaxStartX <= startX)
                    {
                        this.MaxStartX = startX;
                    }
                    this.Container.AddRender(ThreadRender);
                    if (ThreadRender.OrderRenderList != null && ThreadRender.OrderRenderList.Count > 0)
                    {
                        foreach (OrderRender render in ThreadRender.OrderRenderList)
                        {
                            render.Checkchanged += new OrderRender.CheckValuechanged(OrderTemplateListView_Checkchanged);
                        }
                    }
                    TMP = ThreadRender;
                }
                if (tpl.getParentDO().Ui_flag == "3")
                {
                    //OrderRender ThreadRender = new OrderRender();
                    //ThreadRender.IsParent = true;
                    //ThreadRender.ListDo = tpl.ChildrenList;
                    //ThreadRender.Size = new Size(223, 24);
                    //if (startX + ThreadRender.Size.Width > this.Size.Width)
                    //{
                    //    startX = 0;
                    //    // startY = ThreadRender.LastBottm;
                    //}
                    //ThreadRender.Location = new Point(startX, startY);
                    //startX += ThreadRender.Size.Width;
                    //if (this.MaxStartX <= startX)
                    //{
                    //    this.MaxStartX = startX;
                    //}
                    //this.Container.AddRender(ThreadRender);
                    //TMP = ThreadRender;

                    if (!OrTplDodic.ContainsKey(tpl.getParentDO().Id_srv))
                    {
                        OrTplDodic.Add(tpl.getParentDO().Id_srv, tpl);
                    }
                    OrderRender ThreadRender = new OrderRender(this);
                    ThreadRender.IsParent      = true;
                    ThreadRender.ListDo        = tpl.getOrTplItmDtDO();
                    ThreadRender.ObjDo         = tpl;
                    ThreadRender.Id            = tpl.getParentDO().Id_srv;
                    ThreadRender.Size          = new Size(280, 24);
                    ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                    if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                    {
                        startX = TMP.Bound.Right;
                        startY = 10;// TMP.Bound.Bottom;
                    }
                    ThreadRender.Location = new Point(startX, startY);
                    startY += ThreadRender.Size.Height + 6;
                    if (this.MaxStartX <= startX)
                    {
                        this.MaxStartX = startX;
                    }
                    this.Container.AddRender(ThreadRender);
                    if (ThreadRender.OrderRenderList != null && ThreadRender.OrderRenderList.Count > 0)
                    {
                        foreach (OrderRender render in ThreadRender.OrderRenderList)
                        {
                            render.Checkchanged += new OrderRender.CheckValuechanged(OrderTemplateListView_Checkchanged);
                        }
                    }
                    TMP = ThreadRender;
                }
                if (tpl.getParentDO().Ui_flag == "4")
                {
                    if (!OrTplDodic.ContainsKey(tpl.getParentDO().Id_srv))
                    {
                        OrTplDodic.Add(tpl.getParentDO().Id_srv, tpl);
                    }
                    OrderRender ThreadRender = new OrderRender(this);
                    ThreadRender.ObjDo         = tpl;
                    ThreadRender.Id            = tpl.getParentDO().Id_srv;
                    ThreadRender.Size          = new Size(280, 24);
                    ThreadRender.Checkchanged += new OrderRender.CheckValuechanged(ThreadRender_Checkchanged);
                    if (startY + ThreadRender.Size.Height > this.Container.Size.Height)
                    {
                        startX = TMP.Bound.Right;
                        startY = 10;// TMP.Bound.Bottom;
                    }
                    ThreadRender.Location = new Point(startX, startY);
                    startY += ThreadRender.Size.Height + 6;
                    if (this.MaxStartX <= startX)
                    {
                        this.MaxStartX = startX;
                    }
                    this.Container.AddRender(ThreadRender);
                    TMP = ThreadRender;
                }
            }
            if (this.Container.Size.Width <= TMP.Bound.Right)
            {
                this.Container.Size = new Size(TMP.Bound.Right, ContainerControl.Size.Height);
            }
            this.Container.Invalidate();
            this.ContainerControl.getScrollBarRect();
        }
示例#12
0
        void pannel_MouseClick(object sender, MouseEventArgs e)
        {
            for (int i = 0; i < Menulist.Count; i++)
            {
                MenuRender menu = Menulist[i];
                if (menu.Bound.Contains(e.Location))
                {
                    foreach (OrderRender Ur in this.OrderRenderlist.Values)
                    {
                        this.pannel.RemoveRender(Ur);
                    }
                    this.OrderRenderlist.Clear();

                    #region 添加子菜单panel使用
                    if (menu.Contains(e.Location))
                    {
                        UnFoldMenuPanel(i);
                    }
                    #endregion
                    else
                    {
                        UpdateContentPanel(menu);
                    }
                    if (menu.IsUnfold)
                    {
                        foreach (var sub in menu.SubMenuList)
                        {
                            if (sub.Value.IsSelect)
                            {
                                foreach (OrderRender Ur in this.OrderRenderlist.Values)
                                {
                                    this.pannel.RemoveRender(Ur);
                                }
                                this.OrderRenderlist.Clear();
                                UpdateContentPanel(sub.Value);
                                Thread = Thread = this.model.getSrvOrTplItemDO(sub.Key);
                                //  Dictionary<string,string> dic=new Dictionary<string,string> ();
                                int         startX = 85;
                                int         startY = 10;
                                OrderRender TMP    = new OrderRender(this);
                                foreach (SrvOrTplItemDO tpl in Thread)
                                {
                                    Dictionary <string, string> dic = new Dictionary <string, string>();
                                    dic.Add(tpl.Id_srv, tpl.Name_srv);
                                    OrderRender ThreadRender = new OrderRender(this);
                                    // ThreadRender.Datasource = dic;
                                    ThreadRender.Size = new Size(170, 40);
                                    if (startX + ThreadRender.Size.Width > this.Size.Width)
                                    {
                                        startX = 85;
                                        startY = TMP.Bound.Bottom;
                                    }
                                    ThreadRender.Location = new Point(startX, startY);
                                    startX += ThreadRender.Size.Width + 5;
                                    this.OrderRenderlist.Add(tpl.Id_srv, ThreadRender);
                                    this.pannel.AddRender(ThreadRender);
                                    TMP = ThreadRender;
                                }
                                this.pannel.Invalidate();
                            }
                        }
                    }
                    return;
                }
                foreach (var sub in menu.SubMenuList)
                {
                    if (sub.Value.Bound.Contains(e.Location))
                    {
                        foreach (OrderRender Ur in this.OrderRenderlist.Values)
                        {
                            this.pannel.RemoveRender(Ur);
                        }
                        this.OrderRenderlist.Clear();
                        UpdateContentPanel(sub.Value);
                        Thread = Thread = this.model.getSrvOrTplItemDO(sub.Key);
                        //  Dictionary<string,string> dic=new Dictionary<string,string> ();
                        int         startX = 85;
                        int         startY = 10;
                        OrderRender TMP    = new OrderRender(this);
                        foreach (SrvOrTplItemDO tpl in Thread)
                        {
                            Dictionary <string, string> dic = new Dictionary <string, string>();
                            dic.Add(tpl.Id_srv, tpl.Name_srv);
                            OrderRender ThreadRender = new OrderRender(this);
                            // ThreadRender.Datasource = dic;
                            ThreadRender.Size = new Size(170, 40);
                            if (startX + ThreadRender.Size.Width > this.Size.Width)
                            {
                                startX = 85;
                                startY = TMP.Bound.Bottom;
                            }
                            ThreadRender.Location = new Point(startX, startY);
                            startX += ThreadRender.Size.Width + 5;
                            this.OrderRenderlist.Add(tpl.Id_srv, ThreadRender);
                            this.pannel.AddRender(ThreadRender);
                            TMP = ThreadRender;
                        }
                        this.pannel.Invalidate();
                        return;
                    }
                }
            }
        }