Пример #1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode != null && treeView1.SelectedNode.Text != "年份")
            {
                string tempid = treeView1.SelectedNode.Tag.ToString();


                if (tempid.Length < 10)
                {
                    power  = tempid;
                    yearid = treeView1.SelectedNode.Parent.Tag.ToString();
                    if (yearid == "old")
                    {
                        substation sub2 = new substation();
                        sub2.EleName           = " ObligateField5<'2008' and ObligateField1='" + power + "'";   //power;
                        gridControl.DataSource = Services.BaseService.GetList("SelectsubstationByWhere", sub2); //dt;
                        this.Text = "变电站列表";
                        return;
                    }
                }
                substation sub = new substation();
                sub.UID            = yearid;
                sub.ObligateField1 = power;
                // line.LayerID = sid;
                //DataTable dt = Itop.Common.DataConverter.ToDataTable(Services.BaseService.GetList("SelectLineInfoByPowerKvAndYear", line), typeof(LineInfo));
                gridControl.DataSource = Services.BaseService.GetList("SelectSubInfoByPowerKvAndYear", sub);//dt;
                this.Text = "变电站列表";
            }
        }
Пример #2
0
        private void treeList1_DoubleClick(object sender, EventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }

            FrmEditProject fep = new FrmEditProject();

            fep.IsStuff  = true;
            fep.FlagId   = typeFlag2;
            fep.PowerUId = treeList1.FocusedNode["ID"].ToString();
            string   uid1 = treeList1.FocusedNode["ID"].ToString();
            LineInfo li   = Common.Services.BaseService.GetOneByKey <LineInfo>(treeList1.FocusedNode["Code"].ToString());

            if (li != null)
            {
                fep.IsLine = true;
            }
            substation li1 = Common.Services.BaseService.GetOneByKey <substation>(treeList1.FocusedNode["ID"].ToString());

            if (li1 != null)
            {
                fep.IsPower = true;
            }

            if (fep.ShowDialog() == DialogResult.OK)
            {
                LoadData();
                treeList1.ExpandAll();
                FoucsLocation(uid1, treeList1.Nodes);
            }
        }
Пример #3
0
        private PSPDEV createsub(SvgElement element)
        {
            PSPDEV pspDev = new PSPDEV();

            pspDev.SUID   = Guid.NewGuid().ToString();
            pspDev.EleID  = element.ID;
            pspDev.SvgUID = svgid;
            PSPDEV pspDev2 = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVBySvgUIDandEleID", pspDev);

            if (pspDev2 == null)
            {
                pspDev.Number    = -1;
                pspDev.FirstNode = -1;
                pspDev.LastNode  = -1;
                pspDev.Type      = "Use";
                pspDev.Lable     = "变电站";
                pspDev.Name      = element.GetAttribute("info-name");
                IList list = Services.BaseService.GetList("SelectsubstationByWhere", "eleid='" + pspDev.EleID + "'");
                if (list.Count > 0)
                {
                    substation sub = list[0] as substation;
                    pspDev.Name    = sub.EleName;
                    pspDev.VoltR   = double.Parse(sub.ObligateField1); //电压
                    pspDev.Burthen = sub.Number;                       //容量
                }
                Services.BaseService.Create <PSPDEV>(pspDev);
            }
            else
            {
                pspDev = pspDev2;
            }
            return(pspDev);
        }
Пример #4
0
        private void gridControl_DoubleClick(object sender, EventArgs e)
        {
            //this.DialogResult = DialogResult.OK;
            substat = this.gridView.GetRow(this.gridView.FocusedRowHandle) as substation;
            //line = ObjectList[this.gridView.FocusedRowHandle];
            string aa = "";

            this.Close();
        }
Пример #5
0
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.gridView.FocusedRowHandle != -1)
     {
         substat = this.gridView.GetRow(this.gridView.FocusedRowHandle) as substation;
         Services.BaseService.Delete <substation>(substat);
         gridView.DeleteRow(this.gridView.FocusedRowHandle);
     }
 }
Пример #6
0
        public void Copy()
        {
            if (CurTreeNode.ImageIndex == 2 || CurTreeNode.ImageIndex == 8)
            {
                return;
            }
            frmFileCopy frmFile = new frmFileCopy();

            frmFile.InitData(CurTreeNode.Text);
            if (frmFile.ShowDialog() == DialogResult.OK)
            {
                // CurTreeNode.Text = frmFile.NewFileName;
                string  old_uid = ((SVGFILE)(CurTreeNode.Tag)).SUID;
                string  new_uid = Guid.NewGuid().ToString();
                SVGFILE _svg    = Services.BaseService.GetOneByKey <SVGFILE>(old_uid);
                _svg.SUID     = new_uid;
                _svg.FILENAME = frmFile.NewFileName;
                Services.BaseService.Create <SVGFILE>(_svg);

                IList list1 = Services.BaseService.GetList("SelectglebePropertyBySvgUID", old_uid);
                for (int i = 0; i < list1.Count; i++)
                {
                    glebeProperty _gle = (glebeProperty)list1[i];
                    _gle.UID    = Guid.NewGuid().ToString();
                    _gle.SvgUID = new_uid;
                    Services.BaseService.Create <glebeProperty>(_gle);
                }
                IList list2 = Services.BaseService.GetList("SelectLineInfoBySvgUID", old_uid);
                for (int i = 0; i < list2.Count; i++)
                {
                    LineInfo _line = (LineInfo)list2[i];
                    _line.UID    = Guid.NewGuid().ToString();
                    _line.SvgUID = new_uid;
                    Services.BaseService.Create <LineInfo>(_line);
                }
                IList list3 = Services.BaseService.GetList("SelectsubstationBySvgUID", old_uid);
                for (int i = 0; i < list3.Count; i++)
                {
                    substation _sub = (substation)list3[i];
                    _sub.UID    = Guid.NewGuid().ToString();
                    _sub.SvgUID = new_uid;
                    Services.BaseService.Create <substation>(_sub);
                }
                TreeNode treeNode = new TreeNode();
                treeNode.Tag        = _svg;
                treeNode.ImageIndex = 9;
                treeNode.Text       = _svg.FILENAME;
                root.Nodes.Add(treeNode);
                MessageBox.Show("文件拷贝成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #7
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < te.Length; i++)
            {
                try
                {
                    SaveCellValue(te[i].Name.Replace("Text", ""), poweruid, te[i].Text.Trim());
                }
                catch { }
            }

            if (isline)
            {
                try
                {
                    LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

                    if (li == null)
                    {
                        li.UID      = powerid;
                        li.Length   = ta.Text;
                        li.LineType = tb1.Text;
                        li.Voltage  = tc.Text;
                        Common.Services.BaseService.Update <LineInfo>(li);
                    }
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

                    if (sb == null)
                    {
                        sb.UID = powerid;
                        try
                        {
                            sb.Burthen = decimal.Parse(t11.Text);
                        }
                        catch { }
                        sb.ObligateField1 = t22.Text;
                        sb.ObligateField1 = t33.Text;
                        Common.Services.BaseService.Update <substation>(sb);
                    }
                }
                catch { }
            }
        }
Пример #8
0
 private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (treeView1.SelectedNode != null)
     {
         yearid = treeView1.SelectedNode.Tag.ToString();
         substation sub = new substation();
         sub.UID            = yearid;
         sub.ObligateField1 = power;
         // line.LayerID = sid;
         //DataTable dt = Itop.Common.DataConverter.ToDataTable(Services.BaseService.GetList("SelectLineInfoByPowerKvAndYear", line), typeof(LineInfo));
         gridControl.DataSource = Services.BaseService.GetList("SelectSubInfoByPowerKvAndYear", sub);//dt;
         this.Text = power + "kV 变电站列表";
     }
 }
Пример #9
0
        //读取数据
        private void LoadValues()
        {
            //PowerProValues PowerValues = new PowerProValues();
            //PowerValues.Year = typeFlag2;//用ID字段存放Flag2的值

            //PowerValues.TypeID1 = typeFlag2;

            IList <PowerProValues> listValues = Common.Services.BaseService.GetList <PowerProValues>("SelectPowerProValuesListByFlag2", typeFlag2);



            foreach (PowerProValues value in listValues)
            {
                TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
                if (node != null)
                {
                    node.SetValue(value.Year, value.Value);
                }
            }


            foreach (TreeListNode tln in treeList1.Nodes)
            {
                string   ss = tln["Code"].ToString();
                LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(ss);
                if (li != null)
                {
                    tln.SetValue("L1", li.Length);
                    tln.SetValue("L2", li.LineType);
                    tln.SetValue("L3", li.Voltage);
                }
                substation li1 = Common.Services.BaseService.GetOneByKey <substation>(ss);
                if (li1 != null)
                {
                    tln.SetValue("L3", li1.ObligateField1);
                    tln.SetValue("L4", li1.Burthen);
                    tln.SetValue("L5", li1.ObligateField2);
                }
            }



            ////foreach(TreeListNode tln in treeList1.Nodes)
            ////{
            ////    CalChildNode(tln);
            ////}
        }
Пример #10
0
        private void barButtonItem5_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FrmEditProject fep = new FrmEditProject();

            fep.FlagId   = typeFlag2;
            fep.PowerUId = treeList1.FocusedNode["ID"].ToString();
            LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(treeList1.FocusedNode["Code"].ToString());

            if (li != null)
            {
                fep.IsLine = true;
            }
            substation li1 = Common.Services.BaseService.GetOneByKey <substation>(treeList1.FocusedNode["ID"].ToString());

            if (li1 != null)
            {
                fep.IsPower = true;
            }
            if (fep.ShowDialog() == DialogResult.OK)
            {
                LoadData();
                treeList1.ExpandAll();
            }
        }
Пример #11
0
        private void FrmEditProject_Load(object sender, EventArgs e)
        {
            double?q1 = null;
            double?q2 = null;
            double?q3 = null;
            string q4 = "";
            double?q5 = null;
            double?q6 = null;
            string q7 = "";
            string q8 = "";

            string c1 = "";
            string c2 = "";
            string c3 = "";

            int t1 = 0;

            PowerProTypes ppt = new PowerProTypes();

            ppt.ID    = poweruid;
            ppt.Flag2 = flag;

            PowerProTypes ps = Common.Services.BaseService.GetOneByKey <PowerProTypes>(ppt);

            if (ps != null)
            {
                groupBox1.Text = ps.Title;
                powerid        = ps.Code;
                c1             = ps.StartYear.ToString();
                c2             = ps.EndYear.ToString();
                c3             = ps.Remark;
                t1             = ps.Flag;

                q1 = ps.L1;
                q2 = ps.L2;
                q3 = ps.L3;
                q4 = ps.L4;
                q5 = ps.L5;
                q6 = ps.L6;
            }


            LineInfo li22 = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

            if (li22 != null || t1 == 1)
            {
                isline = true;
            }

            substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

            if (sb != null || t1 == 2)
            {
                isPower = true;
            }


            PowerProValues ppv = new PowerProValues();

            ppv.TypeID  = poweruid;
            ppv.TypeID1 = flag;
            IList <PowerProValues> listValues = Common.Services.BaseService.GetList <PowerProValues>("SelectPowerProValuesList", ppv);



            PowerProYears pps = new PowerProYears();

            pps.Flag = flag;
            IList <PowerProYears> li = Common.Services.BaseService.GetList <PowerProYears>("SelectPowerProYearsListByFlag", pps);

            lb = new Label[li.Count];
            te = new TextEdit[li.Count];

            int i = 0;


            if (!isPower)
            {
                lt1.Text     = "长度:";
                lt1.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt1);

                tt1          = new TextEdit();
                tt1.Location = new Point(157, 26 + 33 * i);
                tt1.Size     = new Size(231, 21);

                tt1.Properties.DisplayFormat.FormatString = "n4";
                tt1.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt1.Properties.EditFormat.FormatString    = "n4";
                tt1.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt1.Properties.Mask.EditMask = "#####0.####";
                tt1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(tt1);

                i++;

                lt2.Text     = "型号:";
                lt2.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt2);

                tt2          = new TextEdit();
                tt2.Location = new Point(157, 26 + 33 * i);
                tt2.Size     = new Size(231, 21);
                groupBox1.Controls.Add(tt2);

                i++;
            }


            if (!isline)
            {
                lt3.Text     = "台数:";
                lt3.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt3);

                tt3          = new TextEdit();
                tt3.Location = new Point(157, 26 + 33 * i);
                tt3.Size     = new Size(231, 21);

                tt3.Properties.DisplayFormat.FormatString = "n0";
                tt3.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt3.Properties.EditFormat.FormatString    = "n0";
                tt3.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt3.Properties.Mask.EditMask = "########";
                tt3.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(tt3);

                i++;

                lt4.Text     = "容量:";
                lt4.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt4);



                tt4          = new TextEdit();
                tt4.Location = new Point(157, 26 + 33 * i);
                tt4.Size     = new Size(231, 21);

                tt4.Properties.DisplayFormat.FormatString = "n4";
                tt4.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt4.Properties.EditFormat.FormatString    = "n4";
                tt4.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt4.Properties.Mask.EditMask = "#####0.####";
                tt4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(tt4);
                i++;

                lt5.Text     = "负荷率(%):";
                lt5.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt5);

                tt5          = new TextEdit();
                tt5.Location = new Point(157, 26 + 33 * i);
                tt5.Size     = new Size(231, 21);

                tt5.Properties.DisplayFormat.FormatString = "####.##";
                tt5.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.EditFormat.FormatString    = "####.##";
                tt5.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.Mask.EditMask = "P2";
                tt5.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(tt5);
                i++;

                lt6.Text     = "最大负荷:";
                lt6.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt6);

                tt6          = new TextEdit();
                tt6.Location = new Point(157, 26 + 33 * i);
                tt6.Size     = new Size(231, 21);

                tt6.Properties.DisplayFormat.FormatString = "n4";
                tt6.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.EditFormat.FormatString    = "n4";
                tt6.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.Mask.EditMask = "#####0.####";
                tt6.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

                groupBox1.Controls.Add(tt6);

                i++;
            }

            int j = 0;

            foreach (PowerProYears ppy in li)
            {
                lb[j]          = new Label();
                lb[j].Name     = "Label" + ppy.Year;
                lb[j].Text     = ppy.Year + ":";
                lb[j].Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lb[j]);

                te[j]          = new TextEdit();
                te[j].Name     = "Text" + ppy.Year;
                te[j].Location = new Point(157, 26 + 33 * i);
                te[j].Size     = new Size(231, 21);
                groupBox1.Controls.Add(te[j]);

                foreach (PowerProValues ppy1 in listValues)
                {
                    if (ppy.Year == ppy1.Year)
                    {
                        te[j].Text = ppy1.Value;
                    }
                }
                j++;
                i++;
            }


            if (!isstuff)
            {
                ls1.Text     = "计划开始时间:";
                ls1.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(ls1);

                ts1          = new TextEdit();
                ts1.Location = new Point(157, 27 + 33 * i);
                ts1.Size     = new Size(231, 21);
                if (c1 == "0" || c1 == "")
                {
                    ts1.Text = "";
                }
                else
                {
                    ts1.Text = c1;
                }



                ts1.Properties.DisplayFormat.FormatString = "n0";
                ts1.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                ts1.Properties.EditFormat.FormatString    = "n0";
                ts1.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                ts1.Properties.Mask.EditMask = "####";
                ts1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                groupBox1.Controls.Add(ts1);

                i++;

                ls2.Text     = "预计投产时间:";
                ls2.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(ls2);

                ts2          = new TextEdit();
                ts2.Location = new Point(157, 27 + 33 * i);
                ts2.Size     = new Size(231, 21);

                ts2.Properties.DisplayFormat.FormatString = "n0";
                ts2.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                ts2.Properties.EditFormat.FormatString    = "n0";
                ts2.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                ts2.Properties.Mask.EditMask = "####";
                ts2.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                groupBox1.Controls.Add(ts2);


                if (c2 == "0" || c2 == "")
                {
                    ts2.Text = "";
                }
                else
                {
                    ts2.Text = c2;
                }


                i++;
            }


            ls3.Text     = "备注:";
            ls3.Location = new Point(52, 27 + 33 * i);
            groupBox1.Controls.Add(ls3);

            ts3          = new TextEdit();
            ts3.Location = new Point(157, 27 + 33 * i);
            ts3.Size     = new Size(231, 21);
            groupBox1.Controls.Add(ts3);
            ts3.Text = c3;



            if (isline)
            {
                try
                {
                    tt1.Text = q3.ToString();
                    tt2.Text = q4.ToString();

                    if (li22 != null)
                    {
                        tt1.Text = li22.Length;
                        tt2.Text = li22.LineType;
                    }
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    tt3.Text = q1.ToString();
                    tt4.Text = q2.ToString();
                    tt5.Text = q5.ToString();
                    tt6.Text = q6.ToString();

                    if (sb != null)
                    {
                        tt4.Text = sb.Number.ToString();
                        tt5.Text = sb.ObligateField2;
                        tt6.Text = sb.Burthen.ToString();
                    }
                }
                catch { }
            }

            groupBox1.Size         = new Size(434, 130 + 33 * i);
            simpleButton1.Location = new Point(296, 150 + 33 * i);
            simpleButton2.Location = new Point(389, 150 + 33 * i);
            this.Size = new Size(490, 230 + 33 * i);
        }
