/// <summary> /// 获取所有出版商信息 /// </summary> /// <returns></returns> public List <PressModel> GetAllBookPress() { List <PressModel> data = null; string sql = "select * from BookPress"; DataSet ds = db.GetDataSetSql(sql); if (ds.Tables[0].Rows.Count > 0) { data = ListDataSet.DataSetToIList <PressModel>(ds, 0).ToList(); } return(data); }
public List <BookTypeModel> GetAllBookTypes() { string sql = "select TypeId,TypeName,ParentTypeId,TypeDESC from BookType"; DataSet ds = helper.GetDataSetSql(sql); List <BookTypeModel> btlist = null; if (ds.Tables[0].Rows.Count > 0) { btlist = ListDataSet.DataSetToIList <BookTypeModel>(ds, 0).ToList(); } return(btlist); }
/// <summary> /// 得到所有图书的出版社 /// </summary> /// <returns></returns> public List <PressModel> GetBookPress() { List <PressModel> list = null; string sql = "select PressId,PressName from (select a.* from BookPress a, Book b where a.PressId = b.BookPress) c Group by PressName, PressId"; DataSet ds = helper.GetDataSetSql(sql); if (ds.Tables[0].Rows.Count > 0) { list = ListDataSet.DataSetToIList <PressModel>(ds, 0).ToList(); } return(list); }
/// <summary> /// 得到所有的图书的详细信息 /// </summary> /// <returns></returns> public List <BookExtModel> GetAllBooks() { List <BookExtModel> list = null; string sql = "select a.* ,b.TypeName,c.PressName from Book a,BookType b, BookPress c where a.BookType = b.TypeId and a.BookPress = c.PressId"; DataSet ds = helper.GetDataSetSql(sql); if (ds.Tables[0].Rows.Count > 0) { list = ListDataSet.DataSetToIList <BookExtModel>(ds, 0).ToList(); } return(list); }
/// <summary> /// 根据类别Id得到类别信息及父类信息 /// </summary> /// <param name="typeId"></param> /// <returns></returns> public BookTypeExtModel GetBookTypeId(int typeId) { string sql = "select * from (select TypeId, TypeName, TypeDESC, ParentTypeId from booktype) a left join (select TypeId as ParentTypeId2, TypeName as ParentTypeName,TypeDESC as ParentTypeDESC from booktype) b on a.ParentTypeId = b.ParentTypeid2 where a.typeid = @typeId"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("TypeId", typeId) }; BookTypeExtModel model = null; DataSet ds = helper.GetDataSetSql(sql, para); if (ds.Tables[0].Rows.Count > 0) { model = ListDataSet.DataSetToIList <BookTypeExtModel>(ds, 0).ToList().First(); } return(model); }
public SysAdminsModel QueryLoginAccount(SysAdminsModel usermodel) { SysAdminsModel model = null; string sqlstr = "select LoginId,LoginPwd,UserName,IsDisable,IsSuperUser,LastLoginTime from SysAdmins"; sqlstr += " where LoginId=@logId and LoginPwd=@logPwd"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@logId", usermodel.LoginId), new SqlParameter("@logPwd", usermodel.LoginPwd) }; DataSet ds = db.GetDataSetSql(sqlstr, para); if (ds.Tables[0].Rows.Count > 0) { //将ds对象转换成list集合并且获取第一个对象 model = ListDataSet.DataSetToIList <SysAdminsModel>(ds, 0).ToList().First(); } return(model); }
public static void Sort(ListDataSet list, CartItemSortColumn column, bool sortAscending) { if (list == null || list.Count == 0) { return; } IComparer comparer = null; switch (column) { case CartItemSortColumn.AvailableInMarketplace: comparer = new CartItemsAvailableInMarketplaceComparer(sortAscending); break; case CartItemSortColumn.SortTitle: comparer = new CartItemsComparer(sortAscending, new GetCartItemPropertyDelegate(CartItemsComparer.GetCartItemSortTitle)); break; case CartItemSortColumn.ArtistName: comparer = new CartItemsComparer(sortAscending, new GetCartItemPropertyDelegate(CartItemsComparer.GetCartItemArtistName)); break; case CartItemSortColumn.DisplayType: comparer = new CartItemsComparer(sortAscending, new GetCartItemPropertyDelegate(CartItemsComparer.GetCartItemDisplayType)); break; } if (comparer == null) { return; } ArrayList arrayList = new ArrayList(list.Count); arrayList.AddRange(list); arrayList.Sort(comparer); list.Source = arrayList; }
/// <summary> /// Construct a download filter. /// </summary> public DownloadFilter(IModelItemOwner owner, string description, ListDataSet content) : base(owner, description) { this.content = content; }