Esempio n. 1
0
 public void ClearRow(int i)
 {
     AdvancedDataGridView.TreeGridNode node = this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode;
     if (node.IsExpanded)
     {
         node.Collapse();
     }
     node.populated   = false;
     node.IsExpanded  = false;
     node.InExpanding = false;
     node.HasChildren = false;
     node._grid       = null;
     node.Nodes.Clear();
     this.watchList.InvalidateRow(i);
 }
Esempio n. 2
0
 private void InputGrid()
 {
     if (DatatreeGrid.InvokeRequired)
     {
         ShowDataHandle sdh = new ShowDataHandle(InputGrid);
         this.Invoke(sdh, new object[] { });
     }
     else
     {
         DatatreeGrid.Nodes.Clear();
         int i = int.Parse(ll[0][0]);//最上级节点
         AdvancedDataGridView.TreeGridNode node = DatatreeGrid.Nodes.Add("信源数据包", "");
         foreach (string[] str in ll)
         {
             int j = int.Parse(str[0]);
             if (j > i)
             {
                 node = node.Nodes.Add(str[1], str[2], str[3]);
             }
             else
             {
                 if (i == j)
                 {
                     node = node.Parent.Nodes.Add(str[1], str[2], str[3]);
                 }
                 if (i == j + 1)
                 {
                     node = node.Parent.Parent.Nodes.Add(str[1], str[2], str[3]);
                 }
                 if (i == j + 2)
                 {
                     node = node.Parent.Parent.Parent.Nodes.Add(str[1], str[2], str[3]);
                 }
                 if (i == j + 3)
                 {
                     node = node.Parent.Parent.Parent.Parent.Nodes.Add(str[1], str[2], str[3]);
                 }
                 if (i == j + 4)
                 {
                     node = node.Parent.Parent.Parent.Parent.Parent.Nodes.Add(str[1], str[2], str[3]);
                 }
             }
             i = j;
         }
     }
 }
