예제 #1
0
 public void loadData()
 {
     try
     {
         PSP_SubstationMng sub_par = new PSP_SubstationMng();
         // sub_par.type = par;
         IList<PSP_SubstationMng> list = Services.BaseService.GetList<PSP_SubstationMng>("SelectPSP_SubstationMngList", sub_par);
         this.gridControl.DataSource = list;
     }
     catch (Exception exc)
     {
         //Debug.Fail(exc.Message);
         //HandleException.TryCatch(exc);
     }
 }
예제 #2
0
 private void frmSubstatinYXInfo_Load(object sender, EventArgs e)
 {
     PSP_SubstationMng sel1 = new PSP_SubstationMng();
     IList<PSP_SubstationMng> list1 = Services.BaseService.GetList<PSP_SubstationMng>("SelectPSP_SubstationMngList", sel1);
     for (int i = 0; i < list1.Count; i++)
     {
         TreeNode node = new TreeNode();
         node.Text = list1[i].SName;
         node.Tag = list1[i].UID;
         PSP_SubstationSelect sel2 = new PSP_SubstationSelect();
         sel2.col2 = list1[i].UID;
         IList<PSP_SubstationSelect> list2 = Services.BaseService.GetList<PSP_SubstationSelect>("SelectPSP_SubstationSelectList", sel2);
         for (int j = 0; j < list2.Count;j++ )
         {
             TreeNode _node = new TreeNode();
             _node.Text = list2[j].SName;
             _node.Tag = list2[j].UID;
             node.Nodes.Add(_node);
         }
         treeView1.Nodes.Add(node);
     }
 }
예제 #3
0
        protected override void Edit()
        {
            //获取焦点对象
            PSP_SubstationMng obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

            //创建对象的一个副本
            PSP_SubstationMng objCopy = new PSP_SubstationMng();
            DataConverter.CopyTo<PSP_SubstationMng>(obj, objCopy);

            //执行修改操作
            using (FrmPSP_SubstationMngDialog dlg = new FrmPSP_SubstationMngDialog())
            {
                dlg.Object = objCopy;   //绑定副本
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //用副本更新焦点对象
            DataConverter.CopyTo<PSP_SubstationMng>(objCopy, obj);
            //刷新表格
            gridControl.RefreshDataSource();
        }
예제 #4
0
        protected override void Add()
        {
            //检查对象链表是否已经加载
            if (ObjectList == null)
            {
                return;
            }
            //新建对象
            PSP_SubstationMng obj = new PSP_SubstationMng();
               // obj.type = par;
            //执行添加操作
            using (FrmPSP_SubstationMngDialog dlg = new FrmPSP_SubstationMngDialog())
            {
                dlg.IsCreate = true;    //设置新建标志
                dlg.Object = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //将新对象加入到链表中
            ObjectList.Add(obj);

            //刷新表格,并将焦点行定位到新对象上。
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
예제 #5
0
        private void frmTongJi_Load(object sender, EventArgs e)
        {
            barQuery.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            barPrint.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
            barAdd.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            barEdit.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            barDel.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
            barDel.Caption = "删除选择的变电站";
            //barEditItem3.Visibility =DevExpress.XtraBars.BarItemVisibility.Always;
            PSP_SubstationMng m = new PSP_SubstationMng();
            sellist= Services.BaseService.GetList<PSP_SubstationMng>("SelectPSP_SubstationMngList", m);
            lookUpEdit1.Properties.DataSource = sellist;
            //if (frmSubstationParMng.key == "No")
            //{

            //}
            //else
            //{
            //    LoadData2();
            //}
        }