Пример #1
0
        public bool exist_same_folder(string name, string pid)
        {
            DBConfig      cfg = new DBConfig();
            SqlWhereMerge swm = new SqlWhereMerge();

            swm.equal("f_nameLoc", name.Trim());
            swm.equal("f_deleted", 0);
            if (cfg.m_isOracle)
            {
                if (string.IsNullOrEmpty(pid))
                {
                    pid = " ";
                }
                swm.equal("nvl(f_pid,' ')", pid);
            }
            else
            {
                swm.equal("LTRIM (f_pid)", pid.Trim());
            }

            string sql = string.Format("select f_id from up6_files where {0} " +
                                       " union select f_id from up6_folders where {0}", swm.to_sql());

            SqlExec se  = cfg.se();
            var     fid = (JArray)se.exec("up6_files", sql, "f_id", string.Empty);

            return(fid.Count > 0);
        }
Пример #2
0
        public bool exist_same_file(string name, string pid)
        {
            SqlWhereMerge swm = new SqlWhereMerge();

            swm.equal("f_nameLoc", name.Trim());
            swm.equal("f_pid", pid.Trim());
            swm.equal("f_deleted", 0);

            string sql = string.Format("select f_id from up6_files where {0} ", swm.to_sql());

            DBConfig cfg = new DBConfig();
            SqlExec  se  = cfg.se();
            var      arr = (JArray)se.exec("up6_files", sql, "f_id", string.Empty);

            return(arr.Count > 0);
        }