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()); }
private Shotgun.Database.IBaseDataClass2 dBase() { if (_db != null) { return(_db); } lock (this) { if (_db != null) { return(_db); } _db = CreateDBConnector(); } return(_db); }
/// <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()); }
public static string GetCPNameById(Shotgun.Database.BDClass dBase, int id, bool isFullName) { return(GetCPNameById(dBase, id, (isFullName ? Fields.full_name : Fields.short_name))); }