示例#1
0
        public override int countSQL(string sql, object dbSet)
        {
            DbSqlQuery <publisher> DbPub = ((DbSet <publisher>)dbSet)
                                           .SqlQuery(sql);

            return(DbPub.Count());
        }
示例#2
0
        public static USERINFO Login(string UserName, string Password)
        {
            //#if DEBUG
            //    Debugger.Launch();
            //#endif
            string condition = "";

            if (null != UserName && null != Password)
            {
                condition = "select*From userinfo where UserName='******'";
            }

            DbSqlQuery <USERINFO> result1 = db.USERINFO.SqlQuery(condition, UserName);

            if (null != result1 && result1.Count() > 0)
            {
                USERINFO user = result1.First <USERINFO>();

                if (null != user)
                {
                    if (user.PASSWORD == Utils.md5Unicodebase64(Password))
                    {
                        //if (user.PASSWORD == Password)
                        return(user);
                    }
                }
            }
            return(null);
        }