zoukankan      html  css  js  c++  java
  • 显示职员和权限组

        public partial class Form_ShowStaff : Form
        {
            Command.BusinessCommand.ProjectExplorer.com_Project com = new Command.BusinessCommand.ProjectExplorer.com_Project();
            List<LookUpList.simpleLookUpEditList> list = new List<LookUpList.simpleLookUpEditList>();
            List<LookUpList.simpleLookUpEditList> jihe = new List<LookUpList.simpleLookUpEditList>();
            public Form_ShowStaff()
            {
                InitializeComponent();
                bindComboboxEdit();
            }
            private void bindComboboxEdit()
            {
                list = com.returnGroup();
                ckb_group.Properties.DataSource = list;
                ckb_group.Properties.DisplayMember = "lookname";
                ckb_group.Properties.ValueMember = "lookvalue";
                ckb_group.Properties.NullText = "";
    
                jihe = com.returnStaff();
                ckb_staff.Properties.DataSource = jihe;
                ckb_staff.Properties.DisplayMember = "lookname";
                ckb_staff.Properties.ValueMember = "lookvalue";
                ckb_staff.Properties.NullText = "";
            }
        }

            public List<LookUpList.simpleLookUpEditList> returnGroup()
            {
                List<LookUpList.simpleLookUpEditList> list = new List<LookUpList.simpleLookUpEditList>();
                string sql = "select groupname as lookname,id as lookvalue from userrolegroup where u_state=0";
               return list.setListTwithObject<LookUpList.simpleLookUpEditList>(SqlHelper.ExecuteDataTable(sql));
            }
    
            public List<LookUpList.simpleLookUpEditList> returnStaff()
            {
                List<LookUpList.simpleLookUpEditList> list = new List<LookUpList.simpleLookUpEditList>();
                string sql = "select id as lookvalue,s_en_name as lookname from staff where s_state=0";
                return list.setListTwithObject<LookUpList.simpleLookUpEditList>(SqlHelper.ExecuteDataTable(sql));
            }
    
    
    public class simpleLookUpEditList
        {
            private string _lookname = "";
            private string _lookvalue = "";
    
            /// <summary>
            /// 要显示的内容
            /// </summary>
            public string lookname { get { return _lookname.returnvalue(); } set { _lookname = value; } }
            /// <summary>
            /// 显示的内容的实际值
            /// </summary>
            public string lookvalue { get { return _lookvalue.returnvalue(); } set { _lookvalue = value; } }
        }
    
    
  • 相关阅读:
    python : 将txt文件中的数据读为numpy数组或列表
    ROS :为IDE配置环境变量
    ROS 教程之 navigation :在 catkin 环境下创建costmap layer plugin
    ROS 教程之 vision : 用各种摄像头获取图像
    ROS 教程之 network:多台计算机之间网络通信(2)
    MS sql 查询动态表名的方法
    把ocx打包成CAB,并签名
    DataSet 转换成List
    C# 反序列化datetime的处理
    PSP软件开发过程管理
  • 原文地址:https://www.cnblogs.com/Tianxf815/p/8875756.html
Copyright © 2011-2022 走看看