Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<int> GetDealerIDsListByZipCodeDistance(string Role, string ZipCode, int Miles)
- {
- bool NewUsed = true;
- List<int> loi = new List<int>();
- try
- {
- string offerCode = TIMPurchaseOfferBLL.EditPurchaseOfferCtl.Instance.OfferCode;
- bool isKbb = new[] {"B","N"}.Contains(offerCode);
- DataSet ds = default(DataSet);
- if (NewUsed)
- {
- ds = df.GetDealerListByZipCodeDistance(Role, ZipCode, Miles, Instance.DealerType, true, isKbb);
- }
- else
- {
- ds = df.GetDealerListByZipCodeDistance(Role, ZipCode, Miles, "", true, isKbb);
- }
- var data = ds.Tables[0].AsEnumerable();
- if (isKbb)
- {
- data = data.Where(d => d["IsKBBSubscriptionSource"].ToString().Trim() == "1");
- }
- data.ToList().ForEach(r => loi.Add(int.Parse(r["userid"].ToString())));
- //foreach (var r in data)
- //{
- // loi.Add(int.Parse(r["UserID"].ToString()));
- //}
- }
- catch (Exception ex)
- {
- return loi;
- }
- return loi;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement