//-------------------------------------------------------------- public static string Static_GetDisplayString(int PriceList) { string RetVal = ""; PriceLists m_PriceLists = new PriceLists(); m_PriceLists.PriceList = PriceList; m_PriceLists = m_PriceLists.Get(); RetVal = m_PriceLists.PriceListName; return(RetVal); }
//----------------------------------------------------------- #region Method private List <PriceLists> Init(SqlCommand cmd) { SqlConnection con = db.getConnection(); cmd.Connection = con; List <PriceLists> l_PriceLists = new List <PriceLists>(); try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); SmartDataReader smartReader = new SmartDataReader(reader); while (smartReader.Read()) { PriceLists m_PriceLists = new PriceLists(); m_PriceLists.PriceList = smartReader.GetInt32("PriceList"); m_PriceLists.PriceListName = smartReader.GetString("PriceListName"); m_PriceLists.PriceListDesc = smartReader.GetString("PriceListDesc"); m_PriceLists.PriceListTypeId = smartReader.GetByte("PriceListTypeId"); m_PriceLists.IsDetail = smartReader.GetByte("IsDetail"); m_PriceLists.StatusId = smartReader.GetByte("StatusId"); m_PriceLists.DisplayOrder = smartReader.GetInt32("DisplayOrder"); m_PriceLists.CrUserId = smartReader.GetInt32("CrUserId"); m_PriceLists.UpdateUserId = smartReader.GetInt32("UpdateUserId"); m_PriceLists.CrDateTime = smartReader.GetDateTime("CrDateTime"); l_PriceLists.Add(m_PriceLists); } reader.Close(); return(l_PriceLists); } catch (SqlException err) { throw new ApplicationException("Data error: " + err.Message); } finally { db.closeConnection(con); } }
//-------------------------------------------------------------- public PriceLists Get() { PriceLists retVal = new PriceLists(); int RowCount = 0; string DateFrom = ""; string DateTo = ""; string OrderBy = ""; int PageSize = 1; int PageNumber = 0; try { List <PriceLists> list = GetPage(DateFrom, DateTo, OrderBy, PageSize, PageNumber, ref RowCount); if (list.Count > 0) { retVal = list[0]; } } catch (Exception ex) { throw ex; } return(retVal); }