public ReportingCancellationTokenSource(string description = null)
     : base()
 {
     logger = LogService.GetLogger();
     status = StatusService.GetInstance();
     processDescription = description ?? string.Empty;
 }
Esempio n. 2
0
        private void bindApplyAndProcessInfo(Service.Order.Domain.Applyform.RefundOrScrapApplyform applyform)
        {
            this.lblAppliedTime.Text   = applyform.AppliedTime.ToString("yyyy-MM-dd HH:mm");
            this.lblAppliedReason.Text = applyform.ApplyRemark;
            if (applyform.ProcessedTime.HasValue)
            {
                this.lblProcessedTime.Text   = applyform.ProcessedTime.Value.ToString("yyyy-MM-dd HH:mm");
                this.lblProcessedResult.Text = StatusService.GetRefundApplyformStatus(applyform.Status, GetOrderRole(applyform.Order)) + " " + applyform.ProcessedFailedReason;
            }
            if (CurrentCompany.CompanyType == CompanyType.Provider && applyform.Status == DataTransferObject.Order.RefundApplyformStatus.Refunded)
            {
                var refundInfoHTML = new StringBuilder();
                refundInfoHTML.Append("<table><tr><th>航段</th><th>手续费率</th><th>手续费</th><th>退款金额</th></tr>");
                var index = 0;
                NormalRefundRoleBill bill = getUserRoleBill(applyform.RefundBill);
                var flightRefundFees      = applyform.OriginalFlights.Join(bill.Source.Details, f => f.ReservateFlight, f => f.Flight.Id, (f1, f2) => new { flight = f1, fee = f2 });
                foreach (var item in flightRefundFees)
                {
                    refundInfoHTML.Append("<tr>");
                    refundInfoHTML.AppendFormat("<td>{0} - {1}</td>", item.flight.Departure.City, item.flight.Arrival.City);
                    refundInfoHTML.AppendFormat("<td>{0}%</td>", (item.fee.RefundRate * 100).TrimInvaidZero());
                    refundInfoHTML.AppendFormat("<td>{0}</td>", Math.Abs(item.fee.RefundFee).TrimInvaidZero());
                    if (index == 0)
                    {
                        refundInfoHTML.AppendFormat("<td rowspan='{0}'>{1}</td>", flightRefundFees.Count(), bill.Source.Anticipation.TrimInvaidZero());
                    }
                    refundInfoHTML.Append("</tr>");
                    index++;
                }


                refundInfoHTML.Append("</table>");
                this.divRefundFeeInfo.InnerHtml = refundInfoHTML.ToString();
            }
        }
        public StatusServiceTests()
        {
            this.statusRepository      = Substitute.For <IStatusRepository>();
            this.statusStoreRepository = Substitute.For <IStatusStoreRepository>();

            this.statusService = new StatusService(this.statusRepository, this.statusStoreRepository);
        }
Esempio n. 4
0
        public Entity GetAvailableTalk(string tag)
        {
            Predicate <Entity> filterTag = e => e.Tag == tag;

            var age = StatusService.GetFixedValue("Age");
            Predicate <Entity> filterAge = e => e.MinimumAge <= age && age <= e.MaximumAge;

            var balance = StatusService.GetFixedValue("Gold");
            Predicate <Entity> filterGold = e => e.GoldChanges == null || balance + e.GoldChanges.First() >= 0;

            Func <Entity, int> extractOrder = e =>
            {
                if (e.DominantStatusKey == null)
                {
                    return(0);
                }
                return(StatusService.GetFixedValue(e.DominantStatusKey));
            };

            Func <Entity, int> tieBreaker = e => RandomService.Next(e.SerialId);

            var result = from e in GameConfiguration.Root.Entities
                         where filterTag(e) && filterAge(e) && filterGold(e)
                         orderby extractOrder(e) descending, tieBreaker(e) descending
            select e;

            return(result.FirstOrDefault());
        }
