public IEnumerable <ExchangeCodeDetail> SelectPromotionDetailsByEdit(int id) { DataTable dt = DALPromotion.SelectPromotionDetailsByEdit(id); if (dt == null || dt.Rows.Count == 0) { return(new List <ExchangeCodeDetail>()); } return(dt.Rows.OfType <DataRow>().Select(x => new ExchangeCodeDetail(x))); }