Exemplo n.º 1
0
        public static object SelectDevice(string type)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType(type);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                return(dlg.GetSelectedDevice()["device"]);
            }
            return(null);
        }
Exemplo n.º 2
0
        private void comboBoxEdit2_Properties_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("01");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                PSPDEV devzx = dic["device"] as PSPDEV;
                S1 = devzx.SUID;
            }
        }
Exemplo n.º 3
0
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();


            dlg.InitDeviceType("20", "30");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                buttonEdit1.Text = dic["name"].ToString();
                dev.SvgUID       = dic["id"].ToString();
            }
        }
Exemplo n.º 4
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();


            dlg.InitDeviceType("05", "07", "54", "55", "56", "57", "62", "63", "64", "70", "71", "73", "74");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.JName        = dic["id"].ToString();
            }
        }
Exemplo n.º 5
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();


            dlg.InitDeviceType("20", "30");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.SvgUID       = dic["id"].ToString();
            }
        }
Exemplo n.º 6
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("01");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                PSPDEV dev = dic["device"] as PSPDEV;
                dev.SvgUID = bdz.UID;
                Services.BaseService.Update <PSPDEV>(dev);
                freshxl();
            }
        }
Exemplo n.º 7
0
        private void simpleButton5_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("70", "71", "72", "57", "59", "61", "62", "63", "64");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                PSPDEV devzx = dic["device"] as PSPDEV;
                devzx.AreaID = dev.SUID;
                Services.BaseService.Update <PSPDEV>(devzx);
                initList();
            }
        }
Exemplo n.º 8
0
        public static DialogResult SelectDeviceDLG(string projectID, params string[] type)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.ProjectID = projectID;
            dlg.pspflag   = pspflag;
            dlg.wjghflag  = Wjghflag;
            dlg.wjghuid   = wjghuid;
            dlg.BdzWhere  = bdzwhere;
            dlg.XlWhere   = xlwhere;

            dlg.InitDeviceType(type);
            return(dlg.ShowDialog());
        }
Exemplo n.º 9
0
        /// <summary>
        /// 获取设备对象
        /// </summary>
        /// <typeparam name="type"></typeparam>
        /// <param name="uid"></param>
        /// <returns></returns>
        //根据短路的元件类型 type项目projectSUID和卷项目projectid来获得这个项目的所有元件
        public static object SelectProjectDevice(string type, string projectSUID, string projectid, List <eleclass> selshortelement)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.shortflag       = true;
            dlg.ProjectSuid     = projectSUID;
            dlg.shortselelement = selshortelement;
            dlg.ProjectID       = projectid;
            dlg.InitDeviceType(type);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                return(dlg.GetSelectedDevice()["device"]);
            }
            return(null);
        }
Exemplo n.º 10
0
        private void lookUpEdit1_Properties_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("05", "73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                PSPDEV devzx = dic["device"] as PSPDEV;
                lookUpEdit1.EditValue = dev.SUID;
                string sql  = " where  (type ='70') and AreaID='" + devzx.SUID + "'order by number";
                IList  list = Services.BaseService.GetList("SelectPSPDEVByCondition", sql);
                lookUpEdit2.Properties.DataSource = list;
            }
        }
Exemplo n.º 11
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();


            dlg.InitDeviceType("05", "73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.JName        = dic["id"].ToString();
                string         sql  = "where AreaID='" + dic["id"].ToString() + "' and type='70' ORDER BY Number";
                IList <PSPDEV> list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", sql);
                lookUpEdit2.Properties.DataSource = list;
            }
        }
Exemplo n.º 12
0
        public static object SelectDevice(string type, string projectID, IList <object> list)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.ProjectID = projectID;
            dlg.pspflag   = pspflag;
            dlg.wjghflag  = Wjghflag;
            dlg.wjghuid   = wjghuid;
            dlg.ListUID   = list;
            dlg.InitDeviceType(type);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                return(dlg.GetSelectedDevice()["device"]);
            }
            return(null);
        }
Exemplo n.º 13
0
        public static object SelectDevice(string type, string projectID)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.ProjectID = projectID;
            dlg.pspflag   = pspflag;
            dlg.wjghflag  = Wjghflag;
            dlg.wjghuid   = wjghuid;
            dlg.subflag   = subflag;
            dlg.InitDeviceType(type);
            dlg.BdzWhere = bdzwhere;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                return(dlg.GetSelectedDevice()["device"]);
            }
            return(null);
        }
Exemplo n.º 14
0
        private void lookUpEdit1_Properties_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();


            dlg.InitDeviceType("01", "74");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary <string, object> dic = dlg.GetSelectedDevice();
                lookUpEdit1.EditValue = dic["id"].ToString();
                PSPDEV pdv = dic["device"] as PSPDEV;
                if (pdv.Type == "01")
                {
                    dev.FirstNode = pdv.Number;
                }
                else
                {
                    dev.FirstNode = pdv.FirstNode;
                }
            }
        }
Exemplo n.º 15
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

               // dlg.InitDeviceType("05", "07", "54", "55", "56", "57", "62", "63", "64", "70", "71", "73");
             dlg.InitDeviceType("05","73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();

                if (!string.IsNullOrEmpty(dic["id"].ToString()))
                {
                    if (dic["id"].ToString()==dev.SUID)
                    {
                        MessageBox.Show("����ѡ�Լ���Ϊ����֧·��������ѡ��");
                        return;
                    }
                    buttonEdit2.Text = dic["name"].ToString();
                    dev.JName = dic["id"].ToString();
                    string sql = "where AreaID='" + dic["id"].ToString() + "' and type='70' ORDER BY Number";
                    IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
                    lookUpEdit1.Properties.DataSource = list;
                }

            }
            //����·�Ľڵ��� ��Ϊ����·���׽ڵ�
        }
Exemplo n.º 16
0
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            //dlg.InitDeviceType("05","07","54","55","56","57","62","63","64","70","71","73");
            dlg.InitDeviceType("01");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                buttonEdit1.Text = dic["name"].ToString();
                dev.IName = dic["id"].ToString();
            }
        }
Exemplo n.º 17
0
 private void simpleButton3_Click(object sender, EventArgs e)
 {
     frmDeviceSelect dlg = new frmDeviceSelect();
     dlg.InitDeviceType("01");
     if (dlg.ShowDialog() == DialogResult.OK) {
         Dictionary<string,object> dic= dlg.GetSelectedDevice();
         PSPDEV dev = dic["device"] as PSPDEV;
         dev.SvgUID = bdz.UID;
         Services.BaseService.Update<PSPDEV>(dev);
         freshxl();
     }
 }
Exemplo n.º 18
0
        private void lookUpEdit1_Properties_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("01","74");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                lookUpEdit1.EditValue = dic["id"].ToString();
                PSPDEV pdv=dic["device"] as PSPDEV;
                if (pdv.Type=="01")
                {
                    dev.FirstNode=pdv.Number;
                }
                else{dev.FirstNode=pdv.FirstNode;}

            }
        }
Exemplo n.º 19
0
        private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode tln = treeList1.FocusedNode;
            frmDeviceSelect dlg = new frmDeviceSelect();
            if (tln != null)
            {
                DataRow row = (tln.TreeList.GetDataRecordByNode(tln) as DataRowView).Row;
                Ps_pdtypenode v = DataConverter.RowToObject<Ps_pdtypenode>(row);
                if (tln.GetValue("devicetype").ToString() == "01")
                {
                    //adducdevice("73");
                    //curDevice.Add();
                    //PSPDEV pd = curDevice.SelectedDevice as PSPDEV;
                    //馈线段记录
                    dlg.InitDeviceType("01", "73");
                }
                else if (tln.GetValue("devicetype").ToString() == "73")
                {
                    dlg.InitDeviceType("73", "74", "80", "75");

                }
                else if (tln.GetValue("devicetype").ToString() == "74")
                {
                    dlg.InitDeviceType("06", "55");

                }
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Dictionary<string, object> dic = dlg.GetSelectedDevice();
                    PSPDEV devzx = dic["device"] as PSPDEV;
                    //S1 = devzx.SUID;
                    Ps_pdtypenode pn = new Ps_pdtypenode();
                    pn.title = devzx.Name;
                    pn.pdreltypeid = pdreltypeid;
                    pn.devicetype = devzx.Type;
                    pn.DeviceID = devzx.SUID;
                    if (devzx.Type != "01")
                    {
                        pn.ParentID = tln.GetValue("ID").ToString();
                    }
                    switch (devzx.Type)
                    {
                        case "73":
                            pn.Code = (tln.Level + 1).ToString() + "1" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "74":
                            pn.Code = (tln.Level + 1).ToString() + "2" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "80":
                            pn.Code = (tln.Level + 1).ToString() + "3" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "75":
                            pn.Code = (tln.Level + 1).ToString() + "5" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "06":
                            pn.Code = (tln.Level + 1).ToString() + "4" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "55":
                            pn.Code = (tln.Level + 1).ToString() + "6" + (tln.Nodes.Count + 1).ToString();
                            break;
                        case "01":
                            pn.Code = treeList1.Nodes.Count.ToString();
                            break;
                    }

                    Services.BaseService.Create<Ps_pdtypenode>(pn);
                    dt.Rows.Add(Itop.Common.DataConverter.ObjectToRow(pn, dt.NewRow()));
                }
            }
        }
Exemplo n.º 20
0
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("20", "30");
            if (dlg.ShowDialog() == DialogResult.OK) {
                Dictionary<string,object> dic = dlg.GetSelectedDevice();
                buttonEdit1.Text = dic["name"].ToString();
                dev.SvgUID = dic["id"].ToString();
            }
        }
