Exemplo n.º 1
0
 public ShellViewModel(DatabaseService databaseService)
 {
     ProgramDetailsRequest  = new InteractionRequest <INotification>();
     ReservationListRequest = new InteractionRequest <INotification>();
     SelectedDate           = new ReactiveProperty <string>();
     SelectedDate.Where(w => !string.IsNullOrWhiteSpace(w)).ObserveOn(TaskPoolScheduler.Default).Subscribe(w => UpdateChannels());
     SearchQuery     = new ReactiveProperty <string>();
     IsSearchMode    = new ReactiveProperty <bool>();
     RunQueryCommand = SearchQuery.Select(w => IsSearchMode.Value || !string.IsNullOrWhiteSpace(w)).ToReactiveCommand();
     RunQueryCommand.Subscribe(w =>
     {
         Application.Current.Dispatcher.Invoke(() => IsLoading = true);
         _searchTable.Query(SearchQuery.Value);
         GC.Collect();
         IsLoading          = false;
         IsSearchMode.Value = true;
     });
     ClearQueryCommand = IsSearchMode.ToReactiveCommand();
     ClearQueryCommand.Subscribe(w =>
     {
         SearchQuery.Value  = "";
         IsSearchMode.Value = false;
     });
     _disposables   = new List <IDisposable>();
     _dayTable      = new DayTable(databaseService);
     _searchTable   = new SearchTable(databaseService);
     AvailableDates = _dayTable.AvailableDates.ToReadOnlyReactiveCollection(w => w.ToString("d"));
     AvailableDates.ToObservable().Subscribe(w => SelectedDate.Value = AvailableDates.First());
     Channels = _dayTable.ChannelTable
                .ToReadOnlyReactiveCollection(w => new ChannelCellViewModel(w.Date, w.Channel, w.Slots).AddTo(_disposables));
     SearchSlots = _searchTable.ResultSlots
                   .ToReadOnlyReactiveCollection(w => new EpisodeCellViewModel(new WrapSlot(w, DateTime.MinValue)))
                   .AddTo(this);
 }
Exemplo n.º 2
0
 static Dagostino()
 {
     table = SearchTable <int, int, string> .Load(MathyContext.PathResolver.GetTablesFilePath("dagostino.txt")).Map(i =>
     {
         string[] sections = i.Split('~').Select(j => j.Trim()).ToArray();
         return(new Tuple <float, float>(float.Parse(sections[0]), float.Parse(sections[1])));
     });
 }
Exemplo n.º 3
0
    public void test()
    {
        SearchTable s = new SearchTable();
        Attribute   a = new Attribute();

        s.person_assignment(a, 2);

        Debug.Log(a.hp);
        Debug.Log(a.attack);
    }
Exemplo n.º 4
0
        protected async Task <IActionResult> SearchTable([FromBody] TReportsSearchTableRequest request)
        {
            Log.Information("***Executando método 'SearchTable'***");
            Log.Information(JsonConvert.SerializeObject(request));
            Log.Information(System.Environment.NewLine);
            Log.Information("-----Fim do método da leitura dos parâmetros -----" + System.Environment.NewLine);

            try
            {
                TReportsSearchTableResponse response = new TReportsSearchTableResponse();
                response.SearchTables = new System.Collections.Generic.List <SearchTable>();

                List <SearchTable> tables = new List <SearchTable>();

                SearchTable pais = new SearchTable();
                pais.TableSourceName        = "PAIS";
                pais.TableSourceDescription = "País";
                tables.Add(pais);

                SearchTable empresa = new SearchTable();
                empresa.TableSourceName        = "EMPRESA";
                empresa.TableSourceDescription = "Empresa";
                tables.Add(empresa);

                SearchTable filial = new SearchTable();
                filial.TableSourceName        = "FILIAL";
                filial.TableSourceDescription = "Filial";
                tables.Add(filial);

                response.SearchTables = tables.FindAll(x => x.TableSourceName.ToUpper().Contains(request.FindTable.ToUpper()));

                return(Ok(response));
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                Response.StatusCode = 500;
                return(Accepted(new TReportsCustomError()
                {
                    code = "500", detailedMessage = ex.StackTrace, message = ex.Message
                }));
            }
        }
Exemplo n.º 5
0
        public void SaveDomain(SearchTable domainTable, string currentUserName = "")
        {
            string          localUserName = getCurrentUserName(currentUserName);
            ApplicationUser user          = _AccountService.FirstOrDefault(x => x.UserName == localUserName);

            if (domainTable.Id == Guid.Empty)
            {
                domainTable.Id                        = Guid.NewGuid();
                domainTable.CreatedDate               = DateTime.UtcNow;
                domainTable.ModifiedDate              = domainTable.CreatedDate;
                domainTable.ApplicationUserCreatedId  = user.Id;
                domainTable.ApplicationUserModifiedId = user.Id;
                repo.Add(domainTable);
            }
            else
            {
                domainTable.ModifiedDate = DateTime.UtcNow;
                domainTable.ApplicationUserModifiedId = user.Id;
                repo.Update(domainTable);
            }
            _uow.Save();
        }
Exemplo n.º 6
0
        static F()
        {
            table1 = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("f1.txt"));

            table5 = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("f5.txt"));
        }
Exemplo n.º 7
0
        static Shapiro()
        {
            tableAlpha = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("shapiro-alpha.txt"));

            tableW = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("shapiro-w.txt"));
        }
Exemplo n.º 8
0
 static Grubbs()
 {
     table = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("grubbs.txt"));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获取指定字段的全部唯一值
 /// </summary>
 /// <param name="fieldItem"></param>
 /// <returns></returns>
 public object[] GetUnqiueValues(FieldItem fieldItem)
 {
     return(SearchTable.GetUniqueValues(fieldItem.Name).ToArray());
 }
Exemplo n.º 10
0
 static Dixon()
 {
     table = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("dixon.txt"));
 }
Exemplo n.º 11
0
 private void SearchGrapeSortsSugarAvgAverage_Click(object sender, EventArgs e)
 {
     SearchTable.DataSource = DbSearch.GetGrapeSortWithSugarOverAvr();
     SearchTable.Update();
     SearchTable.Refresh();
 }
Exemplo n.º 12
0
 private void SearchWinesOverAvgPrice_Click(object sender, EventArgs e)
 {
     SearchTable.DataSource = DbSearch.GetWineOverAvgPrice();
     SearchTable.Update();
     SearchTable.Refresh();
 }
Exemplo n.º 13
0
        static Cochran()
        {
            table1 = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("cochran1.txt"));

            table5 = SearchTable <int, int, float> .Load(MathyContext.PathResolver.GetTablesFilePath("cochran5.txt"));
        }