示例#1
0
 public frmFiles(FileKeeper fls, Form parent)
 {
     InitializeComponent();
     this.Owner    = parent;
     this.Location = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     files         = fls;
 }
示例#2
0
 public frmProcess(Form parent)
 {
     InitializeComponent();
     this.Owner         = parent;
     this.Location      = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     mode               = 1;
     lblCreated.Visible = false;
     this.Text          = "Nowe zgłoszenie";
     _this              = new Process();
     DatesChange();
     cmbStatus.Enabled           = false;
     cmbStartedBy.Enabled        = false;
     cmbFinishedBy.Enabled       = false;
     txtFinishedOn.Enabled       = false;
     txtStartedOn.Enabled        = false;
     lblMesId.Visible            = false;
     txtMesId.Visible            = false;
     lblDescription.Text         = "Opis";
     txtDescription.Text         = _this.Description;
     txtRepairActions.Visible    = false;
     txtInitialDiagnosis.Visible = false;
     lblRepairActions.Visible    = false;
     lblInitialDiagnosis.Visible = false;
     assignedUsersHandler        = new AssignedUsersHandler(this);
     files = new FileKeeper(this);
 }
示例#3
0
 public frmPlace(Place Place, Form parent)
 {
     InitializeComponent();
     this.Owner              = parent;
     this.Location           = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     mode                    = 2;
     this.Text               = "Szczegóły zasobu";
     _this                   = Place;
     files                   = new FileKeeper(this, null, Place.PlaceId);
     txtNumber1.Text         = _this.Number1;
     txtNumber2.Text         = _this.Number2;
     txtDescription.Text     = _this.Description;
     txtName.Text            = _this.Name;
     txtPriority.Text        = _this.Priority;
     cboxArchived.CheckState = _this.IsArchived.ToCheckboxState();
     if (_this.CreatedOn != null && _this.CreatedBy != 0)
     {
         lblCreated.Text    = "Utworzone w dniu " + _this.CreatedOn + " przez " + _this.CreatedByName;
         lblCreated.Visible = true;
     }
     if (_this.PlaceToken != null)
     {
         GenerateQrCode(_this.PlaceToken);
     }
     img = new FileKeeper(this);
 }
示例#4
0
 public frmPart(Part Item, Form parent)
 {
     InitializeComponent();
     img                     = new FileKeeper(this);
     PriceKeeper             = new PartPriceKeeper();
     this.Owner              = parent;
     this.Location           = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     mode                    = 2;
     this.Text               = "Szczegóły części";
     _this                   = Item;
     files                   = new FileKeeper(this, Item.PartId);
     txtName.Text            = _this.Name;
     txtDescription.Text     = _this.Description;
     txtEAN.Text             = _this.EAN;
     txtProducersCode.Text   = _this.ProducentsCode;
     txtSymbol.Text          = _this.Symbol;
     txtAppliance.Text       = _this.Appliance;
     txtDestination.Text     = _this.Destination;
     txtUsedOn.Text          = _this.UsedOn;
     cboxArchived.CheckState = _this.IsArchived.ToCheckboxState();
     if (_this.CreatedOn != null && _this.CreatedBy != 0)
     {
         lblCreated.Text    = "Utworzone w dniu " + _this.CreatedOn + " przez " + _this.CreatedByName;
         lblCreated.Visible = true;
     }
     if (_this.Token != null)
     {
         GenerateQrCode(_this.Token);
     }
 }
示例#5
0
 public frmDetailedOverview(DateTime dateFrom, DateTime dateTo, ProcessActionStatsDivisionType divisionType)
 {
     InitializeComponent();
     ImageInfoKeeper     = new FileKeeper(this);
     ProcessKeeper       = new ProcessesKeeper();
     ProcessActionKeeper = new ProcessActionsKeeper();
     PlacesKeeper        = new PlacesKeeper();
     DateFrom            = dateFrom;
     DateTo       = dateTo;
     DivisionType = divisionType;
 }
示例#6
0
 public frmPlace(Form parent)
 {
     InitializeComponent();
     this.Owner         = parent;
     this.Location      = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     mode               = 1;
     lblCreated.Visible = false;
     this.Text          = "Nowy zasób";
     _this              = new Place();
     img   = new FileKeeper(this);
     files = new FileKeeper(this);
 }
