本文整理汇总了C#中Zippy.Count方法的典型用法代码示例。如果您正苦于以下问题:C# Zippy.Count方法的具体用法?C# Zippy.Count怎么用?C# Zippy.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zippy
的用法示例。
在下文中一共展示了Zippy.Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Query
public static PaginatedList<Permission> Query(Zippy.Data.IDalProvider db, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Permission> rtn = new PaginatedList<Permission>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " 1=1";
#region 开始查询
if (paras != null)
{
object qTitle = paras["qTitle"];
if (qTitle.IsNotNullOrEmpty())
{
where += " and [Title] like @Title";
dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
}
object qUrl = paras["qUrl"];
if (qUrl.IsNotNullOrEmpty())
{
where += " and [Url] like @Url";
dbParams.Add(db.CreateParameter("Url", "%" + qUrl + "%"));
}
object qFlag = paras["qFlag"];
if (qFlag.IsNotNullOrEmpty())
{
where += " and [Flag] like @Flag";
dbParams.Add(db.CreateParameter("Flag", "%" + qFlag + "%"));
}
object qParentID = paras["qParentID"];
if (qParentID.IsNotNullOrEmpty())
{
where += " and [ParentID] = @ParentID";
dbParams.Add(db.CreateParameter("ParentID", qParentID));
}
}
#endregion
string orderBy = " [DisplayOrder] asc";
int RecordCount = db.Count<Permission>(where, dbParams.ToArray());
int PageCount = 0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Permission> records = db.Take<Permission>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
//重组 records
List<Permission> newRecords = new List<Permission>();
IEnumerable<Permission> rootRecords = records.Where(s => (s.ParentID ?? 0) == 0).OrderBy(s => s.DisplayOrder);
foreach (Permission per in rootRecords)
{
newRecords.Add(per);
newRecords.AddRange(records.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder));
}
rtn.AddRange(newRecords);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例2: Query
//.........这里部分代码省略.........
}
else if (orderCol == 4)
{
orderBy = "[Name] desc";
}
else if (orderCol == 5)
{
orderBy = "[Nickname]";
}
else if (orderCol == 6)
{
orderBy = "[Nickname] desc";
}
else if (orderCol == 7)
{
orderBy = "[Email]";
}
else if (orderCol == 8)
{
orderBy = "[Email] desc";
}
else if (orderCol == 9)
{
orderBy = "[Tel1]";
}
else if (orderCol == 10)
{
orderBy = "[Tel1] desc";
}
else if (orderCol == 11)
{
orderBy = "[Tel2]";
}
else if (orderCol == 12)
{
orderBy = "[Tel2] desc";
}
else if (orderCol == 13)
{
orderBy = "[Avatar]";
}
else if (orderCol == 14)
{
orderBy = "[Avatar] desc";
}
else if (orderCol == 15)
{
orderBy = "[TitleID]";
}
else if (orderCol == 16)
{
orderBy = "[TitleID] desc";
}
else if (orderCol == 17)
{
orderBy = "[TenantID]";
}
else if (orderCol == 18)
{
orderBy = "[TenantID] desc";
}
else if (orderCol == 19)
{
orderBy = "[UserStatus]";
}
else if (orderCol == 20)
{
orderBy = "[UserStatus] desc";
}
else if (orderCol == 21)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 22)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<Z01UserInfo>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z01UserInfo> records = db.Take<Z01UserInfo>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例3: Query
public static PaginatedList<Z10Order> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z10Order> rtn = new PaginatedList<Z10Order>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qCustomerID = paras["qCustomerID"];
if (qCustomerID.IsNotNullOrEmpty())
{
where += " and [CustomerID] = @CustomerID";
dbParams.Add(db.CreateParameter("CustomerID", qCustomerID));
}
object qCreateDateStart = paras["qCreateDateStart"];
if (qCreateDateStart.IsNotNullOrEmpty())
{
where += " and [CreateDate] >= @CreateDateStart";
dbParams.Add(db.CreateParameter("CreateDateStart", qCreateDateStart));
}
object qCreateDateEnd = paras["qCreateDateEnd"];
if (qCreateDateEnd.IsNotNullOrEmpty())
{
where += " and [CreateDate] < @CreateDateEnd";
dbParams.Add(db.CreateParameter("CreateDateEnd", ((DateTime)qCreateDateEnd).AddDays(1)));
}
object qOrderType = paras["qOrderType"];
if (qOrderType.IsNotNullOrEmpty())
{
where += " and ([OrderType]&@OrderType)[email protected]";
dbParams.Add(db.CreateParameter("OrderType", qOrderType));
}
object qIsSnap = paras["qIsSnap"];
if (qIsSnap.IsNotNullOrEmpty())
{
where += " and [IsSnap] = @IsSnap";
dbParams.Add(db.CreateParameter("IsSnap",qIsSnap));
}
object qDeleteFlag = paras["qDeleteFlag"];
if (qDeleteFlag.IsNotNullOrEmpty())
{
where += " and [DeleteFlag] = @DeleteFlag";
dbParams.Add(db.CreateParameter("DeleteFlag", qDeleteFlag));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[OrderID]";
}
else if (orderCol == 2)
{
orderBy = "[OrderID] desc";
}
else if (orderCol == 3)
{
orderBy = "[CustomerID]";
}
else if (orderCol == 4)
{
orderBy = "[CustomerID] desc";
}
else if (orderCol == 5)
{
orderBy = "[DateOrder]";
}
else if (orderCol == 6)
{
orderBy = "[DateOrder] desc";
}
else if (orderCol == 7)
{
orderBy = "[DateShip]";
}
else if (orderCol == 8)
{
orderBy = "[DateShip] desc";
}
else if (orderCol == 9)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 10)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<Z10Order>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
//.........这里部分代码省略.........
示例4: Query
public static PaginatedList<Z01Bank> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z01Bank> rtn = new PaginatedList<Z01Bank>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qTitle = paras["qTitle"];
if (qTitle.IsNotNullOrEmpty())
{
where += " and [Title] like @Title";
dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
}
object qAccount = paras["qAccount"];
if (qAccount.IsNotNullOrEmpty())
{
where += " and [Account] like @Account";
dbParams.Add(db.CreateParameter("Account", "%" + qAccount + "%"));
}
}
#endregion
string orderBy = "[DisplayOrder]";
if (orderCol == 0)
{
orderBy = "[DisplayOrder] desc";
}
else if (orderCol == 1)
{
orderBy = "[Title]";
}
else if (orderCol == 2)
{
orderBy = "[Title] desc";
}
else if (orderCol == 3)
{
orderBy = "[Brief]";
}
else if (orderCol == 4)
{
orderBy = "[Brief] desc";
}
else if (orderCol == 5)
{
orderBy = "[Account]";
}
else if (orderCol == 6)
{
orderBy = "[Account] desc";
}
else if (orderCol == 7)
{
orderBy = "[Contact]";
}
else if (orderCol == 8)
{
orderBy = "[Contact] desc";
}
else if (orderCol == 9)
{
orderBy = "[Tel]";
}
else if (orderCol == 10)
{
orderBy = "[Tel] desc";
}
else if (orderCol == 11)
{
orderBy = "[Fax]";
}
else if (orderCol == 12)
{
orderBy = "[Fax] desc";
}
else if (orderCol == 13)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 14)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<Z01Bank>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
//.........这里部分代码省略.........
示例5: Query
public static PaginatedList<Z01CustomerCategory> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z01CustomerCategory> rtn = new PaginatedList<Z01CustomerCategory>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qTitle = paras["qTitle"];
if (qTitle.IsNotNullOrEmpty())
{
where += " and [Title] like @Title";
dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[Title]";
}
else if (orderCol == 2)
{
orderBy = "[Title] desc";
}
else if (orderCol == 3)
{
orderBy = "[Code]";
}
else if (orderCol == 4)
{
orderBy = "[Code] desc";
}
else if (orderCol == 5)
{
orderBy = "[ParentID]";
}
else if (orderCol == 6)
{
orderBy = "[ParentID] desc";
}
int RecordCount = db.Count<Z01CustomerCategory>(where, dbParams.ToArray());
int PageCount = 0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z01CustomerCategory> records = db.Take<Z01CustomerCategory>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
//递归重组
List<Z01CustomerCategory> newRecords = new List<Z01CustomerCategory>();
ReGroup(records, newRecords, 0, "├", 0);
rtn.AddRange(newRecords);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例6: Query
//.........这里部分代码省略.........
}
object qMobileID2 = paras["qMobileID2"];
if (qMobileID2.IsNotNullOrEmpty())
{
where += " and [MobileID2] like @MobileID2";
dbParams.Add(db.CreateParameter("MobileID2", "%" + qMobileID2 + "%"));
}
object qUserType = paras["qUserType"];
if (qUserType.IsNotNullOrEmpty())
{
Int32 intqUserType = (Int32)qUserType;
if (intqUserType > 0)
{
where += " and ([UserType] & @UserType = @UserType)";
dbParams.Add(db.CreateParameter("UserType", qUserType));
}
}
object qUserStatus = paras["qUserStatus"];
if (qUserStatus.IsNotNullOrEmpty())
{
Int32 intqUserStatus = (Int32)qUserStatus;
if (intqUserStatus > 0)
{
where += " and [UserStatus] = @UserStatus";
dbParams.Add(db.CreateParameter("UserStatus", qUserStatus));
}
}
object qCreateDateStart = paras["qCreateDateStart"];
if (qCreateDateStart.IsNotNullOrEmpty())
{
where += " and [CreateDate] >= @CreateDateStart";
dbParams.Add(db.CreateParameter("CreateDateStart", qCreateDateStart));
}
object qCreateDateEnd = paras["qCreateDateEnd"];
if (qCreateDateEnd.IsNotNullOrEmpty())
{
where += " and [CreateDate] < @CreateDateEnd";
dbParams.Add(db.CreateParameter("CreateDateEnd", ((DateTime)qCreateDateEnd).AddDays(1)));
}
object qGroupID=paras["qGroupID"];
if (qGroupID.IsNotNullOrEmpty())
{
where += " and [UserID] in (select [UserID] from [UserGroup] where [GroupID][email protected])";
dbParams.Add(db.CreateParameter("GroupID", qGroupID));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[UserName]";
}
else if (orderCol == 2)
{
orderBy = "[UserName] desc";
}
else if (orderCol == 3)
{
orderBy = "[Email]";
}
else if (orderCol == 4)
{
orderBy = "[Email] desc";
}
else if (orderCol == 5)
{
orderBy = "[Nickname]";
}
else if (orderCol == 6)
{
orderBy = "[Nickname] desc";
}
int RecordCount = db.Count<User>(where, dbParams.ToArray());
int PageCount = 0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<User> records = db.Take<User>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例7: Query
public static PaginatedList<Z01Title> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z01Title> rtn = new PaginatedList<Z01Title>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qTitle = paras["qTitle"];
if (qTitle.IsNotNullOrEmpty())
{
where += " and [Title] like @Title";
dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
}
object qContent = paras["qContent"];
if (qContent.IsNotNullOrEmpty())
{
where += " and [Content] like @Content";
dbParams.Add(db.CreateParameter("Content", "%" + qContent + "%"));
}
object qCreateDateStart = paras["qCreateDateStart"];
if (qCreateDateStart != null && qCreateDateStart.ToString() != "")
{
where += " and [CreateDate] >= @CreateDateStart";
dbParams.Add(db.CreateParameter("CreateDateStart", qCreateDateStart));
}
object qCreateDateEnd = paras["qCreateDateEnd"];
if (qCreateDateEnd != null && qCreateDateEnd.ToString() != "")
{
where += " and [CreateDate] < @CreateDateEnd";
dbParams.Add(db.CreateParameter("CreateDateEnd", ((DateTime)qCreateDateEnd).AddDays(1)));
}
}
#endregion
string orderBy = "[DisplayOrder]";
if (orderCol == 0)
{
orderBy = "[DisplayOrder] desc";
}
else if (orderCol == 1)
{
orderBy = "[Title]";
}
else if (orderCol == 2)
{
orderBy = "[Title] desc";
}
else if (orderCol == 3)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 4)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<Z01Title>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z01Title> records = db.Take<Z01Title>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例8: Query
public static PaginatedList<Z01CustomerPerson> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z01CustomerPerson> rtn = new PaginatedList<Z01CustomerPerson>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qName = paras["qName"];
if (qName.IsNotNullOrEmpty())
{
where += " and [Name] like @Name";
dbParams.Add(db.CreateParameter("Name", "%" + qName + "%"));
}
object qNickname = paras["qNickname"];
if (qNickname.IsNotNullOrEmpty())
{
where += " and [Nickname] like @Nickname";
dbParams.Add(db.CreateParameter("Nickname", "%" + qNickname + "%"));
}
object qCustomerID = paras["qCustomerID"];
if (qCustomerID.IsNotNullOrEmpty())
{
where += " and [CustomerID] = @CustomerID";
dbParams.Add(db.CreateParameter("CustomerID", qCustomerID));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[Name]";
}
else if (orderCol == 2)
{
orderBy = "[Name] desc";
}
else if (orderCol == 3)
{
orderBy = "[Nickname]";
}
else if (orderCol == 4)
{
orderBy = "[Nickname] desc";
}
else if (orderCol == 5)
{
orderBy = "[Email]";
}
else if (orderCol == 6)
{
orderBy = "[Email] desc";
}
else if (orderCol == 7)
{
orderBy = "[Tel1]";
}
else if (orderCol == 8)
{
orderBy = "[Tel1] desc";
}
else if (orderCol == 9)
{
orderBy = "[Tel2]";
}
else if (orderCol == 10)
{
orderBy = "[Tel2] desc";
}
int RecordCount = db.Count<Z01CustomerPerson>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z01CustomerPerson> records = db.Take<Z01CustomerPerson>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例9: Query
public static PaginatedList<EAP.Logic.Z10.View.V_DepotProduct> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<EAP.Logic.Z10.View.V_DepotProduct> rtn = new PaginatedList<EAP.Logic.Z10.View.V_DepotProduct>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qProductID = paras["qProductID"];
if (qProductID.IsNotNullOrEmpty())
{
where += " and [ProductID] = @ProductID";
dbParams.Add(db.CreateParameter("ProductID", qProductID));
}
object qDepotID = paras["qDepotID"];
if (qDepotID.IsNotNullOrEmpty())
{
where += " and [DepotID] = @DepotID";
dbParams.Add(db.CreateParameter("DepotID", qDepotID));
}
object qProductTitle = paras["qProductTitle"];
if (qDepotID.IsNotNullOrEmpty())
{
where += " and [ProductTitle] like @ProductTitle";
dbParams.Add(db.CreateParameter("ProductTitle", "%" + qProductTitle + "%"));
}
}
#endregion
string orderBy = "[DepotID]";
if (orderCol == 0)
{
orderBy = "[DepotID] desc";
}
else if (orderCol == 1)
{
orderBy = "[ProductID]";
}
else if (orderCol == 2)
{
orderBy = "[ProductID] desc";
}
else if (orderCol == 3)
{
orderBy = "[DepotID]";
}
else if (orderCol == 4)
{
orderBy = "[DepotID] desc";
}
else if (orderCol == 5)
{
orderBy = "[CountAlarm]";
}
else if (orderCol == 6)
{
orderBy = "[CountAlarm] desc";
}
else if (orderCol == 7)
{
orderBy = "[StockSum]";
}
else if (orderCol == 8)
{
orderBy = "[StockSum] desc";
}
int RecordCount = db.Count<EAP.Logic.Z10.View.V_DepotProduct>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<EAP.Logic.Z10.View.V_DepotProduct> records = db.Take<EAP.Logic.Z10.View.V_DepotProduct>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例10: Query
public static PaginatedList<EAP.Logic.Z10.View.V_DepotFlow> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<EAP.Logic.Z10.View.V_DepotFlow> rtn = new PaginatedList<EAP.Logic.Z10.View.V_DepotFlow>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qDepotID = paras["qDepotID"];
if (qDepotID.IsNotNullOrEmpty())
{
where += " and [DepotID] = @DepotID";
dbParams.Add(db.CreateParameter("DepotID", qDepotID));
}
object qProductID = paras["qProductID"];
if (qProductID.IsNotNullOrEmpty())
{
where += " and [ProductID] = @ProductID";
dbParams.Add(db.CreateParameter("ProductID", qProductID));
}
object qCreateDateStart = paras["qCreateDateStart"];
if (qCreateDateStart != null && qCreateDateStart.ToString()!="")
{
where += " and [CreateDate] >= @CreateDateStart";
dbParams.Add(db.CreateParameter("CreateDateStart", qCreateDateStart));
}
object qCreateDateEnd = paras["qCreateDateEnd"];
if (qCreateDateEnd != null && qCreateDateEnd.ToString()!="")
{
where += " and [CreateDate] < @CreateDateEnd";
dbParams.Add(db.CreateParameter("CreateDateEnd", ((DateTime)qCreateDateEnd).AddDays(1)));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[DepotID]";
}
else if (orderCol == 2)
{
orderBy = "[DepotID] desc";
}
else if (orderCol == 3)
{
orderBy = "[OrderID]";
}
else if (orderCol == 4)
{
orderBy = "[OrderID] desc";
}
else if (orderCol == 5)
{
orderBy = "[Count]";
}
else if (orderCol == 6)
{
orderBy = "[Count] desc";
}
else if (orderCol == 7)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 8)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<EAP.Logic.Z10.View.V_DepotFlow>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<EAP.Logic.Z10.View.V_DepotFlow> records = db.Take<EAP.Logic.Z10.View.V_DepotFlow>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例11: Query
public static PaginatedList<Z10Config> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z10Config> rtn = new PaginatedList<Z10Config>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qKey = paras["qKey"];
if (qKey.IsNotNullOrEmpty())
{
where += " and [Key] like @Key";
dbParams.Add(db.CreateParameter("Key", "%" + qKey + "%"));
}
object qValue = paras["qValue"];
if (qValue.IsNotNullOrEmpty())
{
where += " and [Value] like @Value";
dbParams.Add(db.CreateParameter("Value", "%" + qValue + "%"));
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[Key]";
}
else if (orderCol == 2)
{
orderBy = "[Key] desc";
}
else if (orderCol == 3)
{
orderBy = "[Value]";
}
else if (orderCol == 4)
{
orderBy = "[Value] desc";
}
int RecordCount = db.Count<Z10Config>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z10Config> records = db.Take<Z10Config>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}
示例12: Query
public static PaginatedList<Z01Product> Query(Zippy.Data.IDalProvider db, Guid tenantID, int PageSize, int PageIndex, Hashtable paras, int? orderCol)
{
PaginatedList<Z01Product> rtn = new PaginatedList<Z01Product>();
List<System.Data.Common.DbParameter> dbParams = new List<System.Data.Common.DbParameter>();
string where = " [TenantID][email protected]";
dbParams.Add(db.CreateParameter("TenantID", tenantID));
#region 开始查询
if (paras != null)
{
object qTitle = paras["qTitle"];
if (qTitle.IsNotNullOrEmpty())
{
where += " and [Title] like @Title";
dbParams.Add(db.CreateParameter("Title", "%" + qTitle + "%"));
}
object qBrief = paras["qBrief"];
if (qBrief.IsNotNullOrEmpty())
{
where += " and [Brief] like @Brief";
dbParams.Add(db.CreateParameter("Brief", "%" + qBrief + "%"));
}
object qCreateDateStart = paras["qCreateDateStart"];
if (qCreateDateStart.IsNotNullOrEmpty())
{
where += " and [CreateDate] >= @CreateDateStart";
dbParams.Add(db.CreateParameter("CreateDateStart", qCreateDateStart));
}
object qCreateDateEnd = paras["qCreateDateEnd"];
if (qCreateDateEnd.IsNotNullOrEmpty())
{
where += " and [CreateDate] < @CreateDateEnd";
dbParams.Add(db.CreateParameter("CreateDateEnd", ((DateTime)qCreateDateEnd).AddDays(1)));
}
object qModel1 = paras["qModel1"];
if (qModel1.IsNotNullOrEmpty())
{
where += " and [Model1] like @Model1";
dbParams.Add(db.CreateParameter("Model1", "%" + qModel1 + "%"));
}
object qModel2 = paras["qModel2"];
if (qModel2.IsNotNullOrEmpty())
{
where += " and [Model2] = @Model2";
dbParams.Add(db.CreateParameter("Model2", qModel2));
}
var qBrandID = paras["qBrandID"].ToInt64(0);
if (qBrandID>0)
{
where += " and [BrandID] = @BrandID";
dbParams.Add(db.CreateParameter("BrandID", qBrandID));
}
var qStatus = paras["qStatus"].ToInt32(0);
if (qStatus > 0)
{
where += " and [ProductStatus] = @ProductStatus";
dbParams.Add(db.CreateParameter("ProductStatus", qStatus));
}
var qCateID=paras["qCateID"].ToInt64(0);
if (qCateID>0)
{
where += " and [ProductID] in (select [ProductID] from Z01ProductInCategory where [CategoryID][email protected])";
dbParams.Add(db.CreateParameter("CategoryID", qCateID));
}
}
#endregion
string orderBy = "[ViewCount] desc, ProductID";
if (orderCol == 0)
{
orderBy = "[ViewCount] desc, ProductID";
}
else if (orderCol == 1)
{
orderBy = "[Title]";
}
else if (orderCol == 2)
{
orderBy = "[Title] desc";
}
else if (orderCol == 3)
{
orderBy = "[UnitID]";
}
else if (orderCol == 4)
{
orderBy = "[UnitID] desc";
}
else if (orderCol == 5)
{
orderBy = "[PriceList]";
}
else if (orderCol == 6)
{
orderBy = "[PriceList] desc";
}
else if (orderCol == 7)
{
orderBy = "[ProductStock]";
//.........这里部分代码省略.........
示例13: Query
//.........这里部分代码省略.........
}
}
}
#endregion
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[FlowID]";
}
else if (orderCol == 2)
{
orderBy = "[FlowID] desc";
}
else if (orderCol == 3)
{
orderBy = "[BankID]";
}
else if (orderCol == 4)
{
orderBy = "[BankID] desc";
}
else if (orderCol == 5)
{
orderBy = "[CategoryID]";
}
else if (orderCol == 6)
{
orderBy = "[CategoryID] desc";
}
else if (orderCol == 7)
{
orderBy = "[OrderID]";
}
else if (orderCol == 8)
{
orderBy = "[OrderID] desc";
}
else if (orderCol == 9)
{
orderBy = "[FlowType]";
}
else if (orderCol == 10)
{
orderBy = "[FlowType] desc";
}
else if (orderCol == 11)
{
orderBy = "[FlowStatus]";
}
else if (orderCol == 12)
{
orderBy = "[FlowStatus] desc";
}
else if (orderCol == 13)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 14)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<EAP.Logic.Z01.View.V_FinancialFlow>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<EAP.Logic.Z01.View.V_FinancialFlow> records = db.Take<EAP.Logic.Z01.View.V_FinancialFlow>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
if (qCurrency.IsNotNullOrEmpty())
{
string sqlSum = "select sum(Amount) as sAmount from V_FinancialFlow where " + where;
object oSum = db.ExecuteScalar(sqlSum, dbParams.ToArray());
sumAll = oSum.ToDecimal();
}
else
{
sumAll = 0;
}
return rtn;
}
示例14: Take
/// <summary>
/// 数据源 查询
/// </summary>
/// <param name="where">查询条件</param>
/// <param name="orderby">排序方式</param>
/// <param name="PageSize">每页数量</param>
/// <param name="PageIndex">页码</param>
/// <param name="cmdParameters">查询条件赋值</param>
/// <returns></returns>
public static PaginatedList<DataSource> Take(Zippy.Data.IDalProvider db, string @where, string orderby, int PageSize, int PageIndex, params System.Data.Common.DbParameter[] cmdParameters)
{
PaginatedList<DataSource> rtn = new PaginatedList<DataSource>();
List<DataSource> records = db.Take<DataSource>(where + " order by " + orderby, PageSize, PageIndex, cmdParameters);
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = db.Count<DataSource>(where, cmdParameters);
return rtn;
}
示例15: Query
//.........这里部分代码省略.........
string orderBy = "[CreateDate] desc";
if (orderCol == 0)
{
orderBy = "[CreateDate] desc";
}
else if (orderCol == 1)
{
orderBy = "[CommunicationID]";
}
else if (orderCol == 2)
{
orderBy = "[CommunicationID] desc";
}
else if (orderCol == 3)
{
orderBy = "[CustomerID]";
}
else if (orderCol == 4)
{
orderBy = "[CustomerID] desc";
}
else if (orderCol == 5)
{
orderBy = "[VisitWay]";
}
else if (orderCol == 6)
{
orderBy = "[VisitWay] desc";
}
else if (orderCol == 7)
{
orderBy = "[Wish]";
}
else if (orderCol == 8)
{
orderBy = "[Wish] desc";
}
else if (orderCol == 9)
{
orderBy = "[NextVisitDate]";
}
else if (orderCol == 10)
{
orderBy = "[NextVisitDate] desc";
}
else if (orderCol == 11)
{
orderBy = "[SuccessRatio]";
}
else if (orderCol == 12)
{
orderBy = "[SuccessRatio] desc";
}
else if (orderCol == 13)
{
orderBy = "[VisitDate]";
}
else if (orderCol == 14)
{
orderBy = "[VisitDate] desc";
}
else if (orderCol == 15)
{
orderBy = "[VisitDuration]";
}
else if (orderCol == 16)
{
orderBy = "[VisitDuration] desc";
}
else if (orderCol == 17)
{
orderBy = "[CreateDate]";
}
else if (orderCol == 18)
{
orderBy = "[CreateDate] desc";
}
int RecordCount = db.Count<Z30Communication>(where, dbParams.ToArray());
int PageCount =0;
if (RecordCount % PageSize == 0)
{
PageCount = RecordCount / PageSize;
}
else
{
PageCount = RecordCount / PageSize + 1;
}
if (PageIndex > PageCount)
PageIndex = PageCount;
if (PageIndex < 1)
PageIndex = 1;
List<Z30Communication> records = db.Take<Z30Communication>(where + " order by " + orderBy, PageSize, PageIndex, dbParams.ToArray());
rtn.AddRange(records);
rtn.PageIndex = PageIndex;
rtn.PageSize = PageSize;
rtn.TotalCount = RecordCount;
return rtn;
}