Esempio n. 1
0
        public override void Add()
        {
            frmPWKGdlg dlg = new frmPWKGdlg();

            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            dlg.Name = "";

            PSPDEV pd = new PSPDEV();

            pd.ProjectID = this.ProjectID;
            pd.IName     = ParentID;
            dlg.DeviceMx = pd;
            Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
            //Assembly.GetExecutingAssembly().GetManifestResourceStream
            XmlDocument xml = new XmlDocument();

            xml.Load(fs);
            XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");

            if (ID != null)
            {
                dlg.Text = node.Attributes["name"].Value.ToString() + "信息";
            }
            if (ID == "55")
            {
                dlg.Text = "开关站信息";
            }
            if (ID == "56")
            {
                dlg.Text = "环网柜信息";
            }
            if (ID == "57")
            {
                dlg.Text = "柱上开关信息";
            }
            if (ID == "58")
            {
                dlg.Text = "电缆分支箱信息";
            }
            if (ID == "59")
            {
                dlg.Text = "负荷开关信息";
            }
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                PSPDEV dev = dlg.DeviceMx;
                dev.Type      = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row = datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
Esempio n. 2
0
        public override void Edit()
        {
            frmPWKGdlg dlg = new frmPWKGdlg();

            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);

            if (row != null)
            {
                PSPDEV dev = Itop.Common.DataConverter.RowToObject <PSPDEV>(row);


                dlg.DeviceMx  = dev;
                dlg.ProjectID = dev.ProjectID;
                Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
                //Assembly.GetExecutingAssembly().GetManifestResourceStream
                XmlDocument xml = new XmlDocument();
                xml.Load(fs);
                XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");
                if (node != null)
                {
                    dlg.Text = node.Attributes["name"].Value.ToString() + "信息";
                }
                if (ID == "55")
                {
                    dlg.Text = "开关站信息";
                }
                if (ID == "56")
                {
                    dlg.Text = "环网柜信息";
                }
                if (ID == "57")
                {
                    dlg.Text = "柱上开关信息";
                }
                if (ID == "58")
                {
                    dlg.Text = "电缆分支箱信息";
                }
                if (ID == "59")
                {
                    dlg.Text = "负荷开关信息";
                }
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //更新记录
                    dev           = dlg.DeviceMx;
                    dev.ProjectID = this.ProjectID;
                    dev.Type      = ID;
                    UCDeviceBase.DataService.Update <PSPDEV>(dev);

                    Itop.Common.DataConverter.ObjectToRow(dev, row);
                }
            }
        }
Esempio n. 3
0
        public override void Add()
        {
            frmPWKGdlg dlg = new frmPWKGdlg();
            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            dlg.Name = "";

            PSPDEV pd = new PSPDEV();
            pd.ProjectID = this.ProjectID;
            pd.IName = ParentID;
            dlg.DeviceMx = pd;
            Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
            //Assembly.GetExecutingAssembly().GetManifestResourceStream
            XmlDocument xml = new XmlDocument();
            xml.Load(fs);
            XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");
            if (ID!=null)
            {
                dlg.Text = node.Attributes["name"].Value.ToString() + "��Ϣ";
            }
            if(ID=="55"){
                dlg.Text = "����վ��Ϣ";
            }
            if (ID == "56")
            {
                dlg.Text = "��������Ϣ";
            }
            if (ID == "57")
            {
                dlg.Text = "���Ͽ�����Ϣ";
            }
            if (ID == "58")
            {
                dlg.Text = "���·�֧����Ϣ";
            }
            if (ID == "59")
            {
                dlg.Text = "���ɿ�����Ϣ";
            }
            if (dlg.ShowDialog() == DialogResult.OK) {
                //���Ӽ�¼
                PSPDEV dev = dlg.DeviceMx;
                dev.Type = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row=datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
Esempio n. 4
0
        public override void Edit()
        {
            frmPWKGdlg dlg = new frmPWKGdlg();
            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            if (row != null)
            {
                PSPDEV dev = Itop.Common.DataConverter.RowToObject<PSPDEV>(row);

                dlg.DeviceMx = dev;
                dlg.ProjectID = dev.ProjectID;
                Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
                //Assembly.GetExecutingAssembly().GetManifestResourceStream
                XmlDocument xml = new XmlDocument();
                xml.Load(fs);
                XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");
                if (node != null)
                {
                    dlg.Text = node.Attributes["name"].Value.ToString()+"��Ϣ";
                }
                if (ID == "55")
                {
                    dlg.Text = "����վ��Ϣ";
                }
                if (ID == "56")
                {
                    dlg.Text = "��������Ϣ";
                }
                if (ID == "57")
                {
                    dlg.Text = "���Ͽ�����Ϣ";
                }
                if (ID == "58")
                {
                    dlg.Text = "���·�֧����Ϣ";
                }
                if (ID == "59")
                {
                    dlg.Text = "���ɿ�����Ϣ";
                }
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //���¼�¼
                    dev = dlg.DeviceMx;
                    dev.ProjectID = this.ProjectID;
                    dev.Type = ID;
                    UCDeviceBase.DataService.Update<PSPDEV>(dev);

                    Itop.Common.DataConverter.ObjectToRow(dev, row);
                }
            }
        }