public MainWindow() { MainModelView modelo = new MainModelView(); this.DataContext = modelo; InitializeComponent(); }
public async Task <IActionResult> GetFilterdedMainData(string[] filters) { List <MainTable> infos = new List <MainTable>(); List <string> _check = new List <string>(); for (int i = 0; i < filters.Length; i++) { var r = await appDbContext.MainTable.Where(k => k.RequestType.Contains(filters[i])).ToListAsync(); infos.AddRange(r); _check.Add(filters[i]); } if (filters.Length == 0) { infos = await appDbContext.MainTable.ToListAsync(); } MainModelView mainModelView = new MainModelView() { CheckedItems = _check, Filters = await appDbContext.MainTable.Select(i => i._IPinfo.CompanyName).Distinct().ToListAsync(), MainTables = infos }; string tmp = JsonConvert.SerializeObject(mainModelView, Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); TempData["FilteredMainData"] = tmp; return(RedirectToAction("MainTable", "Home")); }
public MainWindow() { InitializeComponent(); MainMV = new MainModelView(this); DataContext = MainMV; }
public MainWindow() { InitializeComponent(); MainModelView modelo = new MainModelView(); this.DataContext = modelo; /* new DepartmentView().Show();//Para que compile en modo gráfico*/ }
public MainWindow() { InitializeComponent(); Title += $" ({System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()})"; ModelView = new MainModelView(this); DataContext = ModelView; }
public MainWindow(MainModelView mainVM) { MainVM = mainVM; InitializeComponent(); Title = $"To-Done ({Assembly.GetExecutingAssembly().GetName().Version})"; DataContext = MainVM; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); MainWindow app = new MainWindow(); MainModelView context = new MainModelView(app); app.DataContext = context; app.Show(); }
public MainWindow() { InitializeComponent(); DataContext = new MainModelView(); if (Dispatcher != null) { var timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate { TimeTb.Text = DateTime.Now.ToString(Format); }, Dispatcher); } }
public async Task <IActionResult> SearchInMain(MainModelView mainModelView) { if (mainModelView.Search != null) { long id; if (long.TryParse(mainModelView.Search, out id)) { var q = await appDbContext.MainTable.Where(i => i.Id == id).ToListAsync(); var f = await appDbContext.MainTable.ToListAsync(); var filt = f.Select(i => i._IPinfo.CompanyName).Distinct().ToList(); MainModelView mainModelView1 = new MainModelView() { MainTables = q }; TempData["MainData"] = JsonConvert.SerializeObject(mainModelView1); return(RedirectToAction("MainTable", "Home")); } else if (mainModelView.Search.Length != 0) { //var tmp = await appDbContext.MainTable.Where(i => i.FilesInfo.Path.Contains(mainModelView.Search)).ToListAsync(); var cmp = await appDbContext.MainTable.Where(i => i._IPinfo.CompanyName.Contains(mainModelView.Search)).ToListAsync(); //tmp.AddRange(cmp); // var f = await appDbContext.MainTable.ToListAsync(); // var filt = f.Select(i => i._IPinfo.CompanyName).Distinct().ToList(); MainModelView mainModelView11 = new MainModelView() { MainTables = cmp, }; string str = JsonConvert.SerializeObject(cmp); byte[] arr = Encoding.ASCII.GetBytes(str); var tq = StringCompressor.CompressString(str); // string h = "hello"; TempData["MainData"] = tq; //return RedirectToAction("MainTable", "Home"); } } return(RedirectToAction("MainTable", "Home")); }
public SaveCarCommand(MainModelView MainModelView) { this.mainModelView = MainModelView; }
/********/ public void SetMainWindowViewModel(MainModelView mainWindowViewModel) { cMain = mainWindowViewModel; }
public MainView() { InitializeComponent(); this.mainModelView = new MainModelView(this.FormGenerator, this); this.DataContext = this.mainModelView; }
public async Task <IActionResult> MainTable(MainModelView mainModelView, string[] filters) { _logger.LogInformation($"{DateTime.Now.ToString()} MainTable method HomeController class"); if (mainModelView.Search != null) { long id; //try get long value from search string if (long.TryParse(mainModelView.Search, out id)) { var q = await appDbContext.MainTable.Where(i => i.Id == id).ToListAsync(); var f = await appDbContext.MainTable.ToListAsync(); var filt = f.Select(i => i._IPinfo.CompanyName).Distinct().ToList(); MainModelView mainModelView1 = new MainModelView() { MainTables = q, Filters = filt }; return(View(mainModelView1)); } //else do search in path and company names else if (mainModelView.Search.Length != 0) { var tmp = await appDbContext.MainTable.Where(i => i.FilesInfo.Path.Contains(mainModelView.Search)).ToListAsync(); var cmp = await appDbContext.MainTable.Where(i => i._IPinfo.CompanyName.Contains(mainModelView.Search)).ToListAsync(); tmp.AddRange(cmp); var f = await appDbContext.MainTable.ToListAsync(); var filt = f.Select(i => i._IPinfo.CompanyName).Distinct().ToList(); MainModelView mainModelView11 = new MainModelView() { MainTables = tmp, Filters = filt }; return(View(mainModelView11)); } } if (filters != null) { List <MainTable> infos = new List <MainTable>(); List <string> _check = new List <string>(); for (int i = 0; i < filters.Length; i++) { string tmp = filters[i].Remove(filters[i].Length - 2, 2); var r = await appDbContext.MainTable.Where(k => k._IPinfo.CompanyName.Contains(tmp)).ToListAsync(); infos.AddRange(r); _check.Add(filters[i]); } foreach (var i in appDbContext.IpInfo.ToList()) { this._logger.LogInformation($"{i.CompanyName} \n"); } if (filters.Length == 0) { infos = await appDbContext.MainTable.ToListAsync(); } MainModelView mainModelView123 = new MainModelView() { CheckedItems = _check, Filters = await appDbContext.MainTable.Select(i => i._IPinfo.CompanyName).Distinct().ToListAsync(), // Filters = await appDbContext.MainTable.Select(i => //i.RequestType).Distinct().ToListAsync(), MainTables = infos }; return(View(mainModelView123)); } var _m = await appDbContext.MainTable.ToListAsync(); var fty = _m.Select(i => i._IPinfo.CompanyName).Distinct().ToList(); MainModelView mainModelView145 = new MainModelView() { MainTables = _m, Filters = fty }; return(View(mainModelView145)); }
protected override void OnNavigatedTo(NavigationEventArgs e) { MainModelView mainModelView = e.Parameter as MainModelView; DataContext = mainModelView; }
public MainWindow() { InitializeComponent(); ModelView = new MainModelView(); }