private List <long> GetLinkSupOrVend() { string text = ""; List <long> list = new List <long>(); if (this.SubSystemID == "ARAP") { string contactUnitType; if ((contactUnitType = this.FilterCondition.ContactUnitType) != null) { if (!(contactUnitType == "BD_Supplier")) { if (contactUnitType == "BD_Customer") { text = " select distinct FSUPPLIERID as FContactID from T_BD_CUSTOMER \r\n where FSUPPLIERID<>0 "; if (!ObjectUtils.IsNullOrEmptyOrWhiteSpace(this.FilterCondition.StartContactObj.Number)) { text += string.Format(" and FNUMBER >='{0}' ", this.FilterCondition.StartContactObj.Number); } if (!ObjectUtils.IsNullOrEmptyOrWhiteSpace(this.FilterCondition.EndContactObj.Number)) { text += string.Format(" and FNUMBER <='{0}' ", this.FilterCondition.EndContactObj.Number); } } } else { text = " select distinct t1.FCUSTOMERID as FContactID from T_BD_SUPPLIERFINANCE t1 \r\n inner join t_BD_Supplier t2 on t1.FSUPPLIERID =t2.FSUPPLIERID \r\n where t1.FCUSTOMERID<>0 "; if (!ObjectUtils.IsNullOrEmptyOrWhiteSpace(this.FilterCondition.StartContactObj.Number)) { text += string.Format(" and t2.FNUMBER >='{0}' ", this.FilterCondition.StartContactObj.Number); } if (!ObjectUtils.IsNullOrEmptyOrWhiteSpace(this.FilterCondition.EndContactObj.Number)) { text += string.Format(" and t2.FNUMBER <='{0}' ", this.FilterCondition.EndContactObj.Number); } } } if (!ObjectUtils.IsNullOrEmptyOrWhiteSpace(text)) { using (IDataReader dataReader = DBUtils.ExecuteReader(base.Context, text)) { while (dataReader.Read()) { list.Add(DBReaderUtils.GetValue <long>(dataReader, "FContactID")); } dataReader.Close(); } } } return(list); }
public T GetValue <T>(string key, T defaultValue) { object obj2; if (!base.TryGetValue(key, out obj2)) { return(defaultValue); } if (((obj2 != null) && (obj2.GetType().Name == typeof(long).Name)) && (typeof(T) == typeof(int))) { obj2 = int.Parse(obj2.ToString()); } return(DBReaderUtils.ConvertTo <T>(obj2, null)); }
public bool TryGetValue <T>(string key, T defaultValue, out T retValue) { object obj2; bool flag = base.TryGetValue(key, out obj2); if (flag) { if (((obj2 != null) && (obj2.GetType().Name == typeof(long).Name)) && (typeof(T) == typeof(int))) { obj2 = int.Parse(obj2.ToString()); } retValue = DBReaderUtils.ConvertTo <T>(obj2, null); return(flag); } retValue = defaultValue; return(flag); }