public static Z01Beetle.Entity.Z01Customer GetCustomer(this Z10Order order, Zippy.Data.IDalProvider db) { Z01Beetle.Entity.Z01Customer rtn = db.FindUnique <Z01Beetle.Entity.Z01Customer>("CustomerID=@CustomerID", db.CreateParameter("CustomerID", order.CustomerID)); if (rtn == null) { rtn = new Z01Beetle.Entity.Z01Customer(); } return(rtn); }
/// <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>("OrderID=@OrderID and TenantID=@TenantID", db.CreateParameter("OrderID", orderID), db.CreateParameter("TenantID", tenantID)); order.Items = db.Take <Z10OrderItem>("OrderID=@OrderID and TenantID=@TenantID", db.CreateParameter("OrderID", orderID), db.CreateParameter("TenantID", tenantID)); return(order); }
/// <summary> /// 删除一种权限 /// </summary> /// <param name="roleID"></param> /// <param name="permissionID"></param> /// <param name="permissionType"></param> /// <param name="tenantID"></param> /// <param name="optUser"></param> /// <param name="db"></param> public static void RemovePermission(Guid roleID, long permissionID, int permissionType, Guid?tenantID, Guid?optUser, Zippy.Data.IDalProvider db) { RolePermission rp = db.FindUnique <RolePermission>("RoleID=@RoleID and PermissionID=@PermissionID and TenantID=@TenantID", db.CreateParameter("RoleID", roleID), db.CreateParameter("PermissionID", permissionID), db.CreateParameter("TenantID", tenantID)); if (rp != null) { rp.PermissionType = rp.PermissionType & (~permissionType); rp.Updater = optUser; rp.UpdateDate = DateTime.Now; db.Update(rp); } }
/// <summary> /// 制作一个订单的快照 /// </summary> /// <param name="orderID"></param> /// <param name="tenantID"></param> /// <param name="userID"></param> /// <param name="db"></param> public static void Snap(long orderID, Guid tenantID, Guid userID, Zippy.Data.IDalProvider db) { Order order = new Order(); order.Z10Order = db.FindUnique <Z10Order>("OrderID=@OrderID and TenantID=@TenantID", db.CreateParameter("OrderID", orderID), db.CreateParameter("TenantID", tenantID)); order.Items = db.Take <Z10OrderItem>("OrderID=@OrderID and TenantID=@TenantID", db.CreateParameter("OrderID", orderID), db.CreateParameter("TenantID", tenantID)); order.Z10Order.IsSnap = 1; order.Z10Order.UpdateDate = DateTime.Now; order.Z10Order.Updater = userID; foreach (Z10OrderItem item in order.Items) { item.UpdateDate = DateTime.Now; item.Updater = userID; } order.Save(tenantID, db, null); }
/// <summary> /// 增加一种权限 /// </summary> /// <param name="roleID"></param> /// <param name="permissionID"></param> /// <param name="permissionType"></param> /// <param name="tenantID"></param> /// <param name="optUser"></param> /// <param name="db"></param> public static void SetPermission(Guid roleID, long permissionID, int permissionType, Guid?tenantID, Guid?optUser, Zippy.Data.IDalProvider db) { RolePermission rp = db.FindUnique <RolePermission>("RoleID=@RoleID and PermissionID=@PermissionID and TenantID=@TenantID", db.CreateParameter("RoleID", roleID), db.CreateParameter("PermissionID", permissionID), db.CreateParameter("TenantID", tenantID)); if (rp == null) { rp = new RolePermission(); rp.RoleID = roleID; rp.PermissionID = permissionID; rp.PermissionType = permissionType; rp.TenantID = tenantID; rp.Creator = optUser; db.Insert(rp); } else { rp.PermissionType = rp.PermissionType | permissionType; rp.Updater = optUser; rp.UpdateDate = DateTime.Now; db.Update(rp); } }
public static Z01Brand Create(Zippy.Data.IDalProvider db, Int64 _BrandID) { Z01Brand rtn = db.FindUnique <Z01Brand>(_BrandID); return(rtn); }
/// <summary> /// 表示 [用户] 对应的实体 /// </summary> public static User GetUserIDEntity(Zippy.Data.IDalProvider db, UserGroup entity) { return db.FindUnique<User>("UserID=@UserID", db.CreateParameter("UserID", entity.UserID)); }
public static UserGroup Create(Zippy.Data.IDalProvider db, Int64 _UGID) { UserGroup rtn = db.FindUnique<UserGroup>(_UGID); return rtn; }
public static Z10Cabbage.Entity.Z10OrderItem GetTop1OrderItem(this Z10Order order, Zippy.Data.IDalProvider db) { return(db.FindUnique <Z10Cabbage.Entity.Z10OrderItem>("OrderID=@OrderID", db.CreateParameter("OrderID", order.OrderID))); }
/// <summary> /// 表示 [角色] 对应的实体 /// </summary> public static Role GetRoleIDEntity(Zippy.Data.IDalProvider db, UserRole entity) { return(db.FindUnique <Role>("RoleID=@RoleID", db.CreateParameter("RoleID", entity.RoleID))); }
public static Z01UserInfo Create(Zippy.Data.IDalProvider db, Guid _UserID) { Z01UserInfo rtn = db.FindUnique <Z01UserInfo>(_UserID); return(rtn); }
/// <summary> /// 表示 [头衔/职务] 对应的实体 /// </summary> public static Z01Title GetTitleIDEntity(Zippy.Data.IDalProvider db, Z01UserInfo entity) { return(db.FindUnique <Z01Title>("TitleID=@TitleID", db.CreateParameter("TitleID", entity.TitleID))); }
public static Currency Create(Zippy.Data.IDalProvider db, String _ID) { Currency rtn = db.FindUnique <Currency>("ID=@ID", db.CreateParameter("ID", _ID)); return(rtn); }
public static PropertyTemplate Create(Zippy.Data.IDalProvider db, Int64 _TemplateID) { PropertyTemplate rtn = db.FindUnique <PropertyTemplate>(_TemplateID); return(rtn); }
public static Z01CustomerCategory GetParentIDEntity(this Z01CustomerCategory entity) { Zippy.Data.IDalProvider db = Zippy.Data.DalFactory.CreateProvider(); return(db.FindUnique <Z01CustomerCategory>("CategoryID=@CategoryID", db.CreateParameter("CategoryID", entity.ParentID))); }
/// <summary> /// 表示 [模板] 对应的实体 /// </summary> public static PropertyTemplate GetTemplateIDEntity(Zippy.Data.IDalProvider db, ExtProperty entity) { return(db.FindUnique <PropertyTemplate>("TemplateID=@TemplateID", db.CreateParameter("TemplateID", entity.TemplateID))); }
public static ExtProperty Create(Zippy.Data.IDalProvider db, Int64 _PropertyID) { ExtProperty rtn = db.FindUnique <ExtProperty>(_PropertyID); return(rtn); }
public static RolePermission Create(Zippy.Data.IDalProvider db, Int64 _RolePermissionID) { RolePermission rtn = db.FindUnique <RolePermission>(_RolePermissionID); return(rtn); }
public static UserRole Create(Zippy.Data.IDalProvider db, Int64 _UserRoleID) { UserRole rtn = db.FindUnique <UserRole>(_UserRoleID); return(rtn); }
public static Z10Config Create(Zippy.Data.IDalProvider db, Int64 _ConfigID) { Z10Config rtn = db.FindUnique <Z10Config>(_ConfigID); return(rtn); }
public static EAP.Bus.Entity.Currency GetCurrency(this Z10Order order, Zippy.Data.IDalProvider db) { return(db.FindUnique <EAP.Bus.Entity.Currency>("ID=@ID", db.CreateParameter("ID", order.Currency))); }
/// <summary> /// 表示 [分类] 对应的实体 /// </summary> public static Z01CustomerCategory GetCategoryIDEntity(Zippy.Data.IDalProvider db, Z01CustomerInCategory entity) { return(db.FindUnique <Z01CustomerCategory>("CategoryID=@CategoryID", db.CreateParameter("CategoryID", entity.CategoryID))); }
public static Z10Order Create(Zippy.Data.IDalProvider db, Int64 _OrderID) { Z10Order rtn = db.FindUnique <Z10Order>(_OrderID); return(rtn); }
public static Z01CustomerInCategory Create(Zippy.Data.IDalProvider db, Int64 _CICID) { Z01CustomerInCategory rtn = db.FindUnique <Z01CustomerInCategory>(_CICID); return(rtn); }
/// <summary> /// 表示 [组] 对应的实体 /// </summary> public static Group GetGroupIDEntity(Zippy.Data.IDalProvider db, UserGroup entity) { return db.FindUnique<Group>("GroupID=@GroupID", db.CreateParameter("GroupID", entity.GroupID)); }
public static Z30Communication Create(Zippy.Data.IDalProvider db, Int64 _CommunicationID) { Z30Communication rtn = db.FindUnique <Z30Communication>(_CommunicationID); return(rtn); }
/// <summary> /// 表示 [生产商] 对应的实体 /// </summary> public static Z01Customer GetProducerEntity(Zippy.Data.IDalProvider db, Z01Brand entity) { return(db.FindUnique <Z01Customer>("CustomerID=@CustomerID", db.CreateParameter("CustomerID", entity.Producer))); }
public static Z01Bank Create(Zippy.Data.IDalProvider db, Int64 _BankID) { Z01Bank rtn = db.FindUnique <Z01Bank>(_BankID); return(rtn); }
public static Culture Create(Zippy.Data.IDalProvider db, Guid _CultureID) { Culture rtn = db.FindUnique <Culture>(_CultureID); return(rtn); }
public static Tenant Create(Zippy.Data.IDalProvider db, Guid _TenantID) { Tenant rtn = db.FindUnique <Tenant>(_TenantID); return(rtn); }