Exemple #1
0
        public static List <tbl_cpItem> GetCPsByIds(Shotgun.Database.BDClass dBase, IList <int> ids, string[] fields)
        {
            if (ids == null || ids.Count() == 0)
            {
                return(null);
            }
            var l = GetQueries(dBase);

            l.Fields = fields;
            l.Filter.AndFilters.Add(Fields.id, ids);
            l.PageSize = int.MaxValue;

            return(l.GetDataList());
        }
Exemple #2
0
 private Shotgun.Database.IBaseDataClass2 dBase()
 {
     if (_db != null)
     {
         return(_db);
     }
     lock (this)
     {
         if (_db != null)
         {
             return(_db);
         }
         _db = CreateDBConnector();
     }
     return(_db);
 }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dBase"></param>
        /// <param name="cpId"></param>
        /// <param name="filed">0:short_name,1:full_name</param>
        /// <returns></returns>
        public static string GetCPNameById(Shotgun.Database.BDClass dBase, int id, string filed)
        {
            var l = GetQueries(dBase);

            l.Filter.AndFilters.Add(Fields.id, id);
            var t = l.ExecuteScalar(filed);

            if (t == null || DBNull.Value.Equals(t))
            {
                return(null);
            }
            if (t is string)
            {
                return((string)t);
            }
            return(t.ToString());
        }
Exemple #4
0
 public static string GetCPNameById(Shotgun.Database.BDClass dBase, int id, bool isFullName)
 {
     return(GetCPNameById(dBase, id, (isFullName ? Fields.full_name : Fields.short_name)));
 }