public DeliveryTask(DefaultAddress from, DefaultAddress to) : base(JobTaskTypes.DELIVERY, "Deliverying Package") { this.From = from; this.To = to; this.Result = new AssetTaskResult(); }
public DeliveryTask(DefaultAddress from, DefaultAddress to) : base(JobTaskTypes.DELIVERY, "Delivery") { this.From = from; this.To = to; this.Result = new AssetTaskResult(); }
protected DeliveryTask(DefaultAddress from, DefaultAddress to, string type) : this(from, to) { this.Type = type; if (type != JobTaskTypes.SECURE_DELIVERY) { throw new NotSupportedException($"{type} is not supported as a JobTaskType under Delivery JobTask"); } }
public int Delete(Guid customerId, int addressId, bool persist = true) { DefaultAddress cartDetail = Find(c => c.AddressId == addressId && c.CustomerId == customerId); cartDetail.IsDeleted = true; Table.Update(cartDetail); //Table.Attach(cartDetail).State = EntityState.IsDeleted; return(persist ? SaveChanges() : 0); }
public void Test_DefaultAddress_Creation() { addressWithFormattedString = new DefaultAddress("Test Formatted Address", new Point(new double[] { 1, 2 }.ToList())); Assert.AreEqual("Test Formatted Address", addressWithFormattedString.Address); address = new DefaultAddress("Test AddressLine 1", "Test AddressLine 2", "Testlocality", "Dhaka", "1217", "Bangladesh", new Point(new double[] { 1, 2 }.ToList())); address.State = "Dhaka"; Assert.AreEqual("Test AddressLine 1", address.AddressLine1); Assert.AreEqual("Test AddressLine 2", address.AddressLine2); Assert.AreEqual("Dhaka", address.City); Assert.AreEqual("1217", address.PostalCode); Assert.AreEqual("Bangladesh", address.Country); Assert.AreEqual("Test AddressLine 1, Test AddressLine 2, Testlocality, Dhaka-1217, Dhaka, Bangladesh", address.Address); }
public void Test_DefaultAddress_Creation() { addressWithFormattedString = new DefaultAddress("Test Formatted Address", new Point(new double[] { 1, 2 }.ToList())); Assert.AreEqual("Test Formatted Address", addressWithFormattedString.Address); address = new DefaultAddress("Test AddressLine 1", "Test AddressLine 2", "TestLocality", "Dhaka", "1217", "Bangladesh", new Point(new double[] { 1, 2 }.ToList())); address.State = "Dhaka"; Assert.AreEqual("Test AddressLine 1", address.AddressLine1); Assert.AreEqual("Test AddressLine 2", address.AddressLine2); Assert.AreEqual("Dhaka", address.City); Assert.AreEqual("1217", address.PostalCode); Assert.AreEqual("Bangladesh", address.Country); Assert.AreEqual("Test AddressLine 1, Test AddressLine 2, TestLocality, Dhaka-1217, Dhaka, Bangladesh", address.Address); }
public void Test_DeliveryOrder_Creation_With_Name() { DefaultAddress FromLocation = new DefaultAddress("Test From Address", new Point((new double[] { 1, 2 }).ToList())); DefaultAddress ToLocation = new DefaultAddress("Test To Address", new Point((new double[] { 2, 1 }).ToList())); string orderName = "Test Delivery Order"; string PackageDescription = "Sample Package Description"; List <ItemDetails> invoiceItems = new List <ItemDetails>(); invoiceItems.Add(new ItemDetails() { Item = "Test Item 1", Price = 100, Quantity = 1, VAT = 10, Weight = 5 }); invoiceItems.Add(new ItemDetails() { Item = "Test Item 2", Price = 100, Quantity = 3, VAT = 20, Weight = 2 }); DeliveryOrder order = new DeliveryOrder(orderName); order.From = FromLocation; order.To = ToLocation; order.Description = PackageDescription; order.UserId = "12345678"; Assert.IsNotNull(order); Assert.AreEqual(FromLocation, order.From); Assert.AreEqual(ToLocation, order.To); Assert.AreEqual(orderName, order.Name); Assert.AreEqual("default", order.Variant); Assert.AreEqual(JobTaskTypes.DELIVERY, order.Type); Assert.Null(order.ETA); Assert.Null(order.ETAMinutes); Assert.AreEqual("12345678", order.UserId); }
public void Test_DeliveryOrder_Creation_With_Name() { DefaultAddress FromLocation = new DefaultAddress("Test From Address", new Point((new double[] { 1, 2 }).ToList())); DefaultAddress ToLocation = new DefaultAddress("Test To Address", new Point((new double[] { 2, 1 }).ToList())); string orderName = "Test Delivery Order"; string PackageDescription = "Sample Package Description"; List<ItemDetails> invoiceItems = new List<ItemDetails>(); invoiceItems.Add(new ItemDetails() { Item = "Test Item 1", Price = 100, Quantity = 1, VAT = 10, Weight = 5 }); invoiceItems.Add(new ItemDetails() { Item = "Test Item 2", Price = 100, Quantity = 3, VAT = 20, Weight = 2 }); DeliveryOrder order = new DeliveryOrder(orderName); order.From = FromLocation; order.To = ToLocation; order.Description = PackageDescription; order.UserId = "12345678"; Assert.IsNotNull(order); Assert.AreEqual(FromLocation, order.From); Assert.AreEqual(ToLocation, order.To); Assert.AreEqual(orderName, order.Name); Assert.AreEqual("default", order.Variant); Assert.AreEqual(JobTaskTypes.DELIVERY, order.Type); Assert.Null(order.ETA); Assert.Null(order.ETAMinutes); Assert.AreEqual("12345678", order.UserId); }
public PackagePickUpTask(DefaultAddress pickupLocation) : base(JobTaskTypes.PACKAGE_PICKUP, pickupLocation) { this.Name = "Package pick up"; this.Result = new AssetTaskResult(); }
public AssignAssetTask(string type, string name, DefaultAddress from, DefaultAddress to) : base(type, name) { From = from; To = to; }
//public int Update(Guid customerId, int cartId, int newQuantity, bool persist = true) //{ // DefaultAddress cartDetail = Find(c => c.AddressId == cartId && c.CustomerId == customerId); // Table.Attach(cartDetail).State = EntityState.Deleted; // return persist ? SaveChanges() : 0; //} public virtual int Delete(DefaultAddress entity, bool persist = true) { entity.IsDeleted = true; Table.Update(entity); return(persist ? SaveChanges() : 0); }
public int Add(DefaultAddress entity, bool persist = true) { Table.Add(entity); return(persist ? SaveChanges() : 0); }
public SecureDeliveryTask(DefaultAddress from, DefaultAddress to) : base(from, to, JobTaskTypes.SECURE_DELIVERY) { this.Name = "Secure delivery"; }
public RidePickUpTask(DefaultAddress pickupLocation) :base(JobTaskTypes.RIDE_PICKUP, "Picking up", pickupLocation) { this.PickupLocation = pickupLocation; }
public PickUpTask(string type, string name, DefaultAddress pickupLocation) : base(type, name) { this.PickupLocation = pickupLocation; }
public FetchDeliveryManTask(DefaultAddress from, DefaultAddress to) : base(JobTaskTypes.FETCH_DELIVERYMAN, "Fetching Delivery Guy", from, to) { this.Result = new DefaultAssignAssetTaskResult(); }
public void Test_DefaultAddress_Creation_Without_AddressLine() { Assert.Throws <ArgumentException>(() => { address = new DefaultAddress("", "Test AddressLine 2", "Testlocality", "Dhaka", "1217", "Bangladesh", new Point(new double[] { 1, 2 }.ToList())); }); }
public DropPoint(string userId, string name, DefaultAddress address) { this.Name = name; this.UserId = userId; this.Address = address; }
public PickUpTask(string type, DefaultAddress pickupLocation) : base(type, "Pick up") { this.PickupLocation = pickupLocation; }
public FetchDeliveryManTask(DefaultAddress from, DefaultAddress to) : base(JobTaskTypes.FETCH_DELIVERYMAN, from, to) { this.Result = new DefaultAssignAssetTaskResult(); }
protected DeliveryTask(DefaultAddress from, DefaultAddress to, string type, string name) : base(type, name) { if (type != JobTaskTypes.SECURE_DELIVERY) throw new NotSupportedException($"{type} is not supported as a JobTaskType under Delivery JobTask"); }
public AssignAssetTask(string type, DefaultAddress from, DefaultAddress to) : base(type, "Assign asset") { From = from; To = to; }
public SecureDeliveryTask(DefaultAddress from, DefaultAddress to) : base(from, to, JobTaskTypes.SECURE_DELIVERY, "Deliverying Secure Package") { }
public PackagePickUpTask(DefaultAddress pickupLocation) : base(JobTaskTypes.PACKAGE_PICKUP, "Picking up Package", pickupLocation) { this.Result = new AssetTaskResult(); }
public void Test_DefaultAddress_Creation_Without_AddressLine() { Assert.Throws<ArgumentException>(()=> { address = new DefaultAddress("", "Test AddressLine 2", "TestLocality", "Dhaka", "1217", "Bangladesh", new Point(new double[] { 1, 2 }.ToList())); }); }
public Asset ProposedRide { get; set; } //FIXME: It will definitely not be a hardburned Asset reference of course public FetchRideTask(DefaultAddress from, DefaultAddress to, Asset proposedRide = null) : base(JobTaskTypes.FETCH_RIDE, "Fetching Ride", from, to) { this.Result = new DefaultAssignAssetTaskResult(); ProposedRide = proposedRide; }