Esempio n. 5
0
        public static bool StatusMenu()
        {
            Console.WriteLine("<<Trading Company>>");
            Console.WriteLine("CRUD operation");
            Console.WriteLine("Status");
            Console.WriteLine("Select an operation: ");
            Console.WriteLine("<1>Read");
            Console.WriteLine("<2>Exit");
            Console.Write("\r\nSelect an option: ");
            StatusService roleService = new StatusService(mapper);

            switch (Console.ReadLine())
            {
            case "1":
                Console.Clear();
                Console.WriteLine("All Logs :");
                IEnumerable <StatusDTO> statuses = roleService.GetAllStatus();
                Extensions statusExtension       = new Extensions();
                foreach (var u in statuses)
                {
                    Console.WriteLine(statusExtension.ToString(u));
                }
                return(true);



            case "2":
                Console.Clear();
                return(false);
            }
            Console.Clear();
            return(false);
        }
        public ActionResult Index()
        {
            statusService          = new StatusService(context);
            userService            = new UserService(context);
            collectionPointService = new CollectionPointService(context);

            List <Status> list = new List <Status>();

            list.Add(statusService.FindStatusByStatusId(0));
            list.Add(statusService.FindStatusByStatusId(1));
            List <ApplicationUser> allUsersList        = userService.FindAllUsers();
            List <CollectionPoint> collectionPointList = collectionPointService.FindAllCollectionPoints();

            return(View(new DepartmentViewModel
            {
                Statuses = new SelectList(
                    list.Select(x => new { Value = x.StatusId, Text = x.Name }),
                    "Value",
                    "Text"
                    ),
                AllUsers = new SelectList(
                    allUsersList.Select(x => new { value = x.Email, text = x.FirstName + " " + x.LastName }),
                    "Value",
                    "Text"
                    ),
                CollectionPoints = new SelectList(
                    collectionPointList.Select(x => new { value = x.CollectionPointId, text = x.Name }),
                    "Value",
                    "Text"
                    )
            }));
        }
        public void itReturnsAnEmptyStateIfThereAreNoPunishments()
        {
            List <Punishment>       punishments = new List <Punishment>();
            List <TeamMemberStatus> status      = new StatusService(punishments).Exec();

            Assert.That(status, Is.Empty);
        }
Esempio n. 8
0
        public void Dispose()
        {
            var service = new StatusService(_statusRepositoryMock);

            service.Dispose();
            Assert.IsTrue(((StatusRepositoryMock)_statusRepositoryMock).Disposed);
        }
Esempio n. 9
0
        public MainWindowViewModel()
        {
            // Set unity container

            UnityContainer unityContainer = (UnityContainer)System.Windows.Application.Current.Resources["UContainer"];

            unityContainer.RegisterType <OptionsModel>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <RenameService>(new ContainerControlledLifetimeManager());

            // Instantiate objects now
            _option   = unityContainer.Resolve <OptionsModel>();
            _statServ = unityContainer.Resolve <StatusService>();
            _renServ  = unityContainer.Resolve <RenameService>();
            _renServ.SetOptions(_option); // only pass this as a copy not a reference;

            // Set actions for the view and just use lambda expression to return true regardless
            BrowseFolder = new DelegateCommand(BrowseExecute, () => true);
            RenameNow    = new DelegateCommand(RenExecute, () => true);

            // Call initialize(ON_INIT) for initialization just incase it was called from context menu
            // this call for everything status display, call to get folder etc.
            ProcessCode pc = ProcessCode.ON_INIT;

            InitializeAll(ref pc);



            _busy = false;
        }
        public async Task <ActionResult <List <CustomerResource_StatusDTO> > > SingleListStatus([FromBody] CustomerResource_StatusFilterDTO CustomerResource_StatusFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            StatusFilter StatusFilter = new StatusFilter();

            StatusFilter.Skip      = 0;
            StatusFilter.Take      = int.MaxValue;
            StatusFilter.Take      = 20;
            StatusFilter.OrderBy   = StatusOrder.Id;
            StatusFilter.OrderType = OrderType.ASC;
            StatusFilter.Selects   = StatusSelect.ALL;

            List <Status> Statuses = await StatusService.List(StatusFilter);

            List <CustomerResource_StatusDTO> CustomerResource_StatusDTOs = Statuses
                                                                            .Select(x => new CustomerResource_StatusDTO(x)).ToList();

            return(CustomerResource_StatusDTOs);
        }
Esempio n. 11
0
        private void SendNotify()
        {
            NotificationService.Notify("Notification Header",
                                       "That works fine, but what I am trying to do is dynamically change the colors. With your solution I am still using a static resource. Can I bind the R, G, B to anything?",
                                       NotificationIconType.Info);

            NotificationService.Notify(n =>
            {
                n.Title           = "Alert";
                n.Message         = "That works fine, but what I am trying to do is dynamically change the colors.";
                n.IconType        = NotificationIconType.Alert;
                n.IsKeepInCentral = true;
                n.CreatedDate     = DateTime.Today.AddDays(-2);
                n.For(NotifyClicked);
                n.GroupTitle = "A";
            });

            NotificationService.Notify(n =>
            {
                n.Title           = "Alert";
                n.Message         = "That works fine, but what I am trying to do is dynamically change the colors.";
                n.Icon            = "pack://application:,,,/WPF.Demo.Module;component/Resources/Icons/pin_blue.png";
                n.IsKeepInCentral = true;
                n.CreatedDate     = DateTime.Today.AddDays(-12);
                n.For(NotifyClicked);
                n.GroupTitle = "B";
            });

            StatusService.SetStatus("Hello From Demo", Colors.Yellow);
        }
