Ejemplo n.º 1
0
        public override void OnCellClick(RptCellArgs p_args)
        {
            var row = p_args.Data;

            if (p_args.Row == 0 && p_args.Col == 1)
            {
                if (p_args.Text != "根菜单")
                {
                    OnBack(null, null);
                }
            }
            else if (p_args.Col == 1)
            {
                if (row.Bool("isgroup"))
                {
                    var info = new MyRptInfo {
                        Name = "脚本", Params = new Dict {
                            { "parentid", row.Str("id") }, { "parentname", row.Str("name") }
                        }
                    };
                    var ls = View.Tag as Stack <RptInfo>;
                    if (ls == null)
                    {
                        ls       = new Stack <RptInfo>();
                        View.Tag = ls;
                    }
                    ls.Push(View.Info);
                    View.LoadReport(info);
                }
                else
                {
                    Dlg dlg = new Dlg();
                    var pnl = new StackPanel
                    {
                        Children =
                        {
                            new TextBlock {
                                Text = "id:" + row.Str("id")
                            },
                            new TextBlock {
                                Text = "parentid:" + row.Str("parentid")
                            },
                            new TextBlock {
                                Text = "name:" + row.Str("name")
                            },
                            new TextBlock {
                                Text = "isgroup:" + row.Str("isgroup")
                            },
                        },
                        Margin = new Thickness(20),
                    };
                    dlg.Content = pnl;
                    dlg.Show();
                }
            }
            else if (p_args.Col == 2)
            {
                Kit.Msg(row.Bool("isgroup") ? "分组菜单" : "实体菜单");
            }
        }
Ejemplo n.º 2
0
 public override void RenderCell(Cells.Data.Cell p_cell, RptCellArgs p_args)
 {
     if (p_args.Col == 1)
     {
         string name = View.Info.Params.Str("parentname");
         if (name == "根菜单")
         {
             p_cell.Value      = name;
             p_cell.Foreground = Res.BlackBrush;
         }
         else
         {
             p_cell.Value = "<- " + name;
         }
     }
     else if (p_args.Col == 2)
     {
         if (p_args.Data.Bool("isgroup"))
         {
             p_cell.Value      = "V";
             p_cell.Foreground = Res.GreenBrush;
         }
         else
         {
             p_cell.Value      = "X";
             p_cell.Foreground = Res.RedBrush;
         }
     }
 }