コード例 #1
0
ファイル: SYS_USER_DAL.cs プロジェクト: tonightdream/MyErp
        public int LoginCheck(string uid, string pwd)
        {
            string sql = "select COUNT(*) from SYS_USER where USER_CODE=@uid and PASSWORD=@pwd";

            SqlParameter[] pms = new SqlParameter[] { new SqlParameter("@uid", uid), new SqlParameter("@pwd", pwd) };
            return((int)SqlHelper_cory.ExecuteScalar(sql, CommandType.Text, pms));
        }
コード例 #2
0
        public SYS_MENU GetMenuByCode(string code)
        {
            string        sql    = "select *from sys_menu where Menu_code=@code and Menu_unit is not null";
            SqlDataReader reader = SqlHelper_cory.ExecuteReader(sql, CommandType.Text, new SqlParameter("@code", code));
            SYS_MENU      model  = new SYS_MENU();

            if (reader.HasRows)
            {
                if (reader.Read())
                {
                    model.MENU_CODE        = reader.GetString(reader.GetOrdinal("MENU_CODE"));
                    model.MENU_NAME        = reader.GetString(reader.GetOrdinal("MENU_NAME"));
                    model.MENU_UNIT        = reader.GetString(reader.GetOrdinal("MENU_UNIT"));
                    model.PARENT_MENU_CODE = reader.GetString(reader.GetOrdinal("PARENT_MENU_CODE"));
                }
            }
            return(model);
        }
コード例 #3
0
ファイル: SYS_USER_DAL.cs プロジェクト: tonightdream/MyErp
        /// <summary>
        /// 根据ID返回实体
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public SYS_USER CheckUid(string uid)
        {
            string sql = "select * from SYS_USER where USER_CODE=@uid";

            using (SqlDataReader reader = SqlHelper_cory.ExecuteReader(sql, CommandType.Text, new SqlParameter("@uid", uid)))
            {
                SYS_USER model = new SYS_USER();
                if (reader.HasRows)
                {
                    if (reader.Read())
                    {
                        model.USER_CODE       = reader.GetString(reader.GetOrdinal("USER_CODE"));
                        model.PASSWORD        = reader.GetString(reader.GetOrdinal("PASSWORD"));
                        model.USER_NAME       = reader.GetString(reader.GetOrdinal("USER_NAME"));
                        model.STOCK_CODE      = reader.GetString(reader.GetOrdinal("STOCK_CODE"));
                        model.STOCK_NAME      = reader.GetString(reader.GetOrdinal("STOCK_NAME"));
                        model.PPRICE_SHOW     = reader.GetBoolean(reader.GetOrdinal("PPRICE_SHOW"));
                        model.DEPARTMENT_CODE = reader.GetString(reader.GetOrdinal("DEPARTMENT_CODE"));
                        model.DEPARTMENT_NAME = reader.GetString(reader.GetOrdinal("DEPARTMENT_NAME"));
                    }
                }
                return(model);
            }
        }
コード例 #4
0
ファイル: SYS_USER_DAL.cs プロジェクト: tonightdream/MyErp
        /// <summary>
        /// 显示所有用列表
        /// </summary>
        /// <returns></returns>
        public DataTable ListAllUsers()
        {
            string sql = "select *from SYS_USer";

            return(SqlHelper_cory.ExceuteDataTable(sql, CommandType.Text));
        }
コード例 #5
0
        public DataTable LoadNavMenu(string pid)
        {
            string sql = "select Menu_code,Menu_name,menu_unit,parent_menu_code from sys_menu where parent_menu_code=@pid";

            return(SqlHelper_cory.ExceuteDataTable(sql, CommandType.Text, new SqlParameter("@pid", pid)));
        }