Esempio n. 12
0
 public JoinedGuildEvent(DiscordShardedClient client, DatabaseService database, LogService log, StatusService status)
 {
     Client              = client;
     Database            = database;
     Log                 = log;
     Status              = status;
     Client.JoinedGuild += Client_JoinedGuild;
 }
Esempio n. 13
0
 private HeroService()
 {
     SkillService  = Skill.SkillService.GetInstance();
     ItemService   = Item.ItemService.GetInstance();
     ClassService  = Class.ClassService.GetInstance();
     LevelService  = LevelService.GetInstance();
     StatusService = StatusService.GetInstance();
 }
        public void UpdateCurrentStatus(string id, Status statusIn)
        {
            Status status = statusIn;

            StatusService _statusService = new StatusService(settings);

            _statusService.UpdateStatus(id, statusIn);
        }
Esempio n. 15
0
        public void GetRetrieval_ContainsResult()
        {
            // Arrange
            var statusService = new StatusService(context);

            var expectedId       = "RETCONTROLTEST";
            var expectedQuantity = 999999;

            new RetrievalRepository(context).Save(new Retrieval()
            {
                RetrievalId     = expectedId,
                CreatedDateTime = DateTime.Now,
                Status          = statusService.FindStatusByStatusId(12),
                Disbursements   = new List <Disbursement>()
                {
                    new Disbursement()
                    {
                        DisbursementId      = expectedId,
                        Department          = new DepartmentService(context).FindDepartmentByDepartmentCode("ENGL"),
                        CreatedDateTime     = DateTime.Now,
                        Status              = statusService.FindStatusByStatusId(7),
                        DisbursementDetails = new List <DisbursementDetail>()
                        {
                            new DisbursementDetail()
                            {
                                DisbursementId = expectedId,
                                Item           = new ItemService(context).FindItemByItemCode("E030"),
                                Bin            = "E78",
                                PlanQuantity   = 30,
                                ActualQuantity = expectedQuantity,
                                Status         = statusService.FindStatusByStatusId(17),
                                ItemCode       = "E030",
                            }
                        }
                    }
                }
            });

            var controller = new RetrievalAPIController()
            {
                Request       = new HttpRequestMessage(),
                Configuration = new HttpConfiguration(),
                Context       = context,
            };

            // Act
            IHttpActionResult actionResult = controller.GetRetrieval(new ConfirmRetrievalViewModel()
            {
                RetrievalId = expectedId,
            });

            var contentResult = actionResult as OkNegotiatedContentResult <IEnumerable <RetrievalDetailByDeptViewModel> >;

            // Assert
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.IsTrue(contentResult.Content.Select(x => x.ActualQuantity).Contains(expectedQuantity));
        }
Esempio n. 16
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Create your application here
            StatusBarUtil.SetColorStatusBars(this);
            ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this).WriteDebugLogs().Build();//³õʼ»¯Í¼Æ¬¼ÓÔØ¿ò¼Ü

            ImageLoader.Instance.Init(configuration);
            //ÏÔʾͼƬÅäÖÃ
            options = new DisplayImageOptions.Builder()
                      .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnFail(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnLoading(Resource.Drawable.icon_user)
                      .CacheInMemory(true)
                      .BitmapConfig(Bitmap.Config.Rgb565)
                      .CacheOnDisk(true)
                      // .Displayer(new DisplayerImageCircle(20))
                      .Build();
            SetToolBarNavBack();
            _swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorScheme(Resource.Color.primary);
            tv_dateAdded       = FindViewById <TextView>(Resource.Id.tv_dateAdded);
            tv_userDisplayName = FindViewById <TextView>(Resource.Id.tv_userDisplayName);
            iv_userIcon        = FindViewById <ImageView>(Resource.Id.iv_userIcon);
            tv_content         = FindViewById <TextView>(Resource.Id.tv_content);
            edit_content       = FindViewById <EditText>(Resource.Id.edit_content);
            btn_submit         = FindViewById <Button>(Resource.Id.btn_submit);
            btn_submit.Click  += AddCommentClick;
            statusId           = Intent.GetIntExtra("id", 0);
            GetClientStatus(statusId);
            shareWidget   = new UMengShareWidget(this);
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new LinearLayoutManager(this));


            _swipeRefreshLayout.Post(() => {
                _swipeRefreshLayout.Refreshing = true;
            });
            _swipeRefreshLayout.Refresh += async(s, e) =>
            {
                await StatusService.ListStatusComment(AccessTokenUtil.GetToken(this), statusId, callBackSuccess, callBackError);
            };
            edit_content.TextChanged += (s, e) =>
            {
                if (string.IsNullOrEmpty(edit_content.Text.Trim()))
                {
                    btn_submit.Enabled = false;
                }
                else
                {
                    btn_submit.Enabled = true;
                }
            };
            AlertUtil.ToastShort(this, "Ïß³ÌID" + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString());
            await StatusService.ListStatusComment(AccessTokenUtil.GetToken(this), statusId, callBackSuccess, callBackError);

            _recyclerView.AddItemDecoration(new RecyclerViewDecoration(this, (int)Orientation.Vertical));
        }
