Exemple #1
0
        private void tzdTree_slt(object sender, RoutedEventArgs e) //待处理的文档事件
        {
            TreeViewItem tvi = new TreeViewItem();

            tvi = e.OriginalSource as TreeViewItem;
            mTreeInfo  tinf    = tvi.Tag as mTreeInfo;
            List <TZD> listTzd = tinf.listTzd as List <TZD>;

            if (listTzd != null)
            {
                tzdContent.FontSize = 16;
                if (tinf.flag == 3)
                {
                    var tzd = listTzd.First();
                    int count;

                    myFuc.tzdPageList     = null;
                    TzdPageNext.IsEnabled = false;
                    TzdPagePre.IsEnabled  = false;

                    myFuc.tzdPageList = myFuc.Tzd2List(tzd.记录);


                    tzdContent.Document.Blocks.Clear();

                    count = myFuc.tzdPageList.Count();

                    tzddocZn.Text   = tzd.站名 + "信号工区";
                    tzddocDate.Text = tzd.派单日期.Value.ToString("yyyy年M月d日");
                    tzddoccz.Text   = tzd.站名;
                    tzddocUnit.Text = tzd.受理单位;

                    string[] FirstPage = myFuc.tzdPageList.ToArray();
                    string   addText   = string.Empty;
                    string   addtext1  = string.Empty;
                    if (count > myFuc.Itsum)
                    {
                        TzdPageNext.IsEnabled = true;
                        TzdPagePre.IsEnabled  = true;
                    }

                    for (int i = 0; i < FirstPage.Count(); i++)
                    {
                        addText  = addText + FirstPage[i];
                        addtext1 = addtext1 + FirstPage[i];
                    }
                    tzdContent.AppendText(addText);
                    Tcontent = addtext1;
                }
            }
        }
Exemple #2
0
        private void tzdTreeExp(object sender, RoutedEventArgs e) //树形界面展开事件处理....
        {
            TreeViewItem item = (TreeViewItem)e.OriginalSource;

            item.Items.Clear();
            mTreeInfo nodeInfo = item.Tag as mTreeInfo;

            if (nodeInfo == null)
            {
                return;
            }
            switch (nodeInfo.flag)
            {
            case 1:     //日期
                var x = (from a in nodeInfo.listTzd where a.派单日期.Value.ToString("yyyy-M-d") == nodeInfo.Info select a.站名).Distinct();
                foreach (var zn in x)
                {
                    List <TZD>   znTzds = (from mmm in nodeInfo.listTzd where mmm.站名 == zn select mmm).ToList();
                    TreeViewItem znitem = new TreeViewItem();
                    znitem.Tag = new mTreeInfo {
                        flag = 2, Info = zn, listTzd = znTzds
                    };
                    znitem.Header = zn.ToString();
                    znitem.Items.Add("*");
                    item.Items.Add(znitem);
                }


                break;

            case 2:     //站名
                var y = (from b in nodeInfo.listTzd where b.站名 == nodeInfo.Info select b.受理单位).Distinct();
                foreach (var un in y)
                {
                    List <TZD>   unTzds = (from u in nodeInfo.listTzd where u.受理单位 == un select u).ToList();
                    TreeViewItem unItem = new TreeViewItem();
                    unItem.Tag = new mTreeInfo {
                        flag = 3, Info = un, listTzd = unTzds
                    };
                    unItem.Header = un.ToString();
                    //unItem.Items.Add("*");
                    item.Items.Add(unItem);
                }
                break;
            }
        }
Exemple #3
0
        private void pftree_slt(object sender, RoutedEventArgs e)  //待处理的文档事件
        {
            TreeViewItem tvi = new TreeViewItem();

            tvi = e.OriginalSource as TreeViewItem;
            mTreeInfo tinf   = tvi.Tag as mTreeInfo;
            List <PF> listPf = tinf.listPf as List <PF>;

            if (listPf != null)
            {
                //var lsitpf = from g in listPf select g;
                docPfdataGrid.FontSize    = 16;
                docPfdataGrid.ItemsSource = listPf;

                if (tinf.flag == 3)
                {
                    var zn = (from g in listPf select g.站名).First();
                    var dt = (from g in listPf select g.派发日期).First();

                    doc_zz_tabHeader.Text =
                        string.Format("        {0},经对{1}站结合部设备问题收集,存在下列问题,计划下周整治,请按计划时间准备人力、料具到现场共同配合", dt.Value.ToString("yyyy年M月d日"), zn);
                }
            }
        }