Esempio n. 1
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <returns></returns>
        public static List <WMS_Privilege_Model> GetPrivilegeList()
        {
            List <WMS_Privilege_Model> list = new List <WMS_Privilege_Model>();
            DataTable dt = WMS_Privilege_Bll.Select_Privilege(string.Empty);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Privilege_Model wms_Privilege_Model = new WMS_Privilege_Model
                {
                    PrivilegeNo   = int.Parse(dt.Rows[i]["PrivilegeNo"].ToString()),
                    PrivilegeName = dt.Rows[i]["PrivilegeName"].ToString()
                };
                list.Add(wms_Privilege_Model);
            }
            return(list);
        }
Esempio n. 2
0
        /// <summary>
        /// 搜索按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DMButton_Search_Click(object sender, RoutedEventArgs e)
        {
            permissionBase.PrivilegeList.Clear();
            List <WMS_Privilege_Model> list = new List <WMS_Privilege_Model>();
            DataTable dt = WMS_Privilege_Bll.Select_Privilege(" PrivilegeNo = " + int.Parse(SearchText.Text.Trim()));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                WMS_Privilege_Model wMS_Privilege_Model = new WMS_Privilege_Model
                {
                    PrivilegeNo   = int.Parse(dt.Rows[i]["PrivilegeNo"].ToString()),
                    PrivilegeName = dt.Rows[i]["PrivilegeName"].ToString()
                };
                list.Add(wMS_Privilege_Model);
            }
            foreach (var model in list)
            {
                permissionBase.PrivilegeList.Add(model);
            }
            this.PrivilegeDataGrid.ItemsSource = permissionBase.PrivilegeList;
        }