Пример #12
0
        private Layer CopyLayer(Layer layer)
        {
            Layer layer2 = Layer.CreateNew(layer.Label + " 副本", this.SymbolDoc);

            //foreach (SvgElement g in layer.GraphList)
            //{
            //    layer2.GraphList.Add(g);
            //}

            this.SymbolDoc.NumberOfUndoOperations = (2 * layer2.GraphList.Count) + 200;
            SvgElementCollection sc = layer.GraphList;

            for (int i = layer.GraphList.Count - 1; i >= 0; i--)
            {
                SvgElement element = sc[i] as SvgElement;
                SvgElement temp    = element.Clone() as SvgElement;
                //if (temp.Name=="use"){
                if (temp.GetAttribute("CopyOf") == "")
                {
                    temp.SetAttribute("CopyOf", temp.ID);
                }
                IGraph graph = (IGraph)layer2.AddElement(temp);
                graph.Layer = layer2;

                LineInfo _line = new LineInfo();
                _line.EleID  = element.ID;
                _line.SvgUID = this.SymbolDoc.SvgdataUid;
                IList lineInfoList = Services.BaseService.GetList("SelectLineInfoByEleID", _line);
                foreach (LineInfo line in lineInfoList)
                {
                    line.UID     = Guid.NewGuid().ToString();
                    line.LayerID = layer2.ID;
                    line.EleID   = temp.ID;
                    Services.BaseService.Create <LineInfo>(line);
                }
                glebeProperty gle = new glebeProperty();
                gle.EleID  = element.ID;
                gle.SvgUID = this.SymbolDoc.SvgdataUid;
                IList gleProList = Services.BaseService.GetList("SelectglebePropertyByEleID", gle);
                foreach (glebeProperty gleP in gleProList)
                {
                    gleP.UID     = Guid.NewGuid().ToString();
                    gleP.LayerID = layer2.ID;
                    gleP.EleID   = temp.ID;
                    Services.BaseService.Create <glebeProperty>(gleP);
                }
                substation _sub = new substation();
                _sub.EleID  = element.ID;
                _sub.SvgUID = this.SymbolDoc.SvgdataUid;
                IList substationList = Services.BaseService.GetList("SelectsubstationByEleID", _sub);
                foreach (substation sub in substationList)
                {
                    sub.UID     = Guid.NewGuid().ToString();
                    sub.LayerID = layer2.ID;
                    sub.EleID   = temp.ID;
                    Services.BaseService.Create <substation>(sub);
                }
            }
            this.SymbolDoc.NotifyUndo();
            return(layer2);
        }
Пример #13
0
        private Layer CopyLayer2(Layer layer, string textname)
        {
            string layerlabelf = layer.Label.Substring(4);
            string layer2name  = textname + layerlabelf;
            int    j           = 0;

            for (int i = 0; i < checkedListBox1.Items.Count; i++)
            {
                if (checkedListBox1.Items[i].ToString() == layer2name)
                {
                    j = 1;
                }
                //else
                //    j = 0;
            }
            Layer layer2 = null;

            if (j == 0)
            {
                layer2 = Layer.CreateNew(textname + layerlabelf, this.SymbolDoc);
                this.SymbolDoc.NumberOfUndoOperations = (2 * layer2.GraphList.Count) + 200;
                SvgElementCollection sc = layer.GraphList;
                for (int i = layer.GraphList.Count - 1; i >= 0; i--)
                {
                    SvgElement element = sc[i] as SvgElement;
                    SvgElement temp    = element.Clone() as SvgElement;
                    if (temp.GetAttribute("CopyOf") == "")
                    {
                        temp.SetAttribute("CopyOf", temp.ID);
                    }
                    IGraph graph = (IGraph)layer2.AddElement(temp);
                    graph.Layer = layer2;

                    //LineInfo _line = new LineInfo();
                    //_line.EleID = element.ID;
                    //_line.SvgUID = this.SymbolDoc.SvgdataUid;
                    //IList lineInfoList = Services.BaseService.GetList("SelectLineInfoByEleID", _line);
                    PSPDEV _line = new PSPDEV();
                    _line.EleID  = element.ID;
                    _line.SvgUID = this.SymbolDoc.SvgdataUid;
                    IList lineInfoList = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandEleID", _line);

                    foreach (PSPDEV line in lineInfoList)
                    {
                        line.SUID    = Guid.NewGuid().ToString();
                        line.LayerID = layer2.ID;
                        line.EleID   = temp.ID;
                        Services.BaseService.Create <PSPDEV>(line);
                    }
                    glebeProperty gle = new glebeProperty();
                    gle.EleID  = element.ID;
                    gle.SvgUID = this.SymbolDoc.SvgdataUid;
                    IList gleProList = Services.BaseService.GetList("SelectglebePropertyByEleID", gle);
                    foreach (glebeProperty gleP in gleProList)
                    {
                        gleP.UID     = Guid.NewGuid().ToString();
                        gleP.LayerID = layer2.ID;
                        gleP.EleID   = temp.ID;
                        Services.BaseService.Create <glebeProperty>(gleP);
                    }
                    substation _sub = new substation();
                    _sub.EleID  = element.ID;
                    _sub.SvgUID = this.SymbolDoc.SvgdataUid;
                    IList substationList = Services.BaseService.GetList("SelectsubstationByEleID", _sub);
                    foreach (substation sub in substationList)
                    {
                        sub.UID     = Guid.NewGuid().ToString();
                        sub.LayerID = layer2.ID;
                        sub.EleID   = temp.ID;
                        Services.BaseService.Create <substation>(sub);
                    }
                }
            }
            this.SymbolDoc.NotifyUndo();
            return(layer2);
        }
Пример #14
0
        private void textEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (DeviceHelper.xml1 == null)
            {
                return;
            }
            object obj = null;

            obj = DeviceHelper.SelectDevice(DeviceType.BDZ, Itop.Client.MIS.ProgUID);

            if (obj is PSP_Substation_Info)
            {
                string deviceid = ((PSP_Substation_Info)obj).UID;
                ((PSP_Substation_Info)obj).LayerID = layerid;
                ((PSP_Substation_Info)obj).EleID   = eleid;
                Services.BaseService.Update <PSP_Substation_Info>(((PSP_Substation_Info)obj));

                if (DeviceHelper.xml1 != null)
                {
                    DeviceHelper.xml1.SetAttribute("Deviceid", deviceid);
                    substation sb = new substation();
                    sb.UID = ((PSP_Substation_Info)obj).UID;
                    sb     = (substation)Services.BaseService.GetObject("SelectsubstationByKey", sb);
                    if (sb != null)
                    {
                        sb.SvgUID  = uid;
                        sb.LayerID = layerid;
                        sb.EleID   = DeviceHelper.xml1.GetAttribute("id");
                        if (((PSP_Substation_Info)obj).Flag == "2")
                        {
                            sb.ObligateField3 = "规划";
                        }
                        else if (((PSP_Substation_Info)obj).Flag == "1")
                        {
                            sb.ObligateField3 = "现行";
                        }
                        Services.BaseService.Update <substation>(sb);
                    }
                    else
                    {
                        sb         = new substation();
                        sb.UID     = ((PSP_Substation_Info)obj).UID;
                        sb.SvgUID  = uid;
                        sb.EleID   = DeviceHelper.xml1.GetAttribute("id");
                        sb.LayerID = layerid;
                        if (((PSP_Substation_Info)obj).Flag == "2")
                        {
                            sb.ObligateField3 = "规划";
                        }
                        else if (((PSP_Substation_Info)obj).Flag == "1")
                        {
                            sb.ObligateField3 = "现行";
                        }
                        Services.BaseService.Create <substation>(sb);
                    }
                }
                this.Close();
                return;
            }

            this.Close();
        }
