示例#1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            frmGNDLine   dlgTransforLine = new frmGNDLine(svgUID);
            DialogResult dd = dlgTransforLine.ShowDialog();

            if (dd == DialogResult.OK)
            {
                PSPDEV dev = new PSPDEV();
                dev.SUID   = Guid.NewGuid().ToString();
                dev.SvgUID = svgUID;
                dev.Type   = "GNDLine";
                dev.Lable  = "接地支路";
                dev.Name   = dlgTransforLine.Name;
                if (dlgTransforLine.LineR == null)
                {
                    dlgTransforLine.LineR = "0";
                }
                if (dlgTransforLine.LineTQ == null)
                {
                    dlgTransforLine.LineTQ = "0";
                }
                if (dlgTransforLine.LineGNDC == null)
                {
                    dlgTransforLine.LineGNDC = "0";
                }
                if (dlgTransforLine.K == null)
                {
                    dlgTransforLine.K = "0";
                }
                if (dlgTransforLine.G == null)
                {
                    dlgTransforLine.G = "0";
                }
                dev.LineR         = Convert.ToDouble(dlgTransforLine.LineR);
                dev.LineTQ        = Convert.ToDouble(dlgTransforLine.LineTQ);
                dev.LineGNDC      = Convert.ToDouble(dlgTransforLine.LineGNDC);
                dev.K             = Convert.ToDouble(dlgTransforLine.K);
                dev.ReferenceVolt = Convert.ToDouble(dlgTransforLine.ReferenceVolt);
                dev.HuganLine1    = dlgTransforLine.FirstNodeName;
                dev.HuganLine2    = dlgTransforLine.FirstNodeName;
                dev.G             = Convert.ToDouble(dlgTransforLine.G);
                Services.BaseService.Create <PSPDEV>(dev);
                InitData();
            }
        }
示例#2
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow != null)
     {
         DataTable    dt              = dataGridView1.DataSource as DataTable;
         DataRow      dr              = dt.Rows[dataGridView1.CurrentRow.Index];
         PSPDEV       dev             = Itop.Common.DataConverter.RowToObject <PSPDEV>(dr);
         frmGNDLine   dlgTransforLine = new frmGNDLine(svgUID, dev);
         DialogResult dd              = dlgTransforLine.ShowDialog();
         if (dd == DialogResult.OK)
         {
             dev.Name = dlgTransforLine.Name;
             if (dlgTransforLine.LineR == null)
             {
                 dlgTransforLine.LineR = "0";
             }
             if (dlgTransforLine.LineTQ == null)
             {
                 dlgTransforLine.LineTQ = "0";
             }
             if (dlgTransforLine.LineGNDC == null)
             {
                 dlgTransforLine.LineGNDC = "0";
             }
             if (dlgTransforLine.K == null)
             {
                 dlgTransforLine.K = "0";
             }
             if (dlgTransforLine.G == null)
             {
                 dlgTransforLine.G = "0";
             }
             dev.LineR         = Convert.ToDouble(dlgTransforLine.LineR);
             dev.LineTQ        = Convert.ToDouble(dlgTransforLine.LineTQ);
             dev.LineGNDC      = Convert.ToDouble(dlgTransforLine.LineGNDC);
             dev.ReferenceVolt = Convert.ToDouble(dlgTransforLine.ReferenceVolt);
             dev.K             = Convert.ToDouble(dlgTransforLine.K);
             dev.G             = Convert.ToDouble(dlgTransforLine.G);
             dev.HuganLine1    = dlgTransforLine.FirstNodeName;
             dev.HuganLine2    = dlgTransforLine.LastNodeName;
             Services.BaseService.Update <PSPDEV>(dev);
             InitData();
         }
     }
 }
示例#3
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     frmGNDLine dlgTransforLine = new frmGNDLine(svgUID);
     DialogResult dd = dlgTransforLine.ShowDialog();
     if (dd == DialogResult.OK)
     {
         PSPDEV dev = new PSPDEV();
         dev.SUID = Guid.NewGuid().ToString();
         dev.SvgUID = svgUID;
         dev.Type = "GNDLine";
         dev.Lable = "接地支路";
         dev.Name = dlgTransforLine.Name;
         if (dlgTransforLine.LineR==null)
         {
             dlgTransforLine.LineR = "0";
         }
         if (dlgTransforLine.LineTQ == null)
         {
             dlgTransforLine.LineTQ = "0";
         }
         if (dlgTransforLine.LineGNDC == null)
         {
             dlgTransforLine.LineGNDC = "0";
         }
         if (dlgTransforLine.K == null)
         {
             dlgTransforLine.K = "0";
         }
         if (dlgTransforLine.G == null)
         {
             dlgTransforLine.G = "0";
         }
         dev.LineR = Convert.ToDouble(dlgTransforLine.LineR);
         dev.LineTQ = Convert.ToDouble(dlgTransforLine.LineTQ);
         dev.LineGNDC = Convert.ToDouble(dlgTransforLine.LineGNDC);
         dev.K = Convert.ToDouble(dlgTransforLine.K);
         dev.ReferenceVolt = Convert.ToDouble(dlgTransforLine.ReferenceVolt);
         dev.HuganLine1 = dlgTransforLine.FirstNodeName;
         dev.HuganLine2 = dlgTransforLine.FirstNodeName;
         dev.G = Convert.ToDouble(dlgTransforLine.G);
         Services.BaseService.Create<PSPDEV>(dev);
         InitData();
     }
 }
示例#4
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow!=null)
     {
         DataTable dt = dataGridView1.DataSource as DataTable;
         DataRow dr = dt.Rows[dataGridView1.CurrentRow.Index];
         PSPDEV dev = Itop.Common.DataConverter.RowToObject<PSPDEV>(dr);
         frmGNDLine dlgTransforLine = new frmGNDLine(svgUID,dev);
         DialogResult dd = dlgTransforLine.ShowDialog();
         if (dd == DialogResult.OK)
         {
             dev.Name = dlgTransforLine.Name;
             if (dlgTransforLine.LineR == null)
             {
                 dlgTransforLine.LineR = "0";
             }
             if (dlgTransforLine.LineTQ == null)
             {
                 dlgTransforLine.LineTQ = "0";
             }
             if (dlgTransforLine.LineGNDC == null)
             {
                 dlgTransforLine.LineGNDC = "0";
             }
             if (dlgTransforLine.K == null)
             {
                 dlgTransforLine.K = "0";
             }
             if (dlgTransforLine.G == null)
             {
                 dlgTransforLine.G = "0";
             }
             dev.LineR = Convert.ToDouble(dlgTransforLine.LineR);
             dev.LineTQ = Convert.ToDouble(dlgTransforLine.LineTQ);
             dev.LineGNDC = Convert.ToDouble(dlgTransforLine.LineGNDC);
             dev.ReferenceVolt = Convert.ToDouble(dlgTransforLine.ReferenceVolt);
             dev.K = Convert.ToDouble(dlgTransforLine.K);
             dev.G = Convert.ToDouble(dlgTransforLine.G);
             dev.HuganLine1 = dlgTransforLine.FirstNodeName;
             dev.HuganLine2 = dlgTransforLine.LastNodeName;
             Services.BaseService.Update<PSPDEV>(dev);
             InitData();
         }
     }
 }