Exemplo n.º 21
0
        private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode    tln = treeList1.FocusedNode;
            frmDeviceSelect dlg = new frmDeviceSelect();

            if (tln != null)
            {
                DataRow       row = (tln.TreeList.GetDataRecordByNode(tln) as DataRowView).Row;
                Ps_pdtypenode v   = DataConverter.RowToObject <Ps_pdtypenode>(row);
                if (tln.GetValue("devicetype").ToString() == "01")
                {
                    //adducdevice("73");
                    //curDevice.Add();
                    //PSPDEV pd = curDevice.SelectedDevice as PSPDEV;
                    //馈线段记录
                    //dlg.InitDeviceType("01", "73");
                    MsgBox.Show("电源不能添加元件!");
                    return;
                }
                else if (tln.GetValue("devicetype").ToString() == "73")
                {
                    // dlg.InitDeviceType("73", "74", "80", "75");
                    dlg.InitDeviceType("74", "80", "75");
                }
                else if (tln.GetValue("devicetype").ToString() == "74")
                {
                    dlg.InitDeviceType("06", "55");
                }
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Dictionary <string, object> dic = dlg.GetSelectedDevice();
                    PSPDEV devzx = dic["device"] as PSPDEV;
                    //S1 = devzx.SUID;
                    Ps_pdtypenode pn = new Ps_pdtypenode();
                    pn.title       = devzx.Name;
                    pn.pdreltypeid = pdreltypeid;
                    pn.devicetype  = devzx.Type;
                    pn.DeviceID    = devzx.SUID;
                    if (devzx.Type != "01")
                    {
                        pn.ParentID = tln.GetValue("ID").ToString();
                    }
                    switch (devzx.Type)
                    {
                    case "73":
                        pn.Code = (tln.Level + 1).ToString() + "1" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "74":
                        pn.Code = (tln.Level + 1).ToString() + "2" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "80":
                        pn.Code = (tln.Level + 1).ToString() + "3" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "75":
                        pn.Code = (tln.Level + 1).ToString() + "5" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "06":
                        pn.Code = (tln.Level + 1).ToString() + "4" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "55":
                        pn.Code = (tln.Level + 1).ToString() + "6" + (tln.Nodes.Count + 1).ToString();
                        break;

                    case "01":
                        pn.Code = treeList1.Nodes.Count.ToString();
                        break;
                    }

                    Services.BaseService.Create <Ps_pdtypenode>(pn);
                    dt.Rows.Add(Itop.Common.DataConverter.ObjectToRow(pn, dt.NewRow()));
                }
            }
        }
Exemplo n.º 22
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("05", "07", "54", "55", "56", "57", "62", "63", "64", "70", "71", "73","74");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.JName = dic["id"].ToString();
            }
        }
Exemplo n.º 23
0
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("05","73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                buttonEdit1.Text = dic["name"].ToString();
                //����ϼ���·�Ľڵ���Ϣ
                string sql = "where AreaID='" + dic["id"].ToString()+"' and type='70' ORDER BY Number";
                IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
                lookUpEdit1.Properties.DataSource = list;
                lookUpEdit2.Properties.DataSource = list;
                dev.AreaID = dic["id"].ToString();
            }
        }
Exemplo n.º 24
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("05","73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.JName = dic["id"].ToString();
                string sql = "where AreaID='" + dic["id"].ToString() + "' and type='70' ORDER BY Number";
                IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
                lookUpEdit2.Properties.DataSource = list;
            }
        }
Exemplo n.º 25
0
        private void lookUpEdit1_Properties_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();
            dlg.InitDeviceType("05", "73");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                PSPDEV devzx = dic["device"] as PSPDEV;
                lookUpEdit1.EditValue = dev.SUID;
                string sql = " where  (type ='70') and AreaID='" + devzx.SUID+ "'order by number";
                IList list = Services.BaseService.GetList("SelectPSPDEVByCondition", sql);
                lookUpEdit2.Properties.DataSource = list;

            }
        }
Exemplo n.º 26
0
 private void simpleButton5_Click(object sender, EventArgs e)
 {
     frmDeviceSelect dlg = new frmDeviceSelect();
     dlg.InitDeviceType("70", "71", "72", "57", "59", "61", "62", "63", "64");
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         Dictionary<string, object> dic = dlg.GetSelectedDevice();
         PSPDEV devzx = dic["device"] as PSPDEV;
         devzx.AreaID = dev.SUID;
         Services.BaseService.Update<PSPDEV>(devzx);
         initList();
     }
 }
Exemplo n.º 27
0
        private void buttonEdit2_Click(object sender, EventArgs e)
        {
            frmDeviceSelect dlg = new frmDeviceSelect();

            dlg.InitDeviceType("20","30");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Dictionary<string, object> dic = dlg.GetSelectedDevice();
                buttonEdit2.Text = dic["name"].ToString();
                dev.SvgUID = dic["id"].ToString();
            }
        }