Пример #15
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < te.Length; i++)
            {
                SaveCellValue(te[i].Name.Replace("Text", ""), poweruid, te[i].Text.Trim());
            }



            if (isline)
            {
                try
                {
                    LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

                    if (li != null)
                    {
                        li.LineName = cb0.Text;
                        li.Voltage  = cb1.Text;
                        li.Length   = tt4.Text;
                        li.LineType = cb5.Text;
                        Common.Services.BaseService.Update <LineInfo>(li);
                    }
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    substation      sb  = Common.Services.BaseService.GetOneByKey <substation>(powerid);
                    Substation_Info sub = new Substation_Info();
                    sub.Code = powerid;
                    Substation_Info sbinfo = (Substation_Info)Common.Services.BaseService.GetObject("SelectSubstation_InfoByCode", sub);
                    if (sbinfo != null)
                    {
                        sbinfo.L2 = double.Parse(cb3.Text);
                        sbinfo.L3 = int.Parse(cb2.Text);
                        Common.Services.BaseService.Update("UpdateSubstation_InfoByUID", sub);
                    }

                    if (sb != null)
                    {
                        try
                        {
                            sb.EleName        = cb0.Text;
                            sb.ObligateField1 = cb1.Text;
                        }
                        catch { }

                        Common.Services.BaseService.Update <substation>(sb);
                    }
                }
                catch { }
            }



            try
            {
                PSP_PowerProValues_LangFang ppts = new PSP_PowerProValues_LangFang();
                ppts.ID    = poweruid;
                ppts.Flag2 = flag;


                PSP_PowerProValues_LangFang ppt1 = Common.Services.BaseService.GetOneByKey <PSP_PowerProValues_LangFang>(ppts);
                try
                {
                    ppt1.L3  = cb0.Text.ToString();
                    ppt1.L4  = cb1.Text.ToString();
                    ppt1.L5  = cb2.Text.ToString();
                    ppt1.L6  = cb3.Text.ToString();
                    ppt1.L7  = cb4.Text.ToString();
                    ppt1.L8  = tt4.Text.ToString();
                    ppt1.L9  = cb5.Text.ToString();
                    ppt1.L10 = double.Parse(tt5.Text.ToString());
                    ppt1.L11 = lookupedit;
                    ppt1.L12 = double.Parse(tt6.Text.ToString());
                }
                catch { }
                Common.Services.BaseService.Update <PSP_PowerProValues_LangFang>(ppt1);
            }
            catch { }

            this.DialogResult = DialogResult.OK;
        }
        public void InitData(string useid, string svguid, string layID, string lab)
        {
            LabelTxt = lab;
            layerID  = layID;
            //gPro.UID = useid;
            //rzb = str_rzb;
            try
            {
                sub.EleID  = useid;
                sub.SvgUID = svguid;
                IList svglist = Services.BaseService.GetList("SelectsubstationByEleID", sub);
                if (svglist.Count > 0)
                {
                    sub      = (substation)svglist[0];
                    IsCreate = false;
                }
                else
                {
                    IsCreate = true;
                    //gPro.Area = Area;
                    sub.UID     = Guid.NewGuid().ToString();
                    sub.LayerID = layerID;
                    sub.EleID   = useid;
                    sub.SvgUID  = svguid;
                    sub.UID     = Guid.NewGuid().ToString();
                }

                if (getLvl(LabelTxt) == "500" && sub.ObligateField2 == "")
                {
                    sub.ObligateField2 = "65.00%";
                }
                if (getLvl(LabelTxt) == "220" && sub.ObligateField2 == "")
                {
                    sub.ObligateField2 = "59.00%";
                }
                if (getLvl(LabelTxt) == "66" && sub.ObligateField2 == "")
                {
                    sub.ObligateField2 = "50.00%";
                }

                bh.DataBindings.Add("Text", sub, "EleName");
                lx.DataBindings.Add("EditValue", sub, "glebeEleID");
                //mj.DataBindings.Add("Text", gPro, "Area");
                fhl.DataBindings.Add("EditValue", sub, "ObligateField2");
                Maxfh.DataBindings.Add("Text", sub, "Burthen");
                dl.DataBindings.Add("Text", sub, "Number");
                remark.DataBindings.Add("Text", sub, "Remark");
                //comboTcnf.DataBindings.Add("Text", sub, "ObligateField5");
                jsdd.DataBindings.Add("Text", sub, "ObligateField6");
                zbts.DataBindings.Add("Text", sub, "ObligateField7");

                if (sub.ObligateField5 != null)
                {
                    if (sub.ObligateField5.Length == 4)
                    {
                        comboTcnf.Text = sub.ObligateField5;
                    }
                    string[] s = sub.ObligateField5.Split("-".ToCharArray());
                    if (s.Length > 1)
                    {
                        comboTcnf.Text = s[0];
                        comy.Text      = s[1];
                    }
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.Message);
            }
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (bh.Text == "")
            {
                MessageBox.Show("变电站名称不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //if (dl.Text == "") {
            //    MessageBox.Show("变电站容量不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}
            //if (getObligateField4(LabelTxt) == "局有")
            //{
            //    if (fhl.Text == "")
            //    {
            //        MessageBox.Show("负荷率不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //        return;
            //    }
            //}
            //if (Maxfh.Text == "")
            //{
            //    MessageBox.Show("最大负荷不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}
            //if (comboTcnf.Text != "" && comy.Text != "")
            //{
            sub.ObligateField5 = comboTcnf.Text;// +"-" + comy.Text;
            //}
            if (IsCreate)
            {
                //gPro.ParentEleID = "1";
                substation _s = new substation();
                _s.EleName = sub.EleName;
                _s.SvgUID  = sub.SvgUID;
                IList mlist = Services.BaseService.GetList("SelectsubstationByEleNameCK", _s);
                if (mlist.Count > 0)
                {
                    MessageBox.Show("变电站名称重复。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //return;
                }

                sub.ObligateField1 = getLvl(LabelTxt);
                sub.ObligateField3 = getSubType(LabelTxt);
                sub.ObligateField4 = getObligateField4(LabelTxt);
                sub.ObligateField6 = jsdd.Text;
                sub.ObligateField7 = zbts.Text;
                Services.BaseService.Create <substation>(sub);
            }
            else
            {
                sub.LayerID        = layerID;
                sub.ObligateField1 = getLvl(LabelTxt);
                sub.ObligateField3 = getSubType(LabelTxt);
                sub.ObligateField4 = getObligateField4(LabelTxt);
                sub.ObligateField6 = jsdd.Text;
                sub.ObligateField7 = zbts.Text;
                Services.BaseService.Update <substation>(sub);
            }
            if (SubUpdate)
            {
                Substation_Info temp = (Substation_Info)Services.BaseService.GetObject("SelectSubstation_InfoByCode", sub.UID);
                if (temp != null)
                {
                    temp.Code = "";
                    Services.BaseService.Update <Substation_Info>(temp);
                }
                substation _s = new substation();
                _s.UID = OldUID;
                substation _temps = Services.BaseService.GetOneByKey <substation>(_s);
                if (_temps != null)
                {
                    if (_temps.EleID == "")
                    {
                        Services.BaseService.Update("Deletesubstation", _temps);
                    }
                }
                Services.BaseService.Update <Substation_Info>(p);
            }
            Substation_Info ppt = (Substation_Info)Services.BaseService.GetObject("SelectSubstation_InfoByCode", sub.UID);

            if (ppt != null)
            {
                ppt.L1    = Convert.ToInt32(sub.ObligateField1.ToLower().Replace("kv", ""));
                ppt.Title = sub.EleName;//名称
                //ppt.L1 = "";//台数
                try
                {
                    //  ppt.L2 = Convert.ToDouble(sub.Number);//容量

                    ppt.L10 = Convert.ToDouble(sub.ObligateField2); //负荷率

                    ppt.L9  = Convert.ToDouble(sub.Burthen);        //最大负荷
                    ppt.L22 = sub.ObligateField5;
                    Services.BaseService.Update <Substation_Info>(ppt);
                }
                catch { }
            }


            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Пример #18
0
        private void FrmEditProject_Load(object sender, EventArgs e)
        {
            SetData();
            string q1  = "";
            string q2  = "";
            string q3  = "";
            string q4  = "";
            string q5  = "";
            string q6  = "";
            string q7  = "";
            string q8  = "";
            string q9  = "";
            string q10 = "";
            string q11 = "";
            string q12 = "";

            int t1 = 0;

            PSP_PowerProValues_LangFang ppt = new PSP_PowerProValues_LangFang();

            ppt.ID    = poweruid;
            ppt.Flag2 = flag;

            PSP_PowerProValues_LangFang ps = Common.Services.BaseService.GetOneByKey <PSP_PowerProValues_LangFang>(ppt);

            if (ps != null)
            {
                groupBox1.Text = ps.Title;
                powerid        = ps.Code;
                t1             = ps.Flag;

                // q1 = ps.L1;
                // q2 = ps.L2;
                q3  = ps.L3;
                q4  = ps.L4;
                q5  = ps.L5;
                q6  = ps.L6;
                q7  = ps.L7;
                q8  = ps.L8;
                q9  = ps.L9;
                q10 = ps.L10.ToString();
                q11 = ps.L11;
                q12 = ps.L12.ToString();
            }


            LineInfo li22 = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

            if (li22 != null || t1 == 1)
            {
                isline = true;
            }

            substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

            if (sb != null || t1 == 2)
            {
                isPower = true;
            }


            PowerProValues ppv = new PowerProValues();

            ppv.TypeID  = poweruid;
            ppv.TypeID1 = flag;
            IList <PowerProValues> listValues = Common.Services.BaseService.GetList <PowerProValues>("SelectPowerProValuesList", ppv);



            PowerProYears pps = new PowerProYears();

            pps.Flag = flag;
            IList <PowerProYears> li = Common.Services.BaseService.GetList <PowerProYears>("SelectPowerProYearsListByFlag", pps);

            lb = new Label[li.Count];
            te = new TextEdit[li.Count];

            int i = 0;


            //if (!isPower)
            // {
            ////lt1.Text = "设备名称:";
            ////lt1.Location = new Point(52, 27 + 33 * i);
            ////groupBox1.Controls.Add(lt1);

            ////tt1 = new TextEdit();
            ////tt1.Location = new Point(157, 26 + 33 * i);
            ////tt1.Size = new Size(231, 21);
            ////tt1.TextChanged += new EventHandler(tt1_TextChanged);
            ////tt1.Properties.DisplayFormat.FormatString = "n4";
            ////tt1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            ////tt1.Properties.EditFormat.FormatString = "n4";
            ////tt1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            ////tt1.Properties.Mask.EditMask = "#####0.####";
            ////tt1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


            ////groupBox1.Controls.Add(tt1);

            ////i++;

            ////lt2.Text = "台数:";
            ////lt2.Location = new Point(52, 27 + 33 * i);
            ////groupBox1.Controls.Add(lt2);

            ////tt2 = new TextEdit();
            ////tt2.Location = new Point(157, 26 + 33 * i);
            ////tt2.Size = new Size(231, 21);
            ////groupBox1.Controls.Add(tt2);

            ////i++;
            // }


            //if (!isline)
            {
                lt3.Text     = "工 程 名 称 :";
                lt3.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt3);

                // tt3 = new TextEdit();
                cb0.Location = new Point(157, 26 + 33 * i);
                cb0.Size     = new Size(231, 21);

                cb0.Properties.DisplayFormat.FormatString = "n0";
                cb0.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb0.Properties.EditFormat.FormatString    = "n0";
                cb0.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb0.Properties.Mask.EditMask = "########";
                cb0.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;


                groupBox1.Controls.Add(cb0);

                i++;

                lt4.Text     = "电 压 等 级 :";
                lt4.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt4);



                // tt4 = new TextEdit();
                cb1.Location = new Point(157, 26 + 33 * i);
                cb1.Size     = new Size(231, 21);

                cb1.Properties.DisplayFormat.FormatString = "n4";
                cb1.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb1.Properties.EditFormat.FormatString    = "n4";
                cb1.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb1.Properties.Mask.EditMask = "#####0.####";
                cb1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;


                groupBox1.Controls.Add(cb1);
                i++;

                lt5.Text     = "主 变 台 数 :";
                lt5.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt5);

                //  tt5 = new TextEdit();
                cb2.Location = new Point(157, 26 + 33 * i);
                cb2.Size     = new Size(231, 21);

                cb2.Properties.DisplayFormat.FormatString = "####.##";
                cb2.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                cb2.Properties.EditFormat.FormatString    = "####.##";
                cb2.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                // cb2.Properties.Mask.EditMask = "P2";
                cb2.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(cb2);
                i++;

                lt6.Text     = "单台容量(MVA):";
                lt6.Location = new Point(50, 27 + 33 * i);
                lt6.Width    = 105;
                groupBox1.Controls.Add(lt6);

                //tt6 = new TextEdit();
                cb3.Location = new Point(157, 26 + 33 * i);
                cb3.Size     = new Size(231, 21);

                cb3.Properties.DisplayFormat.FormatString = "n4";
                cb3.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb3.Properties.EditFormat.FormatString    = "n4";
                cb3.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                //  cb3.Properties.Mask.EditMask = "#####0.####";
                cb3.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb3);

                i++;

                lt7.Text     = "建 设 形 式 :";
                lt7.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt7);

                //tt6 = new TextEdit();
                cb4.Location = new Point(157, 26 + 33 * i);
                cb4.Size     = new Size(231, 21);

                cb4.Properties.DisplayFormat.FormatString = "n4";
                cb4.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb4.Properties.EditFormat.FormatString    = "n4";
                cb4.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb4.Properties.Mask.EditMask = "#####0.####";
                cb4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb4);

                i++;

                lt8.Text     = "线路长度(KM):";
                lt8.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt8);

                //tt6 = new TextEdit();
                tt4.Location = new Point(157, 26 + 33 * i);
                tt4.Size     = new Size(231, 21);

                tt4.Properties.DisplayFormat.FormatString = "n4";
                tt4.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                tt4.Properties.EditFormat.FormatString    = "n4";
                tt4.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                //  tt4.Properties.Mask.EditMask = "#####0.####";
                tt4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(tt4);

                i++;

                lt9.Text     = "导 线 型 号 :";
                lt9.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt9);

                //tt6 = new TextEdit();
                cb5.Location = new Point(157, 26 + 33 * i);
                cb5.Size     = new Size(231, 21);

                cb5.Properties.DisplayFormat.FormatString = "n4";
                cb5.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb5.Properties.EditFormat.FormatString    = "n4";
                cb5.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb5.Properties.Mask.EditMask = "#####0.####";
                cb5.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb5);

                i++;

                Project_Sum sum = new Project_Sum();
                sum.S5 = islineflag;
                sum.S1 = q4;
                IList <Project_Sum> list = Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", sum);
                upedit.Properties.DataSource = list;
                LookUpColumnInfo a = new LookUpColumnInfo();
                a.FieldName = "T3";
                a.Caption   = "接线形式";
                LookUpColumnInfo c = new LookUpColumnInfo();
                c.FieldName = "T2";
                c.Caption   = "出线规模";
                LookUpColumnInfo b = new LookUpColumnInfo();
                b.FieldName = "T1";
                b.Caption   = "主变台数及数量";
                LookUpColumnInfo d = new LookUpColumnInfo();
                d.Caption   = "静态投资";
                d.FieldName = "Num";
                LookUpColumnInfo nn = new LookUpColumnInfo();
                nn.FieldName = "Name";
                nn.Caption   = "编号";
                LookUpColumnInfo f = new LookUpColumnInfo();
                f.FieldName = "Type";
                f.Caption   = "类型";
                upedit.Properties.Columns.Add(f);
                upedit.Properties.Columns.Add(nn);
                upedit.Properties.Columns.Add(b);
                upedit.Properties.Columns.Add(c);
                upedit.Properties.Columns.Add(a);
                upedit.Properties.Columns.Add(d);
                upedit.Properties.DisplayMember = "Num";
                //upedit.Properties.SearchMode = SearchMode.AutoComplete;
                //upedit.Properties.AutoSearchColumnIndex = 5;
                upedit.Properties.DropDownRows = 5;
                upedit.Properties.PopupWidth   = 500;
                upedit.Properties.ShowHeader   = true;

                lt10.Text     = "投 资 造 价 :";
                lt10.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt10);
                upedit.Location = new Point(157, 26 + 33 * i);
                upedit.Size     = new Size(231, 21);
                upedit.Properties.DisplayFormat.FormatString = "n4";
                upedit.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                upedit.Properties.EditFormat.FormatString    = "n4";
                upedit.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                upedit.Properties.Mask.EditMask  = "###############0.####";
                upedit.Properties.Mask.MaskType  = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                upedit.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
                upedit.TextChanged += new EventHandler(upedit_TextChanged);
                groupBox1.Controls.Add(upedit);

                i++;

                lt11.Text     = "造 价 比 列 :";
                lt11.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt11);

                //tt6 = new TextEdit();
                tt6.Location = new Point(157, 26 + 33 * i);
                tt6.Size     = new Size(231, 21);

                tt6.Properties.DisplayFormat.FormatString = "n4";
                tt6.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.EditFormat.FormatString    = "n4";
                tt6.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.Mask.EditMask = "###############0.####";
                tt6.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                tt6.TextChanged += new EventHandler(tt6_TextChanged);
                groupBox1.Controls.Add(tt6);

                i++;

                lt12.Text     = "工 程 总 价 :";
                lt12.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt12);

                //tt6 = new TextEdit();
                tt5.Location = new Point(157, 26 + 33 * i);
                tt5.Size     = new Size(231, 21);

                tt5.Properties.DisplayFormat.FormatString = "n4";
                tt5.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.EditFormat.FormatString    = "n4";
                tt5.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.Mask.EditMask = "###############0.####";
                tt5.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

                groupBox1.Controls.Add(tt5);

                i++;
            }

            int j = 0;

            foreach (PowerProYears ppy in li)
            {
                lb[j]          = new Label();
                lb[j].Name     = "Label" + ppy.Year;
                lb[j].Text     = ppy.Year + ":";
                lb[j].Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lb[j]);

                te[j]          = new TextEdit();
                te[j].Name     = "Text" + ppy.Year;
                te[j].Location = new Point(157, 26 + 33 * i);
                te[j].Size     = new Size(231, 21);
                groupBox1.Controls.Add(te[j]);

                foreach (PowerProValues ppy1 in listValues)
                {
                    if (ppy.Year == ppy1.Year)
                    {
                        te[j].Text = ppy1.Value;
                    }
                }
                j++;
                i++;
            }

            if (isline)
            {
                try
                {
                    // cb5.Properties.Items.Contains(q9.ToString());

                    //tt1.Text = q3.ToString();
                    //tt2.Text = q4.ToString();

                    //if (li22 != null)
                    //{
                    //    tt1.Text = li22.Length;
                    //    tt2.Text = li22.LineType;
                    //}
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    ////tt3.Text = q1.ToString();
                    //tt4.Text = q4.ToString();
                    //tt5.Text = q5.ToString();
                    //tt6.Text = q6.ToString();

                    //if (sb != null)
                    //{
                    //    tt5.Text = sb.Number.ToString();
                    //    tt4.Text = sb.ObligateField2;
                    //    tt6.Text = sb.Burthen.ToString();
                    //}
                }
                catch { }
            }

            PSP_PowerProValues_LangFang pplf = new PSP_PowerProValues_LangFang();

            pplf.Flag2 = flag;

            IList <PSP_PowerProValues_LangFang> plfs = Common.Services.BaseService.GetList <PSP_PowerProValues_LangFang>("SelectPSP_PowerProValues_LangFangByFlag2OrderL3", pplf);

            tt4.Text = q8.ToString();
            tt5.Text = q10.ToString();
            tt6.Text = q12.ToString();

            if (plfs.Count == 0)
            {
                cb0.Text = "";
            }
            foreach (PSP_PowerProValues_LangFang pv in plfs)
            {
                if (pv.L3 != "" && pv.L3.Length > 0)
                {
                    cb0.Properties.Items.Add(pv.L3);
                }
            }
            cb0.Text   = q3.ToString();
            cb1.Text   = q4.ToString();
            cb2.Text   = q5.ToString();
            cb3.Text   = q6.ToString();
            cb4.Text   = q7.ToString();
            cb5.Text   = q9.ToString();
            lookupedit = q11;
            upedit.Properties.NullText = q11;
            groupBox1.Size             = new Size(434, 40 + 33 * i);
            simpleButton1.Location     = new Point(296, 60 + 33 * i);
            simpleButton2.Location     = new Point(389, 60 + 33 * i);
            this.Size = new Size(490, 130 + 33 * i);
        }
