Beispiel #1
0
        public bool DelSiteC()
        {
            SqlPar par = SqlXml.GetSql("Site", "删除场地");

            par.SetParValues(this.site_id);
            return(DB.ExeSql(par) > 0);
        }
Beispiel #2
0
    public string UpdateImg(string _oldImg)
    {
        string mp = STU.Config.folder.UpLoad.MapPath();

        if (this.img != "" && this.img != _oldImg)
        {
            string new_img = Guid.NewGuid().ToString("N") + System.IO.Path.GetExtension(_oldImg); System.Threading.Thread.Sleep(10);
            if (!STU.FolderConfig.MoveFile(this.img, new_img, mp))
            {
                return("封面上传失败");
            }
            if (!_oldImg.IsNullOrEmpty())
            {
                System.IO.File.Delete(mp + _oldImg);
            }
            this.img = new_img;
        }
        else
        {
            this.img = _oldImg;
        }
        SqlPar par = SqlXml.GetSql("Uploads", "编辑图片");

        par.SetParValues(this.name, this.msg, this.img);
        return(DB.ExeSql(par) > 0 ? "" : "编辑失败");
    }
Beispiel #3
0
        public bool AddSiteC()
        {
            SqlPar par = SqlXml.GetSql("Site", "添加场地");

            par.SetParValues(this.site_name, this.site_area, this.site_img, this.site_using_time_total, this.site_desc);
            return(DB.ExeSql(par) > 0);
        }
Beispiel #4
0
        public int SetState(int me)
        {
            SqlPar par = SqlXml.GetSql("ManageUser", "变更管理员状态");

            par.SetParValues(this.id, me);
            return(DB.GetScalar(par).toString(-1));
        }
Beispiel #5
0
        public bool EditPass(string newpass)
        {
            SqlPar par = SqlXml.GetSql("ManageUser", "修改密码");

            par.SetParValues(newpass, this.uname, this.pass);
            return(DB.ExeSql(par) > 0);
        }
Beispiel #6
0
        public bool DelUserC()
        {
            SqlPar par = SqlXml.GetSql("User", "删除用户");

            par.SetParValues(this.user_id);
            return(DB.ExeSql(par) > 0);
        }
Beispiel #7
0
        public bool AddWxUser()
        {
            SqlPar par = SqlXml.GetSql("User", "添加用户");

            par.SetParValues(this.user_phone, this.user_name);
            return(DB.ExeSql(par) > 0);
        }
Beispiel #8
0
        public bool Add()
        {
            SqlPar par = SqlXml.GetSql("ManageUser", "添加管理员");

            par.SetParValues(this.uname, this.pass, this.name, this.mobile, "Main,EditPass,welcome," + this.flag);
            //par.Debug();
            return(DB.ExeSql(par) > 0);
        }
Beispiel #9
0
        public bool SetUserState()
        {
            SqlPar par = SqlXml.GetSql("User", "变更用户状态");

            par.SetParValues(
                this.user_account_state, this.user_id
                );
            return(DB.ExeSql(par) > 0);
        }
Beispiel #10
0
        public static Tuple <string, string> access_token()
        {
            SqlPar par = SqlXml.GetSql("Index", "获取微信JSAPI");
            var    ary = DB.GetRow(par);

            if (ary.IsValue)
            {
                return(Tuple.Create(ary[0].toString(), ary[1].toString()));
            }
            return(Tuple.Create("", ""));
        }
Beispiel #11
0
    // 添加绘本视频
    public string AddImg(string _img)
    {
        string mp = STU.Config.folder.UpLoad.MapPath();

        this.img = Guid.NewGuid().ToString("N") + System.IO.Path.GetExtension(_img); System.Threading.Thread.Sleep(10);
        if (!STU.FolderConfig.MoveFile(_img, this.img, mp))
        {
            return("封面上传失败");
        }
        ;

        SqlPar par = SqlXml.GetSql("Uploads", "添加图片");

        par.SetParValues(this.name, this.msg, this.img);
        return(DB.ExeSql(par) > 0 ? "" : "添加失败");
    }
Beispiel #12
0
        public bool Get()
        {
            SqlPar par = SqlXml.GetSql("ManageUser", "获取管理员");

            par.SetParValues(this.id);
            var obj = DB.GetRow(par);

            if (!obj.IsValue)
            {
                return(false);
            }

            this.uname  = obj["uname"].toString();
            this.pass   = obj["pwd"].toString();
            this.name   = obj["name"].toString();
            this.mobile = obj["mobile"].toString();
            this.state  = obj["state"].toString(0);
            this.flag   = obj["flag"].toString();
            return(true);
        }