Beispiel #1
0
 public void LoadTree(TreeNode _root, string id)
 {
     PSP_bdz_type p = new PSP_bdz_type();
     p.col1 = " col3='" + id + "' order by Name";
        IList<PSP_bdz_type> list= Services.BaseService.GetList<PSP_bdz_type>("SelectPSP_bdz_typeByWhere", p);
        for(int i=0;i<list.Count;i++){
        PSP_bdz_type _type = list[i];
        TreeNode node = new TreeNode(_type.Name);
        node.Tag = _type.id;
        LoadTree(node, _type.id);
        _root.Nodes.Add(node);
     }
 }
Beispiel #2
0
        protected override void Add()
        {
            if (!AddRight)
            {
                MessageBox.Show("��û�д�Ȩ�ޡ�", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            FomInput f = new FomInput();
            if (f.ShowDialog() == DialogResult.OK)
            {
                PSP_bdz_type p = new PSP_bdz_type();
                p.id = Guid.NewGuid().ToString();
                p.Name = f.strName;
                p.col3 = typeid;
                Services.BaseService.Create<PSP_bdz_type>(p);
                TreeNode node = new TreeNode(p.Name);
                node.Tag = p.id;
                treeView1.SelectedNode.Nodes.Add(node);
                ctrlLineType1.Typeid = typeid;
                ctrlLineType1.RefreshData();
            }
        }
        private void FrmglebeTypeDialog_Load(object sender, EventArgs e)
        {
            LoadData();

            year.Text=_obj.UYear.ToString();
            month.Text=_obj.UMonth;
            textkgbh.Text=_obj.Switch_Id ;
            textkgmc.Text=_obj.Switch_Name;
            textfh.Text=_obj.LoadValue.ToString();
            textdl.Text=_obj.Number.ToString();

            PSP_bdz_type p = new PSP_bdz_type();
            p.col1 = " col1=1 order by Name";
            IList list1 = Services.BaseService.GetList("SelectPSP_bdz_typeByWhere", p);

            foreach (PSP_bdz_type str in list1)
            {
                bool b1 = false;
                for (int i = 0; i < bdzlist.Length;i++ )
                {
                    if(bdzlist[i]==str.id.ToString()){
                        b1 = true;
                    }
                }
                treeList1.AppendNode(new object[] {str.id,str.Name,b1}, -1);
            }

            PSP_bdz_type p2 = new PSP_bdz_type();
            p2.col1 = " col1=2 order by Name";
            IList list2 = Services.BaseService.GetList("SelectPSP_bdz_typeByWhere", p2);
            foreach (PSP_bdz_type str in list2)
            {
                bool b2 = false;
                for (int i = 0; i < fqlist.Length; i++)
                {
                    if (fqlist[i] == str.id.ToString())
                    {
                        b2 = true;
                    }
                }
                treeList2.AppendNode(new object[] { str.id, str.Name, b2 }, -1);
            }

            PSP_bdz_type p3 = new PSP_bdz_type();
            p3.col1 = " col1=3 order by Name";
            IList list3 = Services.BaseService.GetList("SelectPSP_bdz_typeByWhere", p3);
            foreach (PSP_bdz_type str in list3)
            {
                bool b3 = false;
                for (int i = 0; i < fxtlist.Length; i++)
                {
                    if (fxtlist[i] == str.id.ToString())
                    {
                        b3 = true;
                    }
                }
                treeList3.AppendNode(new object[] { str.id, str.Name, b3 }, -1);
            }
        }
Beispiel #4
0
        protected override void Del()
        {
            if (!DeleteRight)
            {
                MessageBox.Show("��û�д�Ȩ�ޡ�", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            PSP_interface ins = new PSP_interface();
            ins.col1 = " BdzId like '%"+treeView1.SelectedNode.Tag.ToString()+"%' ";
            IList<PSP_interface> l2 = Services.BaseService.GetList<PSP_interface>("SelectPSP_interfaceByWhere", ins);
            if(l2.Count>0){
                MessageBox.Show("�����°������ݣ�����ɾ����", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if(treeView1.SelectedNode.Nodes.Count>0){
                MessageBox.Show("�����°����ӷ��࣬����ɾ����", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("ȷ��ɾ��ô?", "��ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                PSP_bdz_type p = new PSP_bdz_type();
                p.id = treeView1.SelectedNode.Tag.ToString();
                Services.BaseService.Update("DeletePSP_bdz_type", p);
                treeView1.Nodes.Remove(treeView1.SelectedNode);
                ctrlLineType1.Typeid = typeid;
                ctrlLineType1.RefreshData();
            }
        }
Beispiel #5
0
 private void ����ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FomInput f = new FomInput();
     if (f.ShowDialog() == DialogResult.OK)
     {
         PSP_bdz_type p = new PSP_bdz_type();
         p.id = Guid.NewGuid().ToString();
         p.Name = f.strName;
         p.col3 = typeid;
         Services.BaseService.Create<PSP_bdz_type>(p);
         TreeNode node = new TreeNode(p.Name);
         node.Tag = p.id;
         treeView1.SelectedNode.Nodes.Add(node);
         ctrlLineType1.Typeid = typeid;
         ctrlLineType1.RefreshData();
     }
 }
Beispiel #6
0
        private void �޸�ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PSP_bdz_type p = new PSP_bdz_type();
            p.id=treeView1.SelectedNode.Tag.ToString();
            p = (PSP_bdz_type)Services.BaseService.GetObject("SelectPSP_bdz_typeByKey", p);

            FomInput f = new FomInput();
            f.strName = p.Name;
            if (f.ShowDialog() == DialogResult.OK)
            {
                p.Name = f.strName;
                Services.BaseService.Update<PSP_bdz_type>(p);
                treeView1.SelectedNode.Text = p.Name;
                ctrlLineType1.Typeid = typeid;
                ctrlLineType1.RefreshData();
            }
        }
Beispiel #7
0
 private void ɾ��ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("ȷ��ɾ��ô?", "��ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Information)==DialogResult.Yes)
     {
         PSP_bdz_type p=new PSP_bdz_type();
         p.id=treeView1.SelectedNode.Tag.ToString();
         Services.BaseService.Update("DeletePSP_bdz_type",p);
         treeView1.Nodes.Remove(treeView1.SelectedNode);
         ctrlLineType1.Typeid = typeid;
         ctrlLineType1.RefreshData();
     }
 }
Beispiel #8
0
        protected override void Edit()
        {
            if (!EditRight)
            {
                MessageBox.Show("��û�д�Ȩ�ޡ�", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            PSP_bdz_type p = new PSP_bdz_type();
            p.id = treeView1.SelectedNode.Tag.ToString();
            p = (PSP_bdz_type)Services.BaseService.GetObject("SelectPSP_bdz_typeByKey", p);

            FomInput f = new FomInput();
            f.strName = p.Name;
            if (f.ShowDialog() == DialogResult.OK)
            {
                p.Name = f.strName;
                Services.BaseService.Update("UpdatePSP_bdz_typeNM", p);
                treeView1.SelectedNode.Text = p.Name;
                ctrlLineType1.Typeid = typeid;
                ctrlLineType1.RefreshData();
            }
        }
Beispiel #9
0
        /// <summary>
        /// ��Ӷ���
        /// </summary>
        public void AddObject()
        {
            //�����������Ƿ��Ѿ�����
            if (ObjectList == null)
            {
                return;
            }
            //�½�����
            PSP_bdz_type obj = new PSP_bdz_type();

            //ִ����Ӳ���
            using (FrmbdzTypeDialog dlg = new FrmbdzTypeDialog())
            {
                dlg.IsCreate = true;    //�����½���־
                dlg.Typeid = typeid;
                dlg.Object = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }
            ObjectList.Add(obj);
            //ˢ�±�񣬲��������ж�λ���¶����ϡ�
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
            //RefreshData();
            //GridHelper.FocuseRow(this.gridView, obj);
            //gridView.FocusedRowHandle = gridView.RowCount;
        }
Beispiel #10
0
        /// <summary>
        /// ˢ�±���е�����
        /// </summary>
        /// <returns>ture:�ɹ�  false:ʧ��</returns>
        public bool RefreshData()
        {
            try
            {
                PSP_bdz_type p=new PSP_bdz_type();
                p.col1=" col3='"+typeid+"' order by Name";
                IList<PSP_bdz_type> list = Services.BaseService.GetList<PSP_bdz_type>("SelectPSP_bdz_typeByWhere", p);
                this.gridControl.DataSource = list;
            }
            catch (Exception exc)
            {
                Debug.Fail(exc.Message);
                HandleException.TryCatch(exc);
                return false;
            }

            return true;
        }