Пример #19
0
        private void FrmEditProject_Load(object sender, EventArgs e)
        {
            string        q1  = "";
            PowerProTypes ppt = new PowerProTypes();

            ppt.ID    = poweruid;
            ppt.Flag2 = flag;

            PowerProTypes ps = Common.Services.BaseService.GetOneByKey <PowerProTypes>(ppt);

            if (ps != null)
            {
                groupBox1.Text = ps.Title;
                powerid        = ps.Code;
                q1             = ps.Remark;
            }


            LineInfo li22 = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

            if (li22 != null)
            {
                isline = true;
            }

            substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

            if (sb != null)
            {
                isPower = true;
            }


            PowerProValues ppv = new PowerProValues();

            ppv.TypeID  = poweruid;
            ppv.TypeID1 = flag;
            IList <PowerProValues> listValues = Common.Services.BaseService.GetList <PowerProValues>("SelectPowerProValuesList", ppv);



            PowerProYears pps = new PowerProYears();

            pps.Flag = flag;
            IList <PowerProYears> li = Common.Services.BaseService.GetList <PowerProYears>("SelectPowerProYearsListByFlag", pps);

            lb = new Label[li.Count];
            te = new TextEdit[li.Count];

            int i = 0;

            foreach (PowerProYears ppy in li)
            {
                lb[i]          = new Label();
                lb[i].Name     = "Label" + ppy.Year;
                lb[i].Text     = ppy.Year + ":";
                lb[i].Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lb[i]);

                te[i]          = new TextEdit();
                te[i].Name     = "Text" + ppy.Year;
                te[i].Location = new Point(157, 26 + 33 * i);
                te[i].Size     = new Size(231, 21);
                groupBox1.Controls.Add(te[i]);

                foreach (PowerProValues ppy1 in listValues)
                {
                    if (ppy.Year == ppy1.Year)
                    {
                        te[i].Text = ppy1.Value;
                    }
                }

                i++;
            }

            //ls1.Text = "计划开始时间:";
            //ls1.Location = new Point(52, 27 + 33 * i);
            //groupBox1.Controls.Add(ls1);

            //ts1 = new TextEdit();
            //ts1.Location = new Point(157, 27 + 33 * i);
            //ts1.Size = new Size(231, 21);


            //ts1.Properties.DisplayFormat.FormatString = "n0";
            //ts1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            //ts1.Properties.EditFormat.FormatString = "n0";
            //ts1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            //ts1.Properties.Mask.EditMask = "####";
            //ts1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            //groupBox1.Controls.Add(ts1);


            //ls2.Text = "预计投产时间:";
            //ls2.Location = new Point(52, 60 + 33 * i);
            //groupBox1.Controls.Add(ls2);

            //ts2 = new TextEdit();
            //ts2.Location = new Point(157, 60 + 33 * i);
            //ts2.Size = new Size(231, 21);

            //ts2.Properties.DisplayFormat.FormatString = "n0";
            //ts2.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            //ts2.Properties.EditFormat.FormatString = "n0";
            //ts2.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            //ts2.Properties.Mask.EditMask = "####";
            //ts2.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            //groupBox1.Controls.Add(ts2);



            ls3.Text     = "备注:";
            ls3.Location = new Point(52, 27 + 33 * i);
            groupBox1.Controls.Add(ls3);

            ts3          = new TextEdit();
            ts3.Location = new Point(157, 27 + 33 * i);
            ts3.Size     = new Size(231, 21);
            groupBox1.Controls.Add(ts3);

            ts3.Text = q1;


            if (isline)
            {
                la.Text     = "长度:";
                la.Location = new Point(52, 61 + 33 * i);
                groupBox1.Controls.Add(la);

                ta          = new TextEdit();
                ta.Location = new Point(157, 60 + 33 * i);
                ta.Size     = new Size(231, 21);
                groupBox1.Controls.Add(ta);

                lb1.Text     = "型号:";
                lb1.Location = new Point(52, 61 + 33 * (i + 1));
                groupBox1.Controls.Add(lb1);

                tb          = new TextEdit();
                tb.Location = new Point(157, 60 + 33 * (i + 1));
                tb.Size     = new Size(231, 21);
                groupBox1.Controls.Add(tb);

                try
                {
                    if (li22 != null)
                    {
                        ta.Text = li22.Length;
                        tb.Text = li22.LineType;
                    }
                }
                catch { }
            }
            if (isPower)
            {
                l11.Text     = "容量:";
                l11.Location = new Point(52, 61 + 33 * i);
                groupBox1.Controls.Add(l11);

                t11          = new TextEdit();
                t11.Location = new Point(157, 60 + 33 * i);
                t11.Size     = new Size(231, 21);
                groupBox1.Controls.Add(t11);


                l33.Text     = "负荷率:";
                l33.Location = new Point(52, 61 + 33 * (i + 1));
                groupBox1.Controls.Add(l33);

                t33          = new TextEdit();
                t33.Location = new Point(157, 60 + 33 * (i + 1));
                t33.Size     = new Size(231, 21);
                groupBox1.Controls.Add(t33);

                try
                {
                    if (sb != null)
                    {
                        t11.Text = sb.Burthen.ToString();
                        t33.Text = sb.ObligateField2;
                    }
                }
                catch { }
            }

            groupBox1.Size         = new Size(434, 124 + 33 * i);
            simpleButton1.Location = new Point(296, 144 + 33 * i);
            simpleButton2.Location = new Point(389, 144 + 33 * i);
            this.Size = new Size(490, 224 + 33 * i);
        }