Esempio n. 17
0
 public static IQueryable <IStatus> GetStatusList()
 {
     return(StatusService.StatusFetchInfoList()
            .Cast <IStatus>()
            .Where(row => row.IsActive)
            .OrderBy(row => row.Ordinal)
            .ThenBy(row => row.Name)
            .AsQueryable());
 }
Esempio n. 18
0
        public static StatusService Get()
        {
            var timeProvider          = new TimeProvider();
            var statusDateTime        = new StatusDateTime(timeProvider);
            var randomMinuteGenerator = new RandomMinuteGenerator(timeProvider);
            var statusChangerService  = new StatusService(statusDateTime, randomMinuteGenerator);

            return(statusChangerService);
        }
Esempio n. 19
0
 public MetaDataService(StatusService statusService, ExifService exifService,
                        ConfigService config, ImageCache imageCache, WorkService workService)
 {
     _statusService = statusService;
     _configService = config;
     _exifService   = exifService;
     _imageCache    = imageCache;
     _workService   = workService;
 }
Esempio n. 20
0
 public PurchaseOrderController()
 {
     context = new ApplicationDbContext();
     purchaseOrderService = new PurchaseOrderService(context);
     statusService        = new StatusService(context);
     itemService          = new ItemService(context);
     itemPriceService     = new ItemPriceService(context);
     userService          = new UserService(context);
 }
 public BllStatus GetStatusClosed()
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         return(service.GetStatusClosed());
     }
 }
 public List <BllStatus> GetAllStatusesExceptDeletedAndClosed()
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         return(service.GetAllStatusesExceptDeletedAndClosed());
     }
 }
 public bool IsContainsWithName(string name)
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         return(service.IsContainsWithName(name));
     }
 }
 public BllStatus UpdateStatus(BllStatus entity)
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         return(service.Update(entity));
     }
 }
 public void DeleteStatus(int id)
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow     = new UnitOfWork(serviceDB);
         IStatusService service = new StatusService(uow);
         service.Delete(id);
     }
 }
        public async Task Should_return_a_message_containing_the_system_date_time()
        {
            var dummyLoggingService = A.Dummy <ILoggingService>();

            var statusService = new StatusService(dummyLoggingService);
            var status        = await statusService.GetStatusAsync();

            status.ShouldStartWith($"Status is 'Up' at");
        }
Esempio n. 27
0
    public FolderWatcherService(StatusService statusService,
                                ImageProcessService imageService)
    {
        _statusService       = statusService;
        _imageProcessService = imageService;

        // Start a thread which will periodically drain the queue
        _queueTask = Task.Run(FolderQueueProcessor);
    }
Esempio n. 28
0
        public void Init()
        {
            logger     = new Mock <ILogger <StatusService> >();
            unitOfWork = new Mock <IUnitOfWork>();
            repository = new Mock <IBaseRepository <Status> >();
            unitOfWork.Setup(x => x.GetRepository <Status>()).Returns(repository.Object);

            service = new StatusService(unitOfWork.Object, logger.Object);
        }
 public List <BllStatus> GetAllStatuses()
 {
     using (ServiceDB serviceDB = new ServiceDB())
     {
         IUnitOfWork    uow           = new UnitOfWork(serviceDB);
         IStatusService statusService = new StatusService(uow);
         return(statusService.GetAll().ToList());
     }
 }
Esempio n. 30
0
 private void BuildAllServices()
 {
     RandomService     = new RandomService(RootState.PlayState);
     StatusService     = new StatusService(RootState.PlayState);
     CalendarService   = new CalendarService(RootState.PlayState);
     AppearanceService = new AppearanceService(RootState.PlayState, StatusService);
     TalkService       = new TalkService(RootState.PlayState, StatusService, RandomService);
     ScheduleService   = new ScheduleService(RootState.PlayState, StatusService, RandomService);
 }