예제 #1
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);
         frmTransformLine dlgTransforLine = new frmTransformLine(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.K             = Convert.ToDouble(dlgTransforLine.K);
             dev.G             = Convert.ToDouble(dlgTransforLine.G);
             dev.ReferenceVolt = Convert.ToDouble(dlgTransforLine.ReferenceVolt);
             dev.HuganLine1    = dlgTransforLine.FirstNodeName;
             dev.HuganLine2    = dlgTransforLine.LastNodeName;
             Services.BaseService.Update <PSPDEV>(dev);
             InitData();
         }
     }
 }
예제 #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            frmTransformLine dlgTransforLine = new frmTransformLine(svgUID);
            DialogResult     dd = dlgTransforLine.ShowDialog();

            if (dd == DialogResult.OK)
            {
                PSPDEV dev = new PSPDEV();
                dev.SUID   = Guid.NewGuid().ToString();
                dev.SvgUID = svgUID;
                dev.Type   = "TransformLine";
                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.LastNodeName;
                dev.G             = Convert.ToDouble(dlgTransforLine.G);
                Services.BaseService.Create <PSPDEV>(dev);
                InitData();
            }
        }