Пример #20
0
        private void InitSodata2()
        {
            string sid = selectid;

            if (sid == "")
            {
                return;
            }


            Hashtable hs1 = new Hashtable();
            Hashtable hs3 = new Hashtable();



            substation suub = new substation();

            suub.UID     = sid;
            suub.EleName = leixing;
            IList <substation> listsubstation = Services.BaseService.GetList <substation>("SelectsubstationByPowerID1", sid);

            foreach (substation s1 in listsubstation)
            {
                hs1.Add(Guid.NewGuid().ToString(), s1.UID);
            }


            IList <Substation_Info> ll2 = Common.Services.BaseService.GetList <Substation_Info>("SelectSubstation_InfoByFlag", sid);

            foreach (Substation_Info ps in ll2)
            {
                hs3.Add(Guid.NewGuid().ToString(), ps.Code);
            }

            foreach (Substation_Info p2 in ll2)
            {
                if (p2.Code != "" && !hs1.ContainsValue(p2.Code))
                {
                    //删除
                    Services.BaseService.Delete <Substation_Info>(p2);
                }
            }


            foreach (substation s2 in listsubstation)
            {
                if (!hs3.ContainsValue(s2.UID) && s2.ObligateField1 != "")
                {
                    //添加
                    try
                    {
                        Substation_Info substation1 = new Substation_Info();
                        substation1.L1    = int.Parse(s2.ObligateField1);
                        substation1.Title = s2.EleName;
                        substation1.Code  = s2.UID;
                        substation1.Flag  = sid;

                        try
                        {
                            substation1.L1 = int.Parse(s2.ObligateField1);
                        }
                        catch { }

                        try
                        {
                            substation1.L10 = double.Parse(s2.ObligateField2);
                        }
                        catch { }

                        try
                        {
                            substation1.L2 = Convert.ToDouble(s2.Number);
                        }
                        catch { }

                        try
                        {
                            substation1.L9 = Convert.ToDouble(s2.Burthen);
                        }
                        catch { }
                        substation1.AreaID = ProjectUID;
                        Services.BaseService.Create <Substation_Info>(substation1);
                    }
                    catch { }
                }
            }
        }
