/// <summary> /// 获取菜品的类别 /// </summary> /// <returns></returns> public IList <Menu_TypeEnity> GetAllMenutype() { List <Menu_TypeEnity> list = new List <Menu_TypeEnity>(); string sql = "select * from dbo.Menu_Type order by Type_ID"; SqlDataReader dr = SQLHelper.ExecuteReader(sql); while (dr.Read()) { Menu_TypeEnity mt = new Menu_TypeEnity(Convert.ToInt32(dr[0]), dr[1].ToString()); list.Add(mt); } return(list); }
/// <summary> /// 获取列表 /// </summary> /// <returns></returns> public List <Menu_TypeEnity> GetList() { List <Menu_TypeEnity> Menu = new List <Menu_TypeEnity>(); string sql = "select Type_ID,type_Name from dbo.Menu_Type "; SqlDataReader sdr = SQLHelper.ExecuteReader(sql); while (sdr.Read()) { Menu_TypeEnity m = new Menu_TypeEnity(Convert.ToInt32(sdr[0]), sdr[1].ToString()); Menu.Add(m); } return(Menu); }
/// <summary> ///获取所有菜品类型 /// </summary> /// <returns></returns> public List <Menu_TypeEnity> getAllType() { List <Menu_TypeEnity> list_menuType = new List <Menu_TypeEnity>(); string strSql = "select * from Menu_Type"; SqlDataReader sdr = SQLHelper.ExecuteReader(strSql); while (sdr.Read()) { Menu_TypeEnity mt = new Menu_TypeEnity(); mt.Type_ID = Convert.ToInt32(sdr[0]); mt.type_Name = sdr[1].ToString(); list_menuType.Add(mt); } return(list_menuType); }