示例#7
0
        public async Task ReportLastSessionCrash()
        {
            if (await Crashes.HasCrashedInLastSessionAsync())
            {
                //Functions.CreateZipFile();
                var report = await Crashes.GetLastSessionCrashReportAsync();

                if (report != null)
                {
                    string macAddress = await DependencyService.Get <IWifiHandler>().GetWifiMacAddress();

                    UserLog u = new UserLog()
                    {
                        HasTheAppCrashed = true,
                        OnRequest        = false,
                        LogName          = report.AppErrorTime.ToString("yyyy-MM-dd HH:mm:ss"),
                        Platform         = $"{DeviceInfo.Platform.ToString()} {DeviceInfo.VersionString}",
                        Device           = $"{DeviceInfo.Manufacturer} {DeviceInfo.Model} {macAddress}",
                        Comment          = null,
                        ErrorTime        = report.AppErrorTime.DateTime,
                        Message          = MessageFromStackTrace(report.StackTrace),
                        StackTrace       = report.StackTrace,
                        CreatedOn        = DateTime.Now,
                        CreatedBy        = RuntimeSettings.CurrentUser.UserId,
                        TenantId         = RuntimeSettings.CurrentUser.TenantId
                    };
                    UserLogKeeper.Items.Add(u);

                    await UserLogKeeper.AddToSyncQueue();

                    try
                    {
                        File f = new File()
                        {
                            Name      = report.AppErrorTime.ToString("yyyy-MM-dd HH:mm:ss"),
                            Link      = CreateSnapshotOfCurrentLog(),
                            UserLogId = u.SqliteId
                        };
                        FileKeeper fileKeeper = new FileKeeper(userLogId: u.SqliteId);
                        fileKeeper.IsOfflineKeeper = true;
                        fileKeeper.Items.Add(f);
                        //await fileKeeper.DeleteTable();
                        await fileKeeper.AddToSyncQueue();
                    }
                    catch (Exception ex)
                    {
                        throw;
                    }
                }
            }
        }
示例#8
0
 public frmPart(Form parent)
 {
     InitializeComponent();
     this.Owner              = parent;
     this.Location           = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
     mode                    = 1;
     lblCreated.Visible      = false;
     cboxArchived.CheckState = CheckState.Indeterminate;
     this.Text               = "Nowa część";
     _this                   = new Part();
     files                   = new FileKeeper(this);
     img         = new FileKeeper(this);
     PriceKeeper = new PartPriceKeeper();
 }
示例#9
0
        protected async override void OnStart()
        {
            // Handle when your app starts
            AppCenter.Start($"android={Static.Secrets.AppCenterSecret}", typeof(Analytics), typeof(Crashes));
            Analytics.SetEnabledAsync(true);
            FileKeeper files = new FileKeeper(uploadKeeper: true);

            RuntimeSettings.UploadKeeper = files;
            LogService logService = new LogService();

            RuntimeSettings.LogService  = logService;
            RuntimeSettings.SyncService = new SyncService();
            RuntimeSettings.SyncService.Keepers.Add(logService.UserLogKeeper);
            RuntimeSettings.SyncService.Keepers.Add(new FileKeeper());
        }
示例#10
0
 public ProcessAttachmentsViewModel()
 {
     CapturePhotoCommand = new AsyncCommand(CapturePhoto);
     PickPhotoCommand    = new AsyncCommand(PickPhoto);
     RemoveItemsCommand  = new AsyncCommand(RemoveItems);
     TapCommand          = new AsyncCommand <File>(OpenFile, (e) => {
         if (SelectionModeEnabled)
         {
             return(false);
         }
         return(true);
     });
     Items         = new ObservableRangeCollection <File>();
     SelectedItems = new ObservableRangeCollection <File>();
     FileKeeper    = new FileKeeper();
 }
示例#11
0
        private async void formLoaded(object sender, EventArgs e)
        {
            frmLogin FrmLogin = new frmLogin(this);

            FrmLogin.ShowDialog(this);
            files = new FileKeeper(mainForm: this, uploadKeeper: true);
            await files.Initialize();

            RuntimeSettings.UploadKeeper = files;
            filesSyncTimer          = new Timer(60000); //run it everyminute
            filesSyncTimer.Elapsed += Timer_Elapsed;
            filesSync         = new BackgroundWorker();
            filesSync.DoWork += (obj, ea) => SyncFiles();
            filesSyncTimer.Start();
            RuntimeSettings.PartBackup = new PartKeeper();
            Task.Run(() => RuntimeSettings.PartBackup.Refresh(type: 't'));
        }
示例#12
0
        public async Task Initialize()
        {
            IsWorking = true;
            base.Initialize();
            fileKeeper = RuntimeSettings.UploadKeeper;
            if (!fileKeeper.IsWorking)
            {
                await fileKeeper.RestoreUploadQueue();
            }

            //await fileKeeper.DeleteAll();
            Items = fileKeeper.Items;
            if (Items.Any())
            {
                HasItems = true;
            }
            IsWorking = false;
        }
示例#13
0
        public frmProcess(Process Process, Form parent)
        {
            InitializeComponent();
            this.Owner    = parent;
            this.Location = new Point(this.Owner.Location.X + 20, this.Owner.Location.Y + 20);
            mode          = 2;
            this.Text     = "Szczegóły zgłoszenia";
            _this         = Process;
            DatesChange();

            if (_this.CreatedOn != null && _this.CreatedBy != 0)
            {
                lblCreated.Text    = "Utworzone w dniu " + _this.CreatedOn + " przez " + _this.CreatedByName;
                lblCreated.Visible = true;
            }
            txtOutput.Text                 = _this.Output;
            assignedUsersHandler           = new AssignedUsersHandler(this);
            assignedUsersHandler.ProcessId = Process.ProcessId;
            files = new FileKeeper(this, null, null, Process.ProcessId);
        }
 public frmImagePreview()
 {
     InitializeComponent();
     files = new FileKeeper(this);
 }