Exemplo n.º 1
0
        /// <summary>
        /// 批量删除
        /// </summary>
        void file_del_batch()
        {
            var par = Request.Form["data"];

            par = Server.UrlDecode(par);
            var obj = JToken.Parse(par);

            DBConfig cfg = new DBConfig();
            SqlExec  se  = cfg.se();

            //更新文件
            se.exec_batch("up6_files"
                          , "update up6_files set f_deleted=1 where f_id=@f_id"
                          , string.Empty
                          , "f_id"
                          , obj);

            //更新文件夹
            se.exec_batch("up6_folders"
                          , "update up6_folders set f_deleted=1 where f_id=@f_id"
                          , string.Empty
                          , "f_id"
                          , obj);

            PageTool.to_content(obj);
        }
Exemplo n.º 2
0
        void load_uncmp_down()
        {
            string   uid   = Request.QueryString["uid"];
            DBConfig cfg   = new DBConfig();
            SqlExec  se    = cfg.se();
            var      files = se.select("down_files"
                                       , "f_id,f_nameLoc,f_pathLoc,f_perLoc,f_sizeSvr,f_fdTask"
                                       , new SqlParam[] { new SqlParam("f_uid", int.Parse(uid)) });

            PageTool.to_content(files);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 删除文件
        /// </summary>
        void file_del()
        {
            var id      = this.reqString("id");
            var pathRel = this.reqStringDecode("pathRel");

            pathRel += '/';

            SqlWhereMerge swm = new SqlWhereMerge();
            DBConfig      cfg = new DBConfig();

            if (cfg.m_isOracle || cfg.m_isOdbc)
            {
                swm.instr(pathRel, "f_pathRel");
            }
            else
            {
                swm.charindex(pathRel, "f_pathRel");
            }
            string where = swm.to_sql();

            SqlExec se = cfg.se();

            se.update("up6_folders"
                      , new SqlParam[] { new SqlParam("f_deleted", true) }
                      , where
                      );

            se.update("up6_folders"
                      , new SqlParam[] { new SqlParam("f_deleted", true) }
                      , new SqlParam[] { new SqlParam("f_id", id) }
                      );

            se.update("up6_files"
                      , new SqlParam[] { new SqlParam("f_deleted", true) }
                      , where
                      );

            se.update("up6_files"
                      , new SqlParam[] { new SqlParam("f_deleted", true) }
                      , new SqlParam[] { new SqlParam("f_id", id) }
                      );

            PageTool.to_content(new JObject {
                { "ret", 1 }
            });
        }