public LogicalConditionPolicy(int id, LogicalConnections inlog, LogicalConnections outlog) { this.id = id; this.inlog = inlog; this.outlog = outlog; this.children = new List <PurchasePolicy>(); }
public UserConditionPolicy(int id, string adress, bool isregister, LogicalConnections act) { this.id = id; this.adress = adress; Isregister = isregister; this.act = act; }
public inventoryConditionPolicy(int id, int productID, int min, LogicalConnections act) { this.id = id; this.ProductID = productID; this.min = min; this.act = act; }
public IfThenCondition(int id, PurchasePolicy ifCond, PurchasePolicy thenCond, LogicalConnections act) { this.id = id; this.ifCond = ifCond ?? throw new ArgumentNullException(nameof(ifCond)); this.thenCond = thenCond ?? throw new ArgumentNullException(nameof(thenCond)); this.act = act; }
public ProductConditionPolicy(int id, int productID, int min, int max, LogicalConnections act) { this.id = id; this.ProductID = productID; this.min = min; this.max = max; this.act = act; }
public BuyConditionPolicy(int id, int min, int max, int sumMin, int sumMax, LogicalConnections act) { this.id = id; this.Min = min; this.Max = max; this.SumMin = sumMin; this.SumMax = sumMax; this.act = act; }
public void setUp() { store = new Store(1111, "adidas"); admin = new User(0, "admin", "1234", true, true); basket_admin = admin.Basket; ownerUser = new User(1234, "Seifan", "2457", false, false); ownerUser.register(ownerUser.UserName, ownerUser.Password); ownerUser.signIn(ownerUser.UserName, ownerUser.Password); ownerRole = new Owner(store, ownerUser); ownerUser.Roles.Add(store.Id, ownerRole); p1 = new Product(0, "first", "", "", 100); p2 = new Product(1, "second", "", "", 50); p3 = new Product(2, "third", "", "", 200); p4 = new Product(3, "fourth", "", "", 300); pis1 = new ProductInStore(20, store, p1); pis2 = new ProductInStore(20, store, p2); pis3 = new ProductInStore(20, store, p3); pis4 = new ProductInStore(20, store, p4); store.Products.Add(p1.Id, pis1); store.Products.Add(p2.Id, pis2); store.Products.Add(p3.Id, pis3); store.Products.Add(p4.Id, pis4); products = new List <string>(); products.Add("first"); products.Add("second"); products.Add("third"); products.Add("fourth"); system = new TradingSystem(null, null); system.Stores.Add(store.Id, store); system.Users.Add(admin.Id, admin); system.Users.Add(ownerUser.Id, ownerUser); logic = LogicalConnections.and; duplicate = DuplicatePolicy.WithMultiplication; date1 = new DateTime(2019, 10, 1); lc = new LogicalCondition(0, 0.5, null, new DateTime(2222, 1, 1), DuplicatePolicy.WithMultiplication, LogicalConnections.and); }
public virtual int addConditionalDiscuntPolicy(List <String> products, String condition, double discountPrecentage, DateTime expiredDate, int discountId, DuplicatePolicy duplicate, LogicalConnections logic) { return(store.addConditionalDiscuntPolicy(discountId, products, condition, discountPrecentage, expiredDate, duplicate, logic)); }
public PurchesPolicyData(int type, int id, int productID, int quntity, int min, int max, int sumMin, int sumMax, LogicalConnections act, string adress, bool isregister) { this.Type = type; this.Id = id; this.ProductID = productID; this.Quntity = quntity; this.Min = min; this.Max = max; this.SumMin = sumMin; this.SumMax = sumMax; this.Act = act; this.Adress = adress; Isregister = isregister; }
public override int addConditionalDiscuntPolicy(List <String> products, String condition, double discountPrecentage, int expiredDiscountDate, DuplicatePolicy duplicate, LogicalConnections logic, int discountId, int storeId) { return(1); }
public override int addConditionalDiscuntPolicy(int discountId, List <String> productsList, String condition, double discountPrecentage, DateTime expiredDiscountDate, DuplicatePolicy dup, LogicalConnections logic) { return(1); }
public LogicalCondition(int id, double discountPrecentage, Dictionary <int, ProductInStore> products, DateTime endDateDiscount, DuplicatePolicy dup, LogicalConnections logical) : base(id, discountPrecentage, products, endDateDiscount, dup) { this.logical = logical; Children = new Dictionary <int, ConditionalDiscount>(); }