public ActionResult DEdit(int id) { DeliveryService objService = new DeliveryService(); DeliveryModel objModel = new DeliveryModel(); objModel = objService.getByID(id); QuotationService objService1 = new QuotationService(); List <DataCenterModel> ListDC = new List <DataCenterModel>(); ListDC = objService1.getDataCenter(); objModel.ListDC = new List <DataCenterModel>(); objModel.ListDC.AddRange(ListDC); QuotationService objCompUSerService = new QuotationService(); List <CompanyModel> objCompList = new List <CompanyModel>(); objCompList = objCompUSerService.getActiveComp(); objModel.ListComp = new List <CompanyModel>(); objModel.ListComp.AddRange(objCompList); List <UserModel> objUserList = new List <UserModel>(); objUserList = objCompUSerService.getActiveUser(); objModel.UserList = new List <UserModel>(); objModel.UserList.AddRange(objUserList); var comp = Dbcontext.UserMasters.Where(m => m.UID == objModel.CreatedBy).SingleOrDefault(); int?cid = comp.CompID; objModel.comp = cid; return(View(objModel)); }
public UserDetailPage(RegisterUserModel user) { this.user = user; userService = new UserService(); deliveryService = new DeliveryService(); InitializeComponent(); }
public RequestDelivery(ClientController clientCon, ClientState clientState) { InitializeComponent(); var state = new CurrentState(); var routeService = new RouteService(state); _pathFinder = new PathFinder(routeService); _clientState = clientState; _pathfindService = new DeliveryService(state, _pathFinder); _clientController = clientCon; foreach (var routeNode in clientState.GetAllRouteNodes()) { ComboBoxItem cbi = new ComboBoxItem(); if (routeNode is DistributionCentre) cbi.Content = ((DistributionCentre)routeNode).Name; else if (routeNode is InternationalPort) cbi.Content = routeNode.Country.Name; cbi.Tag = routeNode.ID; this.origin.Items.Add(cbi); ComboBoxItem cbi2 = new ComboBoxItem(); if (routeNode is DistributionCentre) cbi2.Content = ((DistributionCentre)routeNode).Name; else if (routeNode is InternationalPort) cbi2.Content = routeNode.Country.Name; cbi2.Tag = routeNode.ID; this.destination.Items.Add(cbi2); } _clientController.OptionsReceived += new ClientController.DeliveryOptionsDelegate(DeliveryOptions_Returned); _clientController.DeliveryOK+= new ClientController.DeliveryConfirmedDelegate(DeliveryConfirmed); }
public ToDoObj1(DeliveryService svc, MyValueFactoryCuae vf, int code, string msg) { this.svc = svc; this.vf = vf; this.code = code; this.message = msg; }
public async Task <IActionResult> Edit(int id, [Bind("DSID,Type,DeliveryRoute,PID")] DeliveryService deliveryService) { if (id != deliveryService.DSID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(deliveryService); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeliveryServiceExists(deliveryService.DSID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PID"] = new SelectList(_context.Parcels, "PID", "PID", deliveryService.PID); return(View(deliveryService)); }
public BaseController() { inventoryService = new InventoryService() { CurrentEmployee = GetCurrentEmployee() }; deliveryService = new DeliveryService() { CurrentEmployee = GetCurrentEmployee() }; storeService = new StoreService() { CurrentEmployee = GetCurrentEmployee() }; employeeService = new EmployeeService() { CurrentEmployee = GetCurrentEmployee() }; mapRuleService = new MapRuleService() { CurrentEmployee = GetCurrentEmployee() }; carrierService = new CarrierService() { CurrentEmployee = GetCurrentEmployee() }; fileDataService = new FileDataService() { CurrentEmployee = GetCurrentEmployee() }; epacketService = new EpacketService() { CurrentEmployee = GetCurrentEmployee() }; }
public void Can_deliver_single_batch_of_messages_with_overrun_in_backlog() { const int count = 10000; var config = new DeliveryConfiguration { BacklogFolder = "backlog", MaxDegreeOfParallelism = 1 }; CreateOrCleanDirectory(config.BacklogFolder); var harness = new InMemoryEmailService(); var service = new DeliveryService(harness, config); var messages = MessageFactory.EmailWithHtmlAndText(count); service.Start(); service.Send(messages); Thread.Sleep(10); service.Stop(DeliveryCancellationHandling.SendToBacklog); var backlogged = Directory.GetFiles(config.BacklogFolder).Length; var delivered = harness.Messages.Count; Assert.AreEqual(count, backlogged + delivered); Trace.WriteLine(string.Format("Backlogged: {0}", backlogged)); Trace.WriteLine(string.Format("Delivered: {0}", delivered)); CleanDirectory(config.BacklogFolder); }
static void Main(string[] args) { IEmailProvider ep = new SmtpEmailProvider("smtp.qq.com", 25, new NetworkCredential("570678569", "q284655")); IEmailTemplateEngine tn = new DotLiquidEmailTemplateEngine(); IDeliveryConfiguration dc = new DeliveryConfiguration(); DeliveryService service = new DeliveryService(ep, dc); var tos = new List <string>() { "*****@*****.**", "*****@*****.**" }; var message = tn.CreateTextEmail("用户{{ UserName }}兑换了 aa,请及时处理!", new { UserName = "******", From = "*****@*****.**", To = "*****@*****.**", Subject = "邮件主题" }); message.Cc = tos; ep.Send(message); service.Start(); service.Send(message); Console.WriteLine("success "); Console.Read(); service.Stop(); }
public void Init(IClient client, DatabaseContext database, PacketService packets, DeliveryService delivery) { Client = client; Database = database; Packets = packets; Delivery = delivery; }
public void Add() { if (IsEdit == true) { toEdit.DeliveredItem = DeliveredItem; toEdit.ItemQuantity = ItemQuantity; toEdit.RecipientCompany = RecipientCompany; toEdit.CityTown = CityTown; toEdit.PostalCode = string.Format("{0}-{1}", PostalCode1, PostalCode2); toEdit.StreetAddress = StreetAddress; toEdit.Weight = Weight; toEdit.Description = Description; DeliveryService.Edit(toEdit); } else { var newDelivery = new DeliveryDTO(); newDelivery.DeliveredItem = DeliveredItem; newDelivery.ItemQuantity = ItemQuantity; newDelivery.RecipientCompany = RecipientCompany; newDelivery.CityTown = CityTown; newDelivery.PostalCode = string.Format("{0}-{1}", PostalCode1, PostalCode2); newDelivery.StreetAddress = StreetAddress; newDelivery.Weight = Weight; newDelivery.Description = Description; DeliveryService.Add(newDelivery); } TryClose(); }
public void MinimuDistanceReturnsCorrectValue6() { // arrange const int numberOfColumns = 10; const int numberOfRows = 10; var area = new[, ] { { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 9 }, }; const int expected = 18; var service = new DeliveryService(); // act var actual = service.MinimumDistance(numberOfColumns, numberOfRows, area); // assert Check.That(actual).Equals(expected); }
public Main() { _productService = new ProductService(); _jobService = new JobService(); _deliveryService = new DeliveryService(); bsProduct = new BindingSource(); InitializeComponent(); comboBox1.DataSource = _jobService.RecentJobs(); comboBox1.DisplayMember = "JobName"; comboBox1.ValueMember = "JobID"; delCtl = new UserControls.DeliveriesListControl(); spcMainVertical.Panel1.Controls.Add(delCtl); delCtl.Dock = DockStyle.Fill; comboBox1.SelectedIndexChanged += ComboBox1_SelectedIndexChanged; dgProductGrid.CellContentClick += DgProductGrid_CellContentClick; dgProductGrid.CellValueChanged += DgProductGrid_CellValueChanged; dgProductGrid.CellClick += DgProductGrid_CellClick; dgProductGrid.SelectionChanged += DgProductGrid_SelectionChanged; dgDeliverItems.CellContentClick += DgDeliverItems_CellContentClick; BuildProductGrid(); BuildSubAssemblyGrid(); dgProductGrid.DataSource = bsProduct; }
public async Task PrepareTest() { serviceProvider = FakeServiceProvider.Create($"{nameof(DeliveryServiceTests)}_{TestContext.TestName}"); scope = serviceProvider.CreateScope(); connections = scope.ServiceProvider.GetRequiredService <ConnectionsService>(); packets = scope.ServiceProvider.GetRequiredService <PacketService>(); database = scope.ServiceProvider.GetRequiredService <DatabaseContext>(); delivery = scope.ServiceProvider.GetRequiredService <DeliveryService>(); database.Accounts.Add(new Account { AccountId = alice }); database.MailConfirmations.Add(new MailConfirmation { AccountId = alice, MailAddress = "*****@*****.**", Token = SkynetRandom.String(10) }); database.Accounts.Add(new Account { AccountId = bob }); database.MailConfirmations.Add(new MailConfirmation { AccountId = bob, MailAddress = "*****@*****.**", Token = SkynetRandom.String(10) }); database.Accounts.Add(new Account { AccountId = charlie }); database.MailConfirmations.Add(new MailConfirmation { AccountId = charlie, MailAddress = "*****@*****.**", Token = SkynetRandom.String(10) }); await database.SaveChangesAsync().ConfigureAwait(false); }
public override bool Arrange() { Service = new DeliveryService(TestConstants.Configuration); Input = new DeliveryCancelInput(Guid.Empty); return(true); }
public void Can_cap_delivery_rate() { const int count = 2000; const int rate = 1000; var config = new DeliveryConfiguration { BacklogFolder = "backlog", MaxDegreeOfParallelism = 10, MaxDeliveryRate = rate }; var inMemory = new InMemoryEmailService(); var service = new DeliveryService(inMemory, config); var messages = MessageFactory.EmailWithHtmlAndText(count); service.Start(); service.Send(messages); service.Stop(DeliveryCancellationHandling.EmptyQueue); Assert.AreEqual(count, service.Delivered); Assert.AreEqual(service.Delivered, inMemory.Messages.Count); Assert.IsTrue(service.DeliveryRate <= rate); Trace.WriteLine("Delivered: " + service.Delivered); Trace.WriteLine("Uptime: " + service.Uptime); Trace.WriteLine("Delivery rate: " + service.DeliveryRate + " msgs / second"); }
public DefaultCouriersPage() { InitializeComponent(); MasterPage.ListView.ItemSelected += ListView_ItemSelected; NavigationPage.SetHasBackButton(this, false); locationService = new LocationService(); LocationUpdateTimer = new Timer(); LocationUpdateTimer.Interval = 25000; // Hook up the Elapsed event for the timer. LocationUpdateTimer.Elapsed += OnTimedEvent; // Have the timer fire repeated events (true is the default) LocationUpdateTimer.AutoReset = false; // Start the timer LocationUpdateTimer.Enabled = true; deliveryService = new DeliveryService(); userService = new UserService(); if (Device.RuntimePlatform == Device.Android) { notificationManager = DependencyService.Get <INotificationManager>(); notificationManager.NotificationReceived += (sender, eventArgs) => { var evtData = (NotificationEventArgs)eventArgs; ShowNotification(evtData.Title, evtData.Message); }; } }
public void Can_start_and_seed_with_backlog() { const int backlog = 500; var config = new DeliveryConfiguration { BacklogFolder = "backlog", MaxDegreeOfParallelism = 1 }; CreateOrCleanDirectory(config.BacklogFolder); var harness = new InMemoryEmailService(); var service = new DeliveryService(harness, config); var messages = MessageFactory.EmailWithHtmlAndText(backlog); foreach (var message in messages) { service.Backlog(message); } service.Start(); service.Stop(DeliveryCancellationHandling.EmptyQueue); Assert.AreEqual(backlog, harness.Messages.Count); CleanDirectory(config.BacklogFolder); }
private void saveDeliveryInfoAndStatus() { try { OrderStatus orderStatus = new OrderStatusBL().GetByID(int.Parse(cmbStatus.SelectedValue)); if (!orderStatus.SendDeliveryInfo) { cmbDeliveryService.SelectedIndex = -1; txtTrackCode.Text = string.Empty; } if (orderStatus.SendDeliveryInfo && cmbDeliveryService.SelectedIndex < 1) { setStatus("Odaberite kurirsku službu", "warning"); return; } DeliveryService deliveryService = cmbDeliveryService.Visible && cmbDeliveryService.SelectedIndex > -1 ? new DeliveryServiceBL().GetByID(int.Parse(cmbDeliveryService.SelectedValue)) : null; new OrderBL().UpdateOrderStatus(int.Parse(lblOrderID.Value), orderStatus, lblEmail.Text, lblCode.Text, lblFirstname.Text + " " + lblLastname.Text, lblDate.Text, deliveryService, txtTrackCode.Text); setStatus("Narudžbina uspešno sačuvana.", "success"); } catch (BLException ex) { setStatus(ex.Message, "danger"); } catch (Exception exx) { setStatus(exx.Message, "danger"); } }
public IActionResult DeliveryIndex(int?page, int?size) { int total = 0; var list = DeliveryService.LoadPageEntities <uint>(page ?? 1, size ?? 15, ref total, l => true, x => x.sort, true).Mapper <IEnumerable <DeliveryDto> >(); return(View(new DeliveryListViewModel(list, total))); }
public CreateModel(DeliveryItemTypeService deliveryItemTypeService, CarService carService, UserService userService, DeliveryService deliveryService) { _deliveryItemTypeService = deliveryItemTypeService; _carService = carService; _userService = userService; _deliveryService = deliveryService; }
public async Task <bool> VerifyAccess(APEntity entity, string userId) { if (entity.Type == "_blocks" && !entity.Data["attributedTo"].Any(a => a.Id == userId)) { return(false); } if (entity.Type == "_blocked") { return(false); } if (entity.Type == "https://www.w3.org/ns/activitystreams#OrderedCollection" || entity.Type == "https://www.w3.org/ns/activitystreams#Collection" || entity.Type.StartsWith("_")) { return(true); } if (EntityData.IsActor(entity.Data)) { return(true); } var audience = DeliveryService.GetAudienceIds(entity.Data); return( entity.Data["attributedTo"].Concat(entity.Data["actor"]).Any(a => a.Id == userId) || audience.Contains("https://www.w3.org/ns/activitystreams#Public") || (userId != null && audience.Contains(userId)) ); }
private void DeleteMessage() { if (SelectedDeliveryLineMessage == null) { MessageBox.Show("Select Message To Delete"); return; } if (MessageBox.Show("Are you Sure You want to Delete this Message?", "Delete Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) == MessageBoxResult.Yes) { try { //SelectedDeliveryLineMessage.Enabled = false; var stat = new DeliveryService(true).DisableMessageChild(SelectedDeliveryLineMessage); if (!string.IsNullOrEmpty(stat)) { MessageBox.Show(stat); } GetMessages(); } catch (Exception exception) { MessageBox.Show("Can't Delete, may be the data is already in use..." + Environment.NewLine + exception.Message + Environment.NewLine + exception.InnerException, "Can't Delete", MessageBoxButton.OK, MessageBoxImage.Error); } } }
public void CreateDeliveriesFromPendingItems_ValidPendingDeliveryItems_DeliveriesCreated() { var dispatcher = MockRepository.GenerateMock <IQueueDispatcher <IMessage> >(); var userRepository = new UserAccountRepository(); var user = userRepository.GetByEmail("*****@*****.**", false); var userContext = new TestUserContext(user); var quoteRepository = new QuoteRepository(); var quoteItemRepository = new QuoteItemRepository(); var customerRepository = new CustomerRepository(); var jobRepository = new JobRepository(); var jobItemRepository = new JobItemRepository(); var listItemRepository = new ListItemRepository(); var entityIdProvider = new DirectEntityIdProvider(); var instrumentRepository = new InstrumentRepository(); var deliveryRepository = new DeliveryRepository(); var deliveryItemRepository = new DeliveryItemRepository(); var customerId1 = Guid.NewGuid(); var customerId2 = Guid.NewGuid(); var job1Id = Guid.NewGuid(); var job2Id = Guid.NewGuid(); var job3Id = Guid.NewGuid(); var jobItem1Id = Guid.NewGuid(); var jobItem2Id = Guid.NewGuid(); var jobItem3Id = Guid.NewGuid(); var jobItem4Id = Guid.NewGuid(); var jobItem5Id = Guid.NewGuid(); var jobItem6Id = Guid.NewGuid(); var jobItem7Id = Guid.NewGuid(); var jobItem8Id = Guid.NewGuid(); var jobItem9Id = Guid.NewGuid(); CreateDeliveriesFromPendingItemsHelper.CreateContextForPendingItemTests( customerId1, customerId2, job1Id, job2Id, job3Id, jobItem1Id, jobItem2Id, jobItem3Id, jobItem4Id, jobItem5Id, jobItem6Id, jobItem7Id, jobItem8Id, jobItem9Id); var deliveryItemService = new DeliveryItemService( userContext, deliveryRepository, deliveryItemRepository, jobItemRepository, quoteItemRepository, listItemRepository, customerRepository, dispatcher); var deliveryService = new DeliveryService(userContext, deliveryRepository, deliveryItemService, customerRepository, entityIdProvider, dispatcher); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem1Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem2Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem3Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem4Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem5Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem6Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem7Id, customerId1, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem8Id, customerId2, "some notes"); deliveryItemService.CreatePending(Guid.NewGuid(), jobItem9Id, customerId2, "some notes"); deliveryService.CreateDeliveriesFromPendingItems(); var deliveries = deliveryService.GetDeliveries().ToList(); Assert.AreEqual(2, deliveries.Count); var deliveryItems = deliveryItemService.GetDeliveryItems(deliveries[0].Id).ToList(); Assert.AreEqual(7, deliveryItems.Count); }
/// <summary>Constructs the StubBase.</summary> /// <param name="src">the message source</param> /// <param name="obj">the target of decoded messages</param> /// <param name="queued">thread pool used to run AsyncReceiverMode.QUEUED methods.</param> /// <param name="free">thread pool used to run AsyncReceiverMode.FREE methods.</param> public StubBase(DeliveryService src, object obj, Pool queued, Pool free) { _src = src; _obj = obj; _queued = queued; _free = free; src.SetSession(this); }
public ActiveCourierListPage() { deliveryService = new DeliveryService(); userService = new UserService(); _connection = DependencyService.Get <ISQLiteDb>().GetConnection(); InitializeComponent(); }
public DeliveriesListPage() { decending = true; userService = new UserService(); deliveryService = new DeliveryService(); // _connection = DependencyService.Get<ISQLiteDb>().GetConnection(); InitializeComponent(); }
public DeliveryServiceTests() { _deliveryRepository = new Mock <IDeliveryRepository>(); _courierRepository = new Mock <ICourierRepository>(); _integrationEventPublisher = new Mock <IIntegrationEventPublisher>(); _mapper = new Mock <IMapper>(); _service = new DeliveryService(_deliveryRepository.Object, _courierRepository.Object, _mapper.Object, _integrationEventPublisher.Object); }
public DeliverToActivityPubTask(EventQueueItem item, IEntityStore entityStore, EntityFlattener entityFlattener, IServiceProvider serviceProvider, DeliveryService deliveryService, SignatureVerifier verifier, KeyService keyService) : base(item) { _entityStore = entityStore; _entityFlattener = entityFlattener; _serviceProvider = serviceProvider; _deliveryService = deliveryService; _verifier = verifier; _keyService = keyService; }
public DeliverToActivityPubTask(EventQueueItem item, IEntityStore entityStore, EntityFlattener entityFlattener, IServiceProvider serviceProvider, DeliveryService deliveryService, APContext context, EntityData data) : base(item) { _entityStore = entityStore; _entityFlattener = entityFlattener; _serviceProvider = serviceProvider; _deliveryService = deliveryService; _context = context; _data = data; }
public void Edit_InvalidDeliveryId_ArgumentException() { var fao = "g. robertson"; var deliveryRepositoryStub = MockRepository.GenerateMock <IDeliveryRepository>(); deliveryRepositoryStub.Stub(x => x.GetById(_deliveryToEditId)).Return(null); _deliveryService = DeliveryServiceFactory.Create(_userContext, deliveryRepositoryStub, MockRepository.GenerateStub <ICustomerRepository>()); EditDelivery(_deliveryToEditId, fao); }
// // GET: /APIDelivery/ public IEnumerable <DeliveryModel> Get(int id) { DeliveryModel objModel = new DeliveryModel(); DeliveryService objService = new DeliveryService(); List <DeliveryModel> lstuser = new List <DeliveryModel>(); lstuser = objService.getDeliveryReq(id); return(lstuser); }
public Controller(CountryService countryService, CompanyService companyService, DeliveryService deliveryService, PriceService priceService, RouteService routeService, LocationService locationService, StatisticsService statisticsService, EventService eventService) { this.countryService = countryService; this.companyService = companyService; this.deliveryService = deliveryService; this.priceService = priceService; this.routeService = routeService; this.locationService = locationService; this.statisticsService = statisticsService; this.eventService = eventService; Network.Instance.MessageReceived += new Network.MessageReceivedDelegate(OnReceived); }
private void MainForm_Load(object sender, EventArgs e) { // initialise logger Logger.Instance.SetOutput(logBox); Logger.WriteLine("Server starting.."); // initialise database Database.Instance.Connect(); // initialise the state object currentState = new CurrentState(); // initialise all the services (they set up the state themselves) and pathfinder countryService = new CountryService(currentState); companyService = new CompanyService(currentState); routeService = new RouteService(currentState); var pathFinder = new PathFinder(routeService); // pathfinder needs the RouteService and state deliveryService = new DeliveryService(currentState, pathFinder); // DeliveryService needs the PathFinder priceService = new PriceService(currentState); locationService = new LocationService(currentState); eventService = new EventService(currentState); statisticsService = new StatisticsService(); // initialise network Network.Network network = Network.Network.Instance; network.Start(); network.Open(); // create controller var controller = new Controller(countryService, companyService, deliveryService, priceService, routeService, locationService, statisticsService, eventService); //BenDBTests(countryService, routeService); //SetUpDatabaseWithData(); /*try { var priceDH = new PriceDataHelper(); var standardPrice = new DomesticPrice(Priority.Standard) { PricePerGram = 3, PricePerCm3 = 5 }; //standardPrice = priceService.CreateDomesticPrice(standardPrice.Priority, standardPrice.PricePerGram, standardPrice.PricePerCm3); standardPrice.PricePerCm3 = 8; //standardPrice = priceService.UpdateDomesticPrice(standardPrice.ID, standardPrice.Priority, standardPrice.PricePerGram, standardPrice.PricePerCm3); var loadedPrice = priceService.GetDomesticPrice(1); var prices = priceService.GetAllDomesticPrices(); var normalPrices = priceService.GetAll(); } catch (DatabaseException er) { Logger.WriteLine(er.Message); Logger.Write(er.StackTrace); }*/ }