Example #1
0
        private void FormLoaded(object sender, EventArgs e)
        {
            looper         = new frmLooper(this);
            looper.TopMost = true;
            Reload();
            //Initialize auto sum in status here
            AutoSum autoSum = new AutoSum(this.sumStatusStrip, this.dgItems);

            autoSum.Initilize();
        }
Example #2
0
 private void FormLoaded(object sender, EventArgs e)
 {
     Looper = new frmLooper(this);
     if (!string.IsNullOrEmpty(_this.NewValue) && !string.IsNullOrEmpty(_this.OldValue))
     {
         var    jdp        = new JsonDiffPatch();
         JToken diffResult = jdp.Diff(_this.OldValue, _this.NewValue);
         txtDiff.Text = diffResult.ToString(Formatting.Indented).Replace("\\r\\n", "");
     }
 }
 private async void FormLoaded(object sender, EventArgs e)
 {
     Looper = new frmLooper(this);
     Looper.Show(this);
     if (mode > 1)
     {
     }
     else
     {
     }
     Looper.Hide();
 }
 private void frmGetPartData_Load(object sender, EventArgs e)
 {
     Looper = new frmLooper(this);
     if (Type == PartDataFormType.Price)
     {
         StyleAsPriceForm();
         CreatePrices();
     }
     else
     {
         StyleAsStockForm();
         CreateStocks();
     }
 }
Example #5
0
        private async void FormLoaded(object sender, EventArgs e)
        {
            Looper = new frmLooper(this);
            Looper.Show(this);
            companyTypes = new CompanyTypesKeeper();
            await companyTypes.Refresh();

            cmbType.DataSource    = companyTypes.Items;
            cmbType.DisplayMember = "Name";
            cmbType.ValueMember   = "CompanyTypeId";
            if (mode != 1)
            {
                cmbType.SelectedIndex = cmbType.FindStringExact(_this.CompanyTypeName);
            }
            Looper.Hide();
        }
Example #6
0
        private async void FormLoaded(object sender, EventArgs e)
        {
            Looper = new frmLooper(this);
            Looper.Show(this);
            IsLoading = true;

            List <Task> LoadingTasks = new List <Task>();

            LoadingTasks.Add(Task.Run(() => SupplierKeeper.Refresh("TypeId=2")));
            LoadingTasks.Add(Task.Run(() => _this.ItemKeeper.Refresh($"OrderId={_this.OrderId}")));
            await Task.WhenAll(LoadingTasks);

            SetPartFinder();
            new AutoCompleteBehavior <Company>(this.cmbSupplier, SupplierKeeper.Items);
            cmbSupplier.DisplayMember = "Name";
            cmbSupplier.ValueMember   = "CompanyId";
            source.DataSource         = _this.ItemKeeper.Items;
            dgvItems.DataSource       = source;
            AdjustColumns();
            StyleEditable(_this.IsArchived);
            StyleItemsArchived();
            dgvItems.TabAction           = () => Finder.TabPressed();
            dgvItems.TabListeningColumns = new List <string>()
            {
                "PartId"
            };
            dgvItems.EnterAction           = () => Finder.EnterPressed();
            dgvItems.EnterListeningColumns = new List <string>()
            {
                "PartId"
            };
            dgvItems.KeyDownAction = () => Finder.GetFocus();
            dgvItems.EscapeAction  = () => Finder.Hide();

            if (mode > 1)
            {
                BindFromObject();
            }
            else
            {
            }
            IsLoading = false;
            Looper.Hide();
        }