Пример #21
0
        private void FormAddInfo_LangFang_Load(object sender, EventArgs e)
        {
            if (isupdate == true)
            {
                PSP_Project_List ppt = new PSP_Project_List();
                ppt.ID    = poweruid;
                ppt.Flag2 = flag;
                //obj = (PSP_Project_List)Common.Services.BaseService.GetObject("SelectPSP_Project_ListByKey", ppt);
                obj     = Common.Services.BaseService.GetOneByKey <PSP_Project_List>(ppt);
                OBJ     = obj;
                powerid = obj.Code;
                if (OBJ.Flag == 2)
                {
                    OBJ.L19 = "变电站";
                }
                else
                {
                    OBJ.L19 = "线路";
                }
                isupdate = true;
                UpDateInit();
                IList <PSP_Project_List> list = new List <PSP_Project_List>();
                list.Add(OBJ);
                this.vGridControl1.DataSource = list;
            }

            if (isupdate == false)
            {
                OBJ.ID         = Guid.NewGuid().ToString();
                OBJ.CreateTime = DateTime.Now;
                OBJ.UpdateTime = DateTime.Now;
                OBJ.ParentID   = parentID;
                OBJ.Flag2      = flag;

                OBJ.Flag = 2;
                OBJ.L4   = "220";
                OBJ.L5   = "1";
                OBJ.L7   = "户内站";
                OBJ.L11  = "0";
                OBJ.L12  = 0;
                OBJ.L10  = 0;
                OBJ.L19  = "变电站";
                CreateInit();
                IList <PSP_Project_List> list = new List <PSP_Project_List>();
                list.Add(OBJ);
                this.vGridControl1.DataSource = list;
            }


            this.电压等级.Properties.RowEdit.Click          += new EventHandler(RowEdit_Click);
            this.类型.Properties.RowEdit.EditValueChanged += new EventHandler(RowEdit_EditValueChanged);

            LineInfo li22 = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

            if (li22 != null || OBJ.Flag == 1)
            {
                isline = true;
            }
            substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

            if (sb != null || OBJ.Flag == 2)
            {
                isPower = true;
            }
        }
Пример #22
0
        //加载设备情况表列字段
        private void LoadData()
        {
            try
            {
                if (dataTable != null)
                {
                    dataTable.Columns.Clear();
                    treeList1.Columns.Clear();
                }

                PowerProTypes psp_Type = new PowerProTypes();
                psp_Type.Flag2 = typeFlag2;
                IList listTypes = new ArrayList();
                try
                {
                    listTypes = Common.Services.BaseService.GetList("SelectPowerProTypesByFlag2", psp_Type);
                }
                catch (Exception ex)
                { MsgBox.Show(ex.Message); }
                dataTable = Itop.Common.DataConverter.ToDataTable(listTypes, typeof(PowerProTypes));

                foreach (DataRow rw in dataTable.Rows)
                {
                    string   ss = rw["Code"].ToString();
                    LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(ss);
                    if (li != null && li.EleID != "")
                    {
                        rw["Title"] = li.LineName;
                        rw["L3"]    = li.Length;
                        rw["L4"]    = li.LineType;
                    }
                    substation li1 = Common.Services.BaseService.GetOneByKey <substation>(ss);
                    if (li1 != null && li1.EleID != "")
                    {
                        rw["Title"] = li1.EleName;
                        rw["L5"]    = li1.ObligateField2;
                        rw["L2"]    = li1.Number;
                        rw["L6"]    = li1.Burthen;
                    }
                }



                treeList1.DataSource = dataTable;

                treeList1.Columns["Title"].Caption = "项目名称";
                treeList1.Columns["Title"].Width   = 180;
                treeList1.Columns["Title"].OptionsColumn.AllowEdit = false;
                treeList1.Columns["Title"].OptionsColumn.AllowSort = false;
                treeList1.Columns["Flag"].VisibleIndex             = -1;
                treeList1.Columns["Flag"].OptionsColumn.ShowInCustomizationForm = false;
                treeList1.Columns["Flag"].SortOrder     = System.Windows.Forms.SortOrder.Ascending;
                treeList1.Columns["Flag2"].VisibleIndex = -1;
                treeList1.Columns["Flag2"].OptionsColumn.ShowInCustomizationForm = false;

                treeList1.Columns["CreateTime"].VisibleIndex = -1;
                treeList1.Columns["CreateTime"].OptionsColumn.ShowInCustomizationForm = false;
                treeList1.Columns["CreateTime"].SortOrder = System.Windows.Forms.SortOrder.Ascending;


                treeList1.Columns["UpdateTime"].VisibleIndex = -1;
                treeList1.Columns["UpdateTime"].OptionsColumn.ShowInCustomizationForm = false;


                treeList1.Columns["IsConn"].VisibleIndex = -1;
                treeList1.Columns["IsConn"].OptionsColumn.ShowInCustomizationForm = false;

                treeList1.Columns["StartYear"].VisibleIndex = -1;
                treeList1.Columns["StartYear"].OptionsColumn.ShowInCustomizationForm = false;

                treeList1.Columns["EndYear"].VisibleIndex = -1;
                treeList1.Columns["EndYear"].OptionsColumn.ShowInCustomizationForm = false;


                AddColumn2();


                PowerProYears psp_Year = new PowerProYears();
                psp_Year.Flag = typeFlag2;
                IList <PowerProYears> listYears = Common.Services.BaseService.GetList <PowerProYears>("SelectPowerProYearsListByFlag", psp_Year);

                foreach (PowerProYears item in listYears)
                {
                    AddColumn(item.Year);
                }

                AddColumn1();


                Application.DoEvents();

                LoadValues();

                treeList1.ExpandAll();
            }
            catch
            {
            }
        }
