Esempio n. 1
0
        private void UpdateDetailDirectiveList()
        {
            List <DetailDirective> detailDirectives = new List <DetailDirective>(currentDetail.GetDetailDirectives());

            for (int i = 0; i < detailDirectives.Count; i++)
            {
                comboBoxWorkType.Items.Add(detailDirectives[i]);
            }
            if (comboBoxWorkType.Items.Count > 0)
            {
                comboBoxWorkType.SelectedIndex = 0;
            }
        }
        /// <summary>
        /// Обновляет данные
        /// </summary>
        public void UpdateInformation()
        {
            flowLayoutPanelPerformances.Controls.Clear();
            existPrformances.Clear();
            addedPerformances.Clear();
            List <DetailDirective> detailDirectives = new List <DetailDirective>(currentDetail.GetDetailDirectives());

            for (int i = 0; i < detailDirectives.Count; i++)
            {
                DetailCompliancePerformanceControl compliancePerformanceControl = new DetailCompliancePerformanceControl(detailDirectives[i]);
                compliancePerformanceControl.Deleted += compliancePerformanceControl_Deleted;
                existPrformances.Add(compliancePerformanceControl);
                flowLayoutPanelPerformances.Controls.Add(compliancePerformanceControl);
            }
            if (currentDetail != null && currentDetail.InUse)
            {
                flowLayoutPanelPerformances.Controls.Add(linkLabelAddNew);
            }
        }
Esempio n. 3
0
        private void UpdateDetail(bool reloadDetail)
        {
            try
            {
                if (reloadDetail)
                {
                    if (currentDetail is BaseDetail)
                    {
                        currentDetail.Reload();
                    }
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while loading data", ex);
                return;
            }


            bool permission = currentDetail.HasPermission(Users.CurrentUser, DataEvent.Update);

            headerControl.ActionControl.ShowEditButton = permission;
            buttonAddCompliance.Enabled = (permission && currentDetail.GetDetailDirectives().Length > 0);

            complianceDirectiveControl_SelectedItemsChanged(complianceControl, new SelectedItemsChangeEventArgs(0));

            baseDetailHeaderControl.UpdateInformation();
            generalInformationControl.UpdateInformation();
            compliancePerformanceControl.UpdateInformation();
            warrantyControl.UpdateInformation();
            easaControl.UpdateInformation();
            if (!currentDetail.InUse)
            {
                storeControl.UpdateInformation();
            }


            complianceControl.UpdateItems();
            complianceControl.DoubleClickEnable = permission;
            headerControl.ContextActionControl.ButtonPrint.Enabled = !(DisplayedDetailRecords.Length == 0);
        }