Exemplo n.º 1
0
        public ActionResult Upload()
        {
            var model = new LogFileViewModel
            {
                Scanners = _scannerService.GetAll().ToDictionary(a => a.Id, a => a.Name)
            };

            return(PartialView("_Upload", model));
        }
Exemplo n.º 2
0
        public ActionResult Upload(LogFileViewModel model)
        {
            if (ModelState.IsValid && model.LogFile.ContentLength > 0)
            {
                var path = Path.Combine(MainSettings.UploadFolder, string.Format("data-{0:yyyy-MM-dd_hh-mm-ss-tt}.log", DateTime.Now));

                //backup file
                model.LogFile.SaveAs(path);

                //import file
                _scannerService.Import(model.ScannerId, path);
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public LogFileUpdateCommand(LogFileViewModel viewModel)
 {
     _viewModel = viewModel;
 }
Exemplo n.º 4
0
        public int SaveLogFile(LogFileViewModel model)
        {
            var service = new LogsService();

            return(service.SaveLogFile(model.Filename, model.FileContent));
        }
Exemplo n.º 5
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new LogFileViewModel();
 }
Exemplo n.º 6
0
 public LogFileView()
 {
     this.InitializeComponent();
     this.DataContext = this.ViewModel = new(this);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Menus the click.
        /// </summary>
        /// <param name="arg">The argument.</param>
        private void MenuClick(object arg)
        {
            StatusMessage = Utilities.GetResourceValue("Loading");
            switch ((string)arg)
            {
            case "Dashboard":
                Element = new StartupViewModel(this);
                break;

            case "EcommerceDashboard":
                Element = new Dashboard.Ecommerce.EcommerceViewModel();
                break;

            case "EcommerceDashboard1":
                Element = new Dashboard.Ecommerce.EcommerceViewModel(1);
                break;

            case "ErpDashBoard":
                Element = new Dashboard.Erp.ErpViewModel();
                break;

            case "ErpDashBoard1":
                Element = new Dashboard.Erp.ErpViewModel(1);
                break;

            case "SchedulerControl":
                Element = new Schedulers.SchedulersViewModel();
                break;

            case "Logfiles":
                Element = new LogFileViewModel();
                break;

            case "ConfigurationSettings":
                Element = new Configuration.ConfigurationSettingsViewModel(this);
                break;

            case "NotificationSettings":
                Element = new Configuration.NotificationViewModel();
                break;

            case "ShipmentSettings":
                Element = new Configuration.ShipmentSettingsViewModel();
                break;

            case "CarrierSettings":
                Element = new Configuration.ShippingCarrierViewModel();
                break;

            case "PaymentSettings":
                Element = new Configuration.PaymentSettingsViewModel();
                break;

            case "DocumentTypes":
                Element = new Configuration.DocumentTypesViewModel();
                break;

            case "NotificationReports":
                Element = new Reports.ReportViewModel();
                break;

            case "ExclusionReports":
                Element = new Reports.ReportViewModel(1);
                break;

            case "AdminConfig":
                Element = new Admin.ConfigurationViewModel();
                break;

            case "CategoryMaster":
                Element = new Admin.CategoryMasterViewModel();
                break;

            case "CategoryMapping":
                Element = new Admin.CategoryMappingViewModel();
                break;

            case "Diagnostics":
                Element = new Admin.DiagnosticsViewModel();
                break;

            case "Blank":
                Element = new BlankViewModel();
                break;
            }
            StatusMessage = Utilities.GetResourceValue("DefaultStatus");
        }