Пример #23
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < te.Length; i++)
            {
                SaveCellValue(te[i].Name.Replace("Text", ""), poweruid, te[i].Text.Trim());
            }



            if (isline)
            {
                try
                {
                    LineInfo li = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

                    if (li != null)
                    {
                        li.Length   = tt1.Text;
                        li.LineType = tt2.Text;// tb.Text;
                        Common.Services.BaseService.Update <LineInfo>(li);
                    }
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

                    if (sb != null)
                    {
                        try
                        {
                            sb.Number  = decimal.Parse(tt4.Text);
                            sb.Burthen = decimal.Parse(tt6.Text);
                        }
                        catch { }
                        sb.ObligateField2 = tt5.Text;
                        Common.Services.BaseService.Update <substation>(sb);
                    }
                }
                catch { }
            }



            try
            {
                PowerProTypes ppts = new PowerProTypes();
                ppts.ID    = poweruid;
                ppts.Flag2 = flag;


                PowerProTypes ppt1 = Common.Services.BaseService.GetOneByKey <PowerProTypes>(ppts);
                try
                {
                    if (!isstuff)
                    {
                        ppt1.StartYear = int.Parse(ts1.Text);
                        ppt1.EndYear   = int.Parse(ts2.Text);
                    }
                    ppt1.Remark = ts3.Text;

                    if (isline)
                    {
                        if (tt1.Text != "")
                        {
                            ppt1.L3 = double.Parse(tt1.Text);
                        }
                        if (tt2.Text != "")
                        {
                            ppt1.L4 = tt2.Text;
                        }
                    }
                    if (isPower)
                    {
                        if (tt3.Text != "")
                        {
                            ppt1.L1 = double.Parse(tt3.Text);
                        }
                        if (tt4.Text != "")
                        {
                            ppt1.L2 = double.Parse(tt4.Text);
                        }
                        if (tt5.Text != "")
                        {
                            ppt1.L5 = double.Parse(tt5.Text);
                        }
                        if (tt6.Text != "")
                        {
                            ppt1.L6 = double.Parse(tt6.Text);
                        }
                    }
                    //ppt1.Col1 = ts4.Text;
                }
                catch { }
                Common.Services.BaseService.Update <PowerProTypes>(ppt1);
            }
            catch { }


            this.DialogResult = DialogResult.OK;
        }
Пример #24
0
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }

            if (treeList1.FocusedNode.ParentNode == null)
            {
                MsgBox.Show("一级项目名称不能修改!");
                return;
            }

            FormTitleEdit frm = new FormTitleEdit();

            frm.TypeTitle = treeList1.FocusedNode.GetValue("Title").ToString();
            try
            {
                if (treeList1.FocusedNode["Flag"].ToString() == "2")
                {
                    frm.PowerType = 2;
                }
                else
                {
                    frm.PowerType = 1;
                }
            }
            catch { }
            frm.Text     = "修改项目";
            frm.Isupdate = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string id     = treeList1.FocusedNode["ID"].ToString();
                    string flag22 = typeFlag2;

                    PowerProTypes pptss = new PowerProTypes();
                    pptss.ID    = id;
                    pptss.Flag2 = flag22;


                    PowerProTypes psp_Type = Services.BaseService.GetOneByKey <PowerProTypes>(pptss);
                    psp_Type.Title = frm.TypeTitle;
                    psp_Type.Flag  = frm.PowerType;


                    if (psp_Type.Code != "")
                    {
                        LineInfo li3 = Services.BaseService.GetOneByKey <LineInfo>(psp_Type.Code);
                        if (li3 != null)
                        {
                            li3.LineName = psp_Type.Title;
                            Common.Services.BaseService.Update <LineInfo>(li3);
                        }

                        substation sb3 = Services.BaseService.GetOneByKey <substation>(psp_Type.Code);
                        if (sb3 != null)
                        {
                            sb3.EleName = psp_Type.Title;
                            Common.Services.BaseService.Update <substation>(sb3);
                        }
                    }

                    Common.Services.BaseService.Update <PowerProTypes>(psp_Type);
                    treeList1.FocusedNode.SetValue("Title", frm.TypeTitle);

                    //FoucsLocation(id, treeList1.Nodes);
                }
                catch (Exception ex)
                {
                    MsgBox.Show("修改出错:" + ex.Message);
                }
            }
        }
Пример #25
0
        public void InitData()
        {
            IList      svglist   = Services.BaseService.GetList("SelectLayerFileList", svg);
            LayerGrade lg        = new LayerGrade();
            IList      ilist     = Services.BaseService.GetList("SelectLayerGradeList", lg);
            DataTable  dataTable = DataConverter.ToDataTable(ilist, typeof(LayerGrade));
            SVG_LAYER  sl        = new SVG_LAYER();
            IList      list      = Services.BaseService.GetList("SelectSVG_LAYERList", sl);

            treeList1.DataSource = dataTable;
            string ide = treeList1.Nodes[0].GetValue(0).ToString();//获取某一节点的值

            foreach (SVG_LAYER lay in list)
            {
                if (lay.layerType == "电网规划层")
                {
                    LayerGrade obj = new LayerGrade();
                    obj.SUID     = lay.SUID;
                    obj.Name     = lay.NAME;
                    obj.ParentID = lay.YearID;
                    string tempobj  = "";
                    string tempyear = "";
                    if (obj.Name.ToString().Length >= 3)
                    {
                        tempobj = obj.Name.ToString().Substring(obj.Name.ToString().Length - 3, 3);
                    }
                    if (obj.Name.ToString().Length >= 4)
                    {
                        tempyear = obj.Name.ToString().Substring(0, 4);
                    }
                    if (tempobj == "变电站")
                    {
                        for (int j = 0; j < treeList1.Nodes.Count; j++)
                        {
                            if (treeList1.Nodes[j].GetValue(0).ToString().Length > 3)
                            {
                                if (treeList1.Nodes[j].GetValue(0).ToString().Substring(0, 4) == tempyear)
                                {
                                    substation _substat = new substation();
                                    _substat.LayerID        = obj.SUID;
                                    _substat.ObligateField1 = "220";
                                    IList subList = Services.BaseService.GetList("SelectsubstationByLayerIDandObligateField1", _substat);

                                    int templ = treeList1.Nodes[j].Nodes.Count;
                                    treeList1.AppendNode(obj.Name, treeList1.Nodes[j]);
                                    treeList1.Nodes[j].Nodes[templ].SetValue(0, obj.Name);
                                    if (subList.Count != 0)
                                    {
                                        int jj = 0;
                                        foreach (substation temps in subList)
                                        {
                                            treeList1.AppendNode(temps, treeList1.Nodes[j].Nodes[templ]);
                                            treeList1.Nodes[j].Nodes[templ].Nodes[jj].SetValue(0, temps.EleName);
                                            jj++;
                                        }
                                    }
                                    _substat.ObligateField1 = "110";
                                    subList = Services.BaseService.GetList("SelectsubstationByLayerIDandObligateField1", _substat);

                                    templ = treeList1.Nodes[j].Nodes.Count;
                                    treeList1.AppendNode(obj.Name, treeList1.Nodes[j]);
                                    treeList1.Nodes[j].Nodes[templ].SetValue(0, obj.Name);
                                    if (subList.Count != 0)
                                    {
                                        int jj = 0;
                                        foreach (substation temps in subList)
                                        {
                                            treeList1.AppendNode(temps, treeList1.Nodes[j].Nodes[templ]);
                                            treeList1.Nodes[j].Nodes[templ].Nodes[jj].SetValue(0, temps.EleName);
                                            jj++;
                                        }
                                    }
                                    _substat.ObligateField1 = "66";
                                    subList = Services.BaseService.GetList("SelectsubstationByLayerIDandObligateField1", _substat);

                                    templ = treeList1.Nodes[j].Nodes.Count;
                                    treeList1.AppendNode(obj.Name, treeList1.Nodes[j]);
                                    treeList1.Nodes[j].Nodes[templ].SetValue(0, obj.Name);
                                    if (subList.Count != 0)
                                    {
                                        int jj = 0;
                                        foreach (substation temps in subList)
                                        {
                                            treeList1.AppendNode(temps, treeList1.Nodes[j].Nodes[templ]);
                                            treeList1.Nodes[j].Nodes[templ].Nodes[jj].SetValue(0, temps.EleName);
                                            jj++;
                                        }
                                    }
                                    _substat.ObligateField1 = "500";
                                    subList = Services.BaseService.GetList("SelectsubstationByLayerIDandObligateField1", _substat);

                                    templ = treeList1.Nodes[j].Nodes.Count;
                                    treeList1.AppendNode(obj.Name, treeList1.Nodes[j]);
                                    treeList1.Nodes[j].Nodes[templ].SetValue(0, obj.Name);
                                    if (subList.Count != 0)
                                    {
                                        int jj = 0;
                                        foreach (substation temps in subList)
                                        {
                                            treeList1.AppendNode(temps, treeList1.Nodes[j].Nodes[templ]);
                                            treeList1.Nodes[j].Nodes[templ].Nodes[jj].SetValue(0, temps.EleName);
                                            jj++;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            Application.DoEvents();
        }