public void AbortOrder(int OrderID) { if (orderManager == null) { throw new Exception("Trying to abort non-existent order"); } orderManager.AbortOrder(); orderManager = null; }
public int CreateOrder(string Name, string Phone, string StartAddress, string StartGeographicalLatitude, string StartGeographicalLongitude, string FinishAddress, string FinishGeographicalLatitude, string FinishGeographicalLongitude, List <string> Extra) { string name = OrderCreationCtrl.ValidateName(Name); string phone = OrderCreationCtrl.ValidatePhoneNumber(Phone); List <string> options = OrderCreationCtrl.ValidateExtraOptions(Extra); if (name == OrderCreationCtrl.INVALID_NAME || phone == OrderCreationCtrl.INVALID_PHONE || options == OrderCreationCtrl.INVALID_OPTIONS) { return(-1); } int serviceID = OrderCreationCtrl.CreateOrder(name, phone, StartGeographicalLongitude, StartGeographicalLatitude, FinishGeographicalLongitude, FinishGeographicalLatitude, StartAddress, FinishAddress, options); orderManager = new OrderManagerCtrl(serviceID); return(serviceID); }