本文整理汇总了C#中Zippy类的典型用法代码示例。如果您正苦于以下问题:C# Zippy类的具体用法?C# Zippy怎么用?C# Zippy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Zippy类属于命名空间,在下文中一共展示了Zippy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCustomer
public static Z01Beetle.Entity.Z01Customer GetCustomer(this Z10Order order, Zippy.Data.IDalProvider db)
{
Z01Beetle.Entity.Z01Customer rtn = db.FindUnique<Z01Beetle.Entity.Z01Customer>("[email protected]", db.CreateParameter("CustomerID", order.CustomerID));
if (rtn == null)
rtn = new Z01Beetle.Entity.Z01Customer();
return rtn;
}
示例2: GetRoles
/// <summary>
/// 获取角色
/// </summary>
/// <param name="db"></param>
/// <param name="tenantID"></param>
/// <returns></returns>
public static List<Role> GetRoles(Zippy.Data.IDalProvider db, Guid tenantID)
{
//if (System.Web.HttpContext.Current.Cache["Roles_" + tenantID].IsNotNullOrEmpty())
// return System.Web.HttpContext.Current.Cache["Roles_" + tenantID] as List<Role>;
List<Role> xroles = db.Take<Role>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
System.Web.HttpContext.Current.Cache["Roles_" + tenantID] = xroles;
return xroles;
}
示例3: GetDepots
public static List<Z10Cabbage.Entity.Z10Depot> GetDepots(Guid tenantID, Zippy.Data.IDalProvider db)
{
if (System.Web.HttpContext.Current.Cache["Depots"].IsNotNullOrEmpty())
return System.Web.HttpContext.Current.Cache["Depots"] as List<Z10Cabbage.Entity.Z10Depot>;
List<Z10Cabbage.Entity.Z10Depot> xdepots = db.Take<Z10Cabbage.Entity.Z10Depot>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
System.Web.HttpContext.Current.Cache["Depots"] = xdepots;
return xdepots;
}
示例4: GetCurrencies
/// <summary>
/// 获取货币
/// </summary>
/// <param name="db"></param>
/// <returns></returns>
public static List<Currency> GetCurrencies(Zippy.Data.IDalProvider db)
{
//if (System.Web.HttpContext.Current.Cache["Currencies"].IsNotNullOrEmpty())
// return System.Web.HttpContext.Current.Cache["Currencies"] as List<Currency>;
List<EAP.Bus.Entity.Currency> xcurrencies = db.Take<EAP.Bus.Entity.Currency>("1=1 order by DisplayOrder");
System.Web.HttpContext.Current.Cache["Currencies"] = xcurrencies;
return xcurrencies;
}
示例5: Delete
public static int Delete(Zippy.Data.IDalProvider db, Z10Order xOrder)
{
//db.Delete<Z10OrderItem>("Orde[email protected]", db.CreateParameter("OrderID", _OrderID));
//db.Delete<Z10Order>(_OrderID);
xOrder.DeleteFlag = (int)EAP.Logic.DeleteFlags.Deleted;
var result = db.Update<Z10Order>(xOrder);
return result;
}
示例6: PaperTemplateSelectOptions
/// <summary>
/// 合同条款下拉列表
/// </summary>
/// <param name="tenantID"></param>
/// <param name="db"></param>
/// <returns></returns>
public static string PaperTemplateSelectOptions(Guid tenantID, Zippy.Data.IDalProvider db)
{
StringBuilder sb = new StringBuilder();
List<Z01PaperTemplate> xobjs = db.Take<Z01PaperTemplate>("[email protected] order by DisplayOrder", db.CreateParameter("TenantID", tenantID));
foreach (var xobj in xobjs)
{
sb.AppendLine("<option value='" + xobj.TemplateID + "'>" + xobj.Title + "</option>");
}
return sb.ToString();
}
示例7: DepotSelectOptions
/// <summary>
/// 仓库的下拉列表项
/// </summary>
/// <returns></returns>
public static string DepotSelectOptions(Guid tenantID, Zippy.Data.IDalProvider db)
{
StringBuilder sb = new StringBuilder();
List<Z10Cabbage.Entity.Z10Depot> xdepots = Helper.GetDepots(tenantID, db);
foreach (Z10Cabbage.Entity.Z10Depot depot in xdepots)
{
sb.Append("<option value='" + depot.DepotID + "'>" + depot.Title + "</option>");
}
return sb.ToString();
}
示例8: LoadFromDB
/// <summary>
/// 从数据库中载入订单
/// </summary>
/// <param name="orderID"></param>
/// <param name="tenantID"></param>
/// <param name="db"></param>
/// <returns></returns>
public static Order LoadFromDB(long orderID, Guid tenantID, Zippy.Data.IDalProvider db)
{
Order order = new Order();
order.Z10Order = db.FindUnique<Z10Order>("O[email protected] and [email protected]",
db.CreateParameter("OrderID", orderID),
db.CreateParameter("TenantID", tenantID));
order.Items = db.Take<Z10OrderItem>("[email protected] and [email protected]",
db.CreateParameter("OrderID", orderID),
db.CreateParameter("TenantID", tenantID));
return order;
}
示例9: CurrencySelectOptions
/// <summary>
/// 币种的下拉列表项
/// </summary>
/// <returns></returns>
public static string CurrencySelectOptions(Zippy.Data.IDalProvider db)
{
StringBuilder sb = new StringBuilder();
List<EAP.Bus.Entity.Currency> xcurrencies = Helper.GetCurrencies(db);
foreach (EAP.Bus.Entity.Currency xcurrency in xcurrencies)
{
sb.AppendLine("<option value='" + xcurrency.ID + "'>" + xcurrency.Title + "(" + xcurrency.ID + ")</option>");
}
return sb.ToString();
}
示例10: GetParentIDEntitiesHtmlOption
/// <summary>
/// 表示 [父分类] 被选实体集合的 option html
/// </summary>
public static string GetParentIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, System.Int64? selectedValue)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
List<Permission> objs = db.Take<Permission>("ParentID=0");
foreach (var obj in objs)
{
if (selectedValue == obj.PermissionID)
sb.AppendLine("<option value='" + obj.PermissionID + "' selected='selected'>" + obj.Title + "</option>");
else
sb.AppendLine("<option value='" + obj.PermissionID + "'>" + obj.Title + "</option>");
}
return sb.ToString();
}
示例11: GetTitleIDEntitiesHtmlOption
/// <summary>
/// 表示 [父分类] 被选实体集合的 option html
/// </summary>
public static string GetTitleIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, Guid tenantID, System.Int64? selectedValue)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
List<Z01Title> objs = db.Take<Z01Title>("[email protected]", db.CreateParameter("TenantID", tenantID));
foreach (var obj in objs)
{
if (selectedValue == obj.TitleID)
sb.AppendLine("<option value='" + obj.TitleID + "' selected='selected'>" + obj.Title + "</option>");
else
sb.AppendLine("<option value='" + obj.TitleID + "'>" + obj.Title + "</option>");
}
return sb.ToString();
}
示例12: GetParentIDEntitiesHtmlOption
/// <summary>
/// 表示 [父分类] 被选实体集合的 option html
/// </summary>
public static string GetParentIDEntitiesHtmlOption(Zippy.Data.IDalProvider db, Guid tenantID, long? selectedValue, long removeID)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
List<Z01CustomerCategory> objs = db.Take<Z01CustomerCategory>("[email protected]", db.CreateParameter("TenantID", tenantID));
List<Z01CustomerCategory> newObjs = new List<Z01CustomerCategory>();
ReGroup(objs, newObjs, 0, "├", removeID);
foreach (var obj in newObjs)
{
if (selectedValue == obj.CategoryID)
sb.AppendLine("<option value='" + obj.CategoryID + "' selected='selected'>" + obj.Title + "</option>");
else
sb.AppendLine("<option value='" + obj.CategoryID + "'>" + obj.Title + "</option>");
}
return sb.ToString();
}
示例13: GetPermissions
/// <summary>
/// 获取所有权限
/// </summary>
/// <param name="db"></param>
/// <param name="tenantID"></param>
/// <returns></returns>
public static List<Permission> GetPermissions(Zippy.Data.IDalProvider db, Guid? tenantID)
{
//if (System.Web.HttpContext.Current.Cache["Permissions_" + tenantID].IsNotNullOrEmpty())
// return System.Web.HttpContext.Current.Cache["Permissions_" + tenantID] as List<Permission>;
List<Permission> xobjs = db.Take<Permission>();
//按照父子关系顺序重建
List<Permission> newRecords = new List<Permission>();
IEnumerable<Permission> rootRecords = xobjs.Where(s => (s.ParentID ?? 0) == 0).OrderBy(s => s.DisplayOrder);
foreach (Permission per in rootRecords)
{
newRecords.Add(per);
newRecords.AddRange(xobjs.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder));
}
System.Web.HttpContext.Current.Cache["Permissions_" + tenantID] = newRecords;
return newRecords;
}
示例14: ToJsonMenu
/// <summary>
/// j将当前用户的url都显示出来
/// </summary>
/// <param name="user"></param>
/// <param name="tenantID"></param>
/// <param name="db"></param>
/// <returns></returns>
public static string ToJsonMenu(Zippy.SaaS.Entity.User user, Guid? tenantID, Zippy.Data.IDalProvider db)
{
System.Text.StringBuilder menus = new StringBuilder();
menus.AppendLine("{");
List<Permission> xobjs = GetPermissions(db, tenantID);
List<EAP.Logic.Bus.View.V_UserPermission> mePers = null;
if (!user.UserType.BitIs(Zippy.SaaS.UserTypes.SystemAdministrator))
{
mePers = db.Take<EAP.Logic.Bus.View.V_UserPermission>("[email protected]", db.CreateParameter("UserID", user.UserID));
}
var rootRecords = xobjs.Where(s => (s.ParentID ?? 0) == 0 && s.PermissionStatus == 1).OrderBy(s => s.DisplayOrder);
foreach (Permission per in rootRecords)
{
if (mePers == null || (mePers != null && mePers.Exists(s => s.PermissionID == per.PermissionID)))
{
if (per.PermissionStatus == 1)
menus.AppendLine("'" + per.PermissionID + "' : [['" + per.PermissionID + "','" + per.Title + "','" + per.Icon + "'],{");
var subRecords = xobjs.Where(s => s.ParentID == per.PermissionID).OrderBy(s => s.DisplayOrder);
foreach (Permission subper in subRecords)
{
if (mePers == null || (mePers != null && mePers.Exists(s => s.PermissionID == subper.PermissionID)))
{
if (subper.PermissionStatus == 1)
menus.AppendLine("'" + subper.PermissionID + "' : ['" + subper.Title + "','" + subper.Url + "','" + subper.Icon + "'],");
}
}
//if (menus.ToString().EndsWith(",")) menus.Remove(menus.Length - 1, 1);
menus.AppendLine("}],");
}
}
//if (menus.ToString().EndsWith(",\n")) menus.Remove(menus.Length - 1, 1);
menus.AppendLine("}");
return menus.ToString().Replace(",\r\n}", "\r\n}");
}
示例15: Take
public static List<DataSource> Take(Zippy.Data.IDalProvider db,int count)
{
return db.Take<DataSource>(count, true);
}