Example #7
0
        private async void formLoaded(object sender, EventArgs e)
        {
            frmLooper Looper = new frmLooper(this);

            Looper.Show(this);
            try
            {
                await Keeper.Refresh();

                //cmbUsers.DataSource = Keeper.Items;
                //cmbUsers.DisplayMember = "FullName";
                //cmbUsers.ValueMember = "UserId";
                SetComboboxes();
                txtPassword.Text      = "Hasło";
                txtPassword.ForeColor = Color.Gray;
            }
            catch (Exception ex)
            {
                MessageBox.Show(RuntimeSettings.ConnectionUnavailableMessage, "Brak połączenia", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
            Looper.Hide();
        }
Example #8
0
        private async void FormLoaded(object sender, EventArgs e)
        {
            Looper = new frmLooper(this);
            Looper.Show(this);
            producers = new CompaniesKeeper();
            suppliers = new CompaniesKeeper();
            SetComboboxes();
            InitiailizeButtonContextMenu();
            if (mode > 1)
            {
                EnableButtons();
                List <Task> tasks = new List <Task>()
                {
                    Task.Run(() => GetBoms()),
                    Task.Run(() => GetImage()),
                    Task.Run(() => GetUsedParts()),
                    Task.Run(() => GetPrices())
                };
                await Task.WhenAll(tasks);
            }

            files.Initialize();
            Looper.Hide();
        }
Example #9
0
 private void FormLoaded(object sender, EventArgs e)
 {
     looper         = new frmLooper(this);
     looper.TopMost = true;
     Reload();
 }
Example #10
0
 private void FormLoaded(object sender, EventArgs e)
 {
     Looper = new frmLooper(this);
 }
Example #11
0
        private async void FormLoaded(object sender, EventArgs e)
        {
            Looper = new frmLooper(this);
            Looper.Show(this);
            var PlaceRefreshTask         = Task.Run(() => Places.Refresh(null, 'a'));
            var StartingUsersRefreshTask = Task.Run(() => StartingUsers.Refresh(null, 'a'));
            var LoadActionTypesTask      = Task.Run(() => ActionTypes.Refresh());
            var LoadAbandonReasonsTask   = Task.Run(() => AbandonReasons.Refresh());
            await Task.WhenAll(PlaceRefreshTask, StartingUsersRefreshTask, LoadActionTypesTask, LoadAbandonReasonsTask);

            FinishingUsers.Items  = new List <User>(StartingUsers.Items);
            AssignableUsers.Items = new List <User>(StartingUsers.Items);
            _this.Handlings       = new HandlingsKeeper();
            _this.Logs            = new LogsKeeper();
            _this.PartUsages      = new PartUsageKeeper();
            _this.ProcessActions  = new ProcessActionsKeeper();
            //await ActionTypes.Refresh();
            if (mode == 1)
            {
                cmbActionType.DataSource = ActionTypes.Items.Where(i => i.ShowInPlanning == true).ToList();
                txtPlannedStart.Enabled  = true;
                txtPlannedFinish.Enabled = true;
                txtPlannedStart.Value    = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 0, 0);
                txtPlannedFinish.Value   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 0, 0);
            }
            else
            {
                cmbActionType.DataSource = ActionTypes.Items;
                if (_this.PlannedStart == null)
                {
                    txtPlannedStart.CustomFormat  = " ";
                    txtPlannedFinish.CustomFormat = " ";
                    txtPlannedStart.Enabled       = false;
                    txtPlannedFinish.Enabled      = false;
                }
                else
                {
                    txtPlannedStart.Value = (DateTime)_this.PlannedStart;
                    if (_this.PlannedFinish != null)
                    {
                        txtPlannedFinish.Value = (DateTime)_this.PlannedFinish;
                    }
                }
                if (_this.Status == "Planowany")
                {
                    txtPlannedStart.Enabled  = true;
                    txtPlannedFinish.Enabled = true;
                }
                else
                {
                    txtPlannedStart.Enabled  = false;
                    txtPlannedFinish.Enabled = false;
                }
                txtComment.Text = _this.Comment;
                LoadHistory();
                var loadActionsTask        = Task.Run(() => LoadActions());
                var loadProcessAssingsTask = Task.Run(() => assignedUsersHandler.LoadProcessAssigns());
                var loadUsedPartsTask      = Task.Run(() => LoadParts());

                await Task.WhenAll(loadActionsTask, loadProcessAssingsTask, loadUsedPartsTask);

                lblAssignedUsers.Text = assignedUsersHandler.AssignedUserNames;
            }
            cmbStartedBy.DataSource  = StartingUsers.Items;
            cmbFinishedBy.DataSource = FinishingUsers.Items;
            new AutoCompleteBehavior <Place>(this.cmbPlace, Places.Items);
            cmbStartedBy.DisplayMember  = "FullName";
            cmbStartedBy.ValueMember    = "UserId";
            cmbFinishedBy.DisplayMember = "FullName";
            cmbFinishedBy.ValueMember   = "UserId";
            cmbActionType.DisplayMember = "Name";
            cmbActionType.ValueMember   = "ActionTypeId";
            cmbPlace.DisplayMember      = "Name";
            cmbPlace.ValueMember        = "PlaceId";
            cmbActionType.SelectedIndex = cmbActionType.FindStringExact(_this.ActionTypeName);
            cmbPlace.SelectedIndex      = cmbPlace.FindStringExact(_this.PlaceName);
            cmbStartedBy.SelectedIndex  = cmbStartedBy.FindStringExact(_this.StartedByName);
            cmbFinishedBy.SelectedIndex = cmbFinishedBy.FindStringExact(_this.FinishedByName);
            cmbStatus.SelectedIndex     = cmbStatus.FindStringExact(_this.Status);
            if (_this.StartedOn != null)
            {
                LoadHandlings();

                txtStartedOn.Value = (DateTime)_this.StartedOn;
            }
            if (_this.FinishedOn != null)
            {
                txtFinishedOn.Value = (DateTime)_this.FinishedOn;
            }

            ChangeLook();
            if (_this.Status == "Zakończony" || _this.Status == "Zrealizowany")
            {
                try
                {
                    Wait4Reactivation();
                }
                catch (Exception ex)
                {
                }
            }
            files.Initialize();
            Looper.Hide();
        }