Esempio n. 3
0
        private void LoadData()
        {
            ArrayList al = DBLayer.AbonementIncome.MoneyReport(Date1, Date2);

            this.Al = al;

            double total = 0;

            double abonements = 0;
            double goods      = 0;
            double services   = 0;
            double charges    = 0;

            tvdgCharges.Nodes.Clear();
            tvdgAbonements.Nodes.Clear();
            tvdgGoods.Nodes.Clear();
            tvdgServices.Nodes.Clear();

            for (int i = 0; i < al.Count; i++)
            {
                DBLayer.AbonementIncome.Money_ReportDetails det = (DBLayer.AbonementIncome.Money_ReportDetails)al[i];

                total += det.Summ;

                switch (det.Type)
                {
                case 0:

                    abonements += det.Summ;

                    bool   abonAdd  = true;
                    string abonName = det.AbonementName;


                    for (int j = 0; j < tvdgAbonements.Nodes.Count; j++)
                    {
                        //abons.Add(det);
                        if (det.AbonementName == tvdgAbonements.Nodes[j].Cells["colNameAbon"].Value.ToString())
                        {
                            abonAdd = false;
                        }
                        else
                        {
                            abonName = det.AbonementName;
                        }
                    }

                    if (abonAdd)
                    {
                        double    summ  = 0;
                        ArrayList abons = new ArrayList();

                        for (int k = 0; k < al.Count; k++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detAb = (DBLayer.AbonementIncome.Money_ReportDetails)al[k];

                            if (detAb.AbonementName == abonName)
                            {
                                abons.Add(detAb);

                                summ += det.Summ;
                            }
                        }
                        AdvancedDataGridView.TreeGridNode node = tvdgAbonements.Nodes.Add(det.AbonementName, summ);

                        for (int x = 0; x < abons.Count; x++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detAbX = (DBLayer.AbonementIncome.Money_ReportDetails)abons[x];

                            node.Nodes.Add(detAbX.Name, det.Summ);
                        }
                    }


                    break;

                case 1:
                    goods += det.Summ;



                    bool   goodAdd  = true;
                    string goodName = det.AbonementName;


                    for (int j = 0; j < tvdgGoods.Nodes.Count; j++)
                    {
                        //abons.Add(det);
                        if (det.AbonementName == tvdgGoods.Nodes[j].Cells["colNameGood"].Value.ToString())
                        {
                            goodAdd = false;
                        }
                        else
                        {
                            goodName = det.AbonementName;
                        }
                    }

                    if (goodAdd)
                    {
                        double    summ    = 0;
                        ArrayList goodsAL = new ArrayList();

                        for (int k = 0; k < al.Count; k++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detG = (DBLayer.AbonementIncome.Money_ReportDetails)al[k];

                            if (detG.AbonementName == goodName)
                            {
                                goodsAL.Add(detG);

                                summ += detG.Summ;
                            }
                        }
                        AdvancedDataGridView.TreeGridNode node = tvdgGoods.Nodes.Add(det.AbonementName, summ);

                        for (int x = 0; x < goodsAL.Count; x++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detGX = (DBLayer.AbonementIncome.Money_ReportDetails)goodsAL[x];

                            node.Nodes.Add(detGX.Date.ToString("dd-MMM-yyyy") + "/" + detGX.Quantity.ToString(), detGX.Summ);
                        }
                    }
                    break;

                case 2:
                    services += det.Summ;



                    bool   servAdd  = true;
                    string servName = det.AbonementName;


                    for (int j = 0; j < tvdgServices.Nodes.Count; j++)
                    {
                        //abons.Add(det);
                        if (det.AbonementName == tvdgServices.Nodes[j].Cells["colNameService"].Value.ToString())
                        {
                            servAdd = false;
                        }
                        else
                        {
                            servName = det.AbonementName;
                        }
                    }

                    if (servAdd)
                    {
                        double    summ   = 0;
                        ArrayList servAL = new ArrayList();

                        for (int k = 0; k < al.Count; k++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detS = (DBLayer.AbonementIncome.Money_ReportDetails)al[k];

                            if (detS.AbonementName == servName)
                            {
                                servAL.Add(detS);

                                summ += detS.Summ;
                            }
                        }
                        AdvancedDataGridView.TreeGridNode node = tvdgServices.Nodes.Add(det.AbonementName, summ);

                        for (int x = 0; x < servAL.Count; x++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detSX = (DBLayer.AbonementIncome.Money_ReportDetails)servAL[x];

                            node.Nodes.Add(detSX.Date.ToString("dd-MMM-yyyy") + "/" + detSX.Quantity.ToString(), detSX.Summ);
                        }
                    }

                    break;

                case 3:
                    charges += det.Summ;



                    bool   chAdd  = true;
                    string chName = det.ChargeGroupName;


                    for (int j = 0; j < tvdgCharges.Nodes.Count; j++)
                    {
                        //abons.Add(det);
                        if (det.ChargeGroupName == tvdgCharges.Nodes[j].Cells["colNameCharge"].Value.ToString())
                        {
                            chAdd = false;
                        }
                        else
                        {
                            chName = det.ChargeGroupName;
                        }
                    }

                    if (chAdd)
                    {
                        double    summ = 0;
                        ArrayList chAL = new ArrayList();

                        for (int k = 0; k < al.Count; k++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detC = (DBLayer.AbonementIncome.Money_ReportDetails)al[k];

                            if (detC.ChargeGroupName == chName)
                            {
                                chAL.Add(detC);

                                summ += detC.Summ;
                            }
                        }
                        AdvancedDataGridView.TreeGridNode node = tvdgCharges.Nodes.Add(det.ChargeGroupName, summ);

                        for (int x = 0; x < chAL.Count; x++)
                        {
                            DBLayer.AbonementIncome.Money_ReportDetails detCX = (DBLayer.AbonementIncome.Money_ReportDetails)chAL[x];

                            node.Nodes.Add(detCX.AbonementName, detCX.Summ);
                        }
                    }

                    break;
                }
            }

            slblTotal.Text = total.ToString();

            pnlAbonements.PanelTitle = "Абонементы: " + abonements.ToString();
            pnlBar.PanelTitle        = "Бар: " + goods.ToString();
            pnlServices.PanelTitle   = "Услуги: " + services.ToString();
            pnlCharges.PanelTitle    = "Расходы: " + charges.ToString();
        }
Esempio n. 4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     AdvancedDataGridView.TreeGridNode treeGridNode1          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode2          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode3          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode4          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode5          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode6          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode7          = new AdvancedDataGridView.TreeGridNode();
     AdvancedDataGridView.TreeGridNode treeGridNode8          = new AdvancedDataGridView.TreeGridNode();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.treeGridView1     = new AdvancedDataGridView.TreeGridView();
     this.treeColumn        = new AdvancedDataGridView.TreeGridColumn();
     this.nameColumn        = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.descriptionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.imageList1        = new System.Windows.Forms.ImageList(this.components);
     ((System.ComponentModel.ISupportInitialize)(this.treeGridView1)).BeginInit();
     this.SuspendLayout();
     //
     // treeGridView1
     //
     this.treeGridView1.AllowUserToAddRows    = false;
     this.treeGridView1.AllowUserToDeleteRows = false;
     this.treeGridView1.CellBorderStyle       = System.Windows.Forms.DataGridViewCellBorderStyle.SingleVertical;
     this.treeGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.treeColumn,
         this.nameColumn,
         this.descriptionColumn
     });
     this.treeGridView1.Dock      = System.Windows.Forms.DockStyle.Fill;
     this.treeGridView1.EditMode  = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
     this.treeGridView1.ImageList = this.imageList1;
     this.treeGridView1.Location  = new System.Drawing.Point(0, 0);
     this.treeGridView1.Name      = "treeGridView1";
     treeGridNode1.ImageIndex     = 0;
     treeGridNode2.ImageIndex     = 11;
     treeGridNode1.Nodes.Add(treeGridNode2);
     treeGridNode3.ImageIndex = 13;
     treeGridNode4.ImageIndex = 7;
     treeGridNode5.ImageIndex = 15;
     treeGridNode6.ImageIndex = 0;
     treeGridNode7.ImageIndex = 9;
     treeGridNode8.ImageIndex = 10;
     treeGridNode7.Nodes.Add(treeGridNode8);
     treeGridNode6.Nodes.Add(treeGridNode7);
     this.treeGridView1.Nodes.Add(treeGridNode1);
     this.treeGridView1.Nodes.Add(treeGridNode3);
     this.treeGridView1.Nodes.Add(treeGridNode4);
     this.treeGridView1.Nodes.Add(treeGridNode5);
     this.treeGridView1.Nodes.Add(treeGridNode6);
     this.treeGridView1.RowHeadersVisible = false;
     this.treeGridView1.Size     = new System.Drawing.Size(292, 266);
     this.treeGridView1.TabIndex = 0;
     //
     // treeColumn
     //
     this.treeColumn.DefaultNodeImage = null;
     this.treeColumn.HeaderText       = "Tree";
     this.treeColumn.Name             = "treeColumn";
     this.treeColumn.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     //
     // nameColumn
     //
     this.nameColumn.HeaderText = "Name";
     this.nameColumn.Name       = "nameColumn";
     this.nameColumn.SortMode   = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     //
     // descriptionColumn
     //
     this.descriptionColumn.HeaderText = "Description";
     this.descriptionColumn.Name       = "descriptionColumn";
     this.descriptionColumn.SortMode   = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     //
     // imageList1
     //
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     this.imageList1.Images.SetKeyName(0, "cdmusic.ico");
     this.imageList1.Images.SetKeyName(1, "cellphone.ico");
     this.imageList1.Images.SetKeyName(2, "CONTACTS.ICO");
     this.imageList1.Images.SetKeyName(3, "delete_16x.ico");
     this.imageList1.Images.SetKeyName(4, "disconnect2.ico");
     this.imageList1.Images.SetKeyName(5, "disconnect3.ico");
     this.imageList1.Images.SetKeyName(6, "document.ico");
     this.imageList1.Images.SetKeyName(7, "error.ico");
     this.imageList1.Images.SetKeyName(8, "GenVideoDoc.ico");
     this.imageList1.Images.SetKeyName(9, "globe.ico");
     this.imageList1.Images.SetKeyName(10, "group.ico");
     this.imageList1.Images.SetKeyName(11, "help.ico");
     this.imageList1.Images.SetKeyName(12, "helpdoc.ico");
     this.imageList1.Images.SetKeyName(13, "homenet.ico");
     this.imageList1.Images.SetKeyName(14, "hotplug.ico");
     this.imageList1.Images.SetKeyName(15, "ICS client.ico");
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(292, 266);
     this.Controls.Add(this.treeGridView1);
     this.Name = "Form1";
     this.Text = "Form1";
     ((System.ComponentModel.ISupportInitialize)(this.treeGridView1)).EndInit();
     this.ResumeLayout(false);
 }