Exemple #1
0
        private void BindToViewModel()
        {
            MillPipeSearchBindingSource.DataSource = viewModel;

            foreach (var s in viewModel.PipeTypes)
            {
                pipeSize.Properties.Items.Add(s, true);
            }
            foreach (var item in EnumWrapper <PipeMillStatus> .EnumerateItems(skip0: true))
            {
                pipeMillStatus.Properties.Items.Add(item.Item1, item.Item2, CheckState.Checked, enabled: true);
            }

            foreach (var item in EnumWrapper <ActivityCriteria> .EnumerateItems())
            {
                pipeActivity.Properties.Items.Add(item.Item2);
            }
            viewModel.Activity = ActivityCriteria.StatusActive;


            pipesSearchResult.DataBindings
            .Add("DataSource", MillPipeSearchBindingSource, "Pipes");
            pipeNumber.DataBindings
            .Add("EditValue", MillPipeSearchBindingSource, "PipeNumber");
            pipeActivity.DataBindings
            .Add("SelectedIndex", MillPipeSearchBindingSource, "ActivityIndex");
            weldingDate.DataBindings
            .Add("DateTime", MillPipeSearchBindingSource, "WeldingDate");
            externalCoatingDate.DataBindings
            .Add("DateTime", MillPipeSearchBindingSource, "ExternalCoatingDate");
            internalCoatingDate.DataBindings
            .Add("DateTime", MillPipeSearchBindingSource, "InternalCoatingDate");
            heatNumber.DataBindings
            .Add("EditValue", MillPipeSearchBindingSource, "HeatNumber");
        }
Exemple #2
0
        private void MillPipeNewEditXtraForm_Load(object sender, EventArgs e)
        {
            foreach (var item in EnumWrapper <PipeTestResultStatus> .EnumerateItems(skip0: true))
            {
                localizedAllPipeTestResultStatus.Add(item.Item2);
            }
            foreach (var item in EnumWrapper <PipeMillStatus> .EnumerateItems())
            {
                localizedAllPipeMillStatus.Add(item.Item2);
            }
            BindCommands();
            BindToViewModel();
            viewModel.PropertyChanged += (s, eve) => IsModified = true;

            IsEditMode = viewModel.PipeIsActive && !(viewModel.Pipe.Status == PipeMillStatus.Shipped);

            pipeNumber.SetMask(viewModel.Project.MillPipeNumberMaskRegexp);

            IsModified         = false;
            pipeNumber.ToolTip = Program.LanguageManager.GetString(StringResources.MillPipeNumber_Mask_Hint)
                                 + viewModel.Project.MillPipeNumberMask;

            pipeCreationDate.SetLimits();
            repositoryCoatingDate.SetLimits();
            repositoryWeldingDate.SetLimits();
        }
Exemple #3
0
 private void NumbersDialog_Load(object sender, EventArgs e)
 {
     foreach (var item in EnumWrapper <PartType> .EnumerateItems(skip0: true))
     {
         localizedPartTypes.Add(item.Item2);
     }
     searchResults.DataSource = parts;
 }
        private void LoadPipeMillStatuses()
        {
            StatusTypes = new List <EnumWrapper <PipeMillStatus> >();

            foreach (var item in EnumWrapper <PipeMillStatus> .EnumerateItems(skip0: true))
            {
                StatusTypes.Add(new EnumWrapper <PipeMillStatus>(item.Item2));
            }
        }
        private void LoadJointOperationTypes()
        {
            JointOperationTypes = new List <EnumWrapper <JointOperationType> >();

            foreach (var item in EnumWrapper <JointOperationType> .EnumerateItems(skip0: true))
            {
                JointOperationTypes.Add(new EnumWrapper <JointOperationType>((JointOperationType)item.Item1)); // TODO: binding list vs localization - ?
            }
        }
Exemple #6
0
        private void LoadStatuses()
        {
            CheckedStatusTypes = new HashSet <PipeMillStatus>();

            foreach (var item in EnumWrapper <PipeMillStatus> .EnumerateItems(skip0: true))
            {
                CheckedStatusTypes.Add((PipeMillStatus)item.Item1);
            }
        }
Exemple #7
0
 private void FirstSetupXtraForm_Load(object sender, EventArgs e)
 {
     foreach (var item in EnumWrapper <WorkstationType> .EnumerateItems())
     {
         localizedAllWorkstations.Add(item.Item2);
     }
     BindToViewModel();
     pipeNumberMaskRulesLabel.Text = Program.LanguageManager.GetString(StringResources.Mask_Label);
 }
Exemple #8
0
 public static void LoadItems(List <string> list, bool skip0 = false)
 {
     if (list != null && list.Count == 0)
     {
         foreach (var item in EnumWrapper <PartType> .EnumerateItems(skip0))
         {
             list.Add(item.Item2);
         }
     }
 }
Exemple #9
0
        private void InspectionAddEditXtraForm_Load(object sender, EventArgs e)
        {
            status.Properties.Items.Clear();
            foreach (var item in EnumWrapper <PipeTestResultStatus> .EnumerateItems(skip0: true))
            {
                status.Properties.Items.Add(item.Item2);
            }
            BindToViewModel();

            factBool_CheckedChanged(null, null);

            date.SetLimits();
        }
Exemple #10
0
        private void BindToViewModel()
        {
            bindingSource.DataSource = viewModel;
            parts.DataBindings.Add("DataSource", bindingSource, "Parts");
            number.DataBindings.Add("Editvalue", bindingSource, "Number");
            foreach (var item in EnumWrapper <ActivityCriteria> .EnumerateItems())
            {
                activity.Properties.Items.Add(item.Item2);
            }

            viewModel.Activity = ActivityCriteria.StatusActive;

            activity.DataBindings.Add("SelectedIndex", bindingSource, "ActivityIndex");
        }
Exemple #11
0
        private void MillPipeSearchXtraForm_Load(object sender, System.EventArgs e)
        {
            viewModel = (MillPipeSearchViewModel)Program.Kernel.GetService(typeof(MillPipeSearchViewModel));

            foreach (var item in EnumWrapper <PipeMillStatus> .EnumerateItems())
            {
                localizedAllPipeMillStatus.Add(item.Item2);
            }

            BindCommands();
            BindToViewModel();

            weldingDate.SetLimits();
            externalCoatingDate.SetLimits();
            internalCoatingDate.SetLimits();
        }
        private void ComponentNewEditXtraForm_Load(object sender, EventArgs e)
        {
            foreach (var item in EnumWrapper <PartInspectionStatus> .EnumerateItems(skip0: true))
            {
                localizedAllInspectionStatus.Add(item.Item2);
            }
            BindCommands();
            BindToViewModel();

            viewModel.PropertyChanged += (s, eve) => IsModified = true;

            IsEditMode = viewModel.ComponentIsActive;

            IsModified = false;

            repositoryInspectionDate.SetLimits();
        }
Exemple #13
0
 private void PartsSearchXtraForm_Load(object sender, EventArgs e)
 {
     viewModel = (PartSearchViewModel)Program.Kernel.GetService(typeof(PartSearchViewModel));
     BindCommands();
     BindToViewModel();
     foreach (var item in EnumWrapper <ActivityCriteria> .EnumerateItems())
     {
         activity.Properties.Items.Add(item.Item2);
     }
     foreach (var item in EnumWrapper <PartType> .EnumerateItems(skip0: true))
     {
         type.Properties.Items.Add(item.Item1, item.Item2, CheckState.Checked, enabled: true);
         localizedPartTypes.Add(item.Item2);
     }
     RefreshTypes();
     activity.SelectedIndex = 0;
 }
Exemple #14
0
        private void SpoolsXtraForm_Load(object sender, System.EventArgs e)
        {
            foreach (var item in EnumWrapper <PartInspectionStatus> .EnumerateItems(skip0: true))
            {
                localizedAllInspectionStatus.Add(item.Item2);
            }
            BindToViewModel();

            attachmentsButton.Enabled =
                (!viewModel.IsNew || viewModel.SpoolNumber != String.Empty);

            viewModel.PropertyChanged += (s, eve) => IsModified = true;
            IsEditMode = ((this.id != Guid.Empty || viewModel.SpoolNumber != String.Empty) && viewModel.SpoolIsActive);
            BindCommands();

            inspectionDateEdit.SetLimits();
            spoolNumber.SetAsIdentifier();
        }
        private void ConstructionReportsXtraForm_Load(object sender, EventArgs e)
        {
            infoLabel.Text = Program.LanguageManager.GetString(StringResources.ConstructionReport_TracingReportInfoLabelText);

            viewModel = (ConstructionReportViewModel)Program.Kernel.GetService(typeof(ConstructionReportViewModel));

            foreach (var item in EnumWrapper <PartType> .EnumerateItems(skip0:true))
            {
                type.Properties.Items.Add(item.Item1, item.Item2, CheckState.Checked, true);
            }
            foreach (var item in EnumWrapper <ReportType> .EnumerateItems())
            {
                reportType.Properties.Items.Add(item.Item2);
            }

            viewModel.LoadData();

            foreach (var joint in viewModel.Joints)
            {
                start.Properties.Items.Add(joint);
                end.Properties.Items.Add(joint);
            }

            foreach (var kp in viewModel.AllKP)
            {
                startKPComboBox.Properties.Items.Add(kp);
                endKPComboBox.Properties.Items.Add(kp);
            }

            BindToViewModel();
            BindCommands();
            RefreshTypes();

            startKPComboBox.SelectedIndex = 0;
            viewModel.StartPK             = (startKPComboBox.EditValue != null) ? (int)startKPComboBox.EditValue: default(int);

            endKPComboBox.SelectedIndex = 0;
            viewModel.EndPK             = (endKPComboBox.EditValue != null) ? (int)endKPComboBox.EditValue : default(int);

            viewModel.ReportTypeIndex = reportType.SelectedIndex = 0;

            tracingModeRadioGroup_SelectedIndexChanged(tracingModeRadioGroup, e);
        }
Exemple #16
0
        private void PartInspectionXtraForm_Load(object sender, EventArgs e)
        {
            foreach (var item in EnumWrapper <PartType> .EnumerateItems())
            {
                localizedAllPartTypes.Add(item.Item2);
            }
            foreach (var item in EnumWrapper <PartInspectionStatus> .EnumerateItems(skip0:true))
            {
                localizedAllInspectionStatus.Add(item.Item2);
            }
            viewModel                = (PartInspectionViewModel)Program.Kernel.GetService(typeof(PartInspectionViewModel));
            viewModel.CurrentForm    = this;
            viewModel.ModifiableView = this;
            BindCommands();
            BindToViewModel();
            IsEditMode = false;

            repositoryInspectionDateEdit.SetLimits();
        }
Exemple #17
0
        private void MillReportsXtraForm_Load(object sender, EventArgs e)
        {
            foreach (var item in EnumWrapper <MillReportType> .EnumerateItems())
            {
                reportTypes.Properties.Items.Add(new RadioGroupItem(item.Item1, item.Item2));
            }
            foreach (var item in EnumWrapper <PipeTestResultStatus> .EnumerateItems(skip0: true))
            {
                statuses.Items.Add(item.Item2);
            }
            viewModel = (MillReportsViewModel)Program.Kernel.GetService(typeof(MillReportsViewModel));
            BindToViewModel();
            BindCommands();
            viewModel.StartDate       = DateTime.Now.Date;
            viewModel.EndDate         = DateTime.Now.Date;
            reportTypes.SelectedIndex = 3;

            startDate.SetLimits();
            endDate.SetLimits();
        }
Exemple #18
0
        private void JointSearchXtraForm_Load(object sender, System.EventArgs e)
        {
            BindCommands();
            BindToViewModel();
            foreach (var item in EnumWrapper <ActivityCriteria> .EnumerateItems())
            {
                activity.Properties.Items.Add(item.Item2);
            }
            foreach (var item in EnumWrapper <JointStatus> .EnumerateItems(skip0: true))
            {
                controlState.Properties.Items.Add(item.Item1, item.Item2, CheckState.Checked, enabled: true);
                localizedJointStatuses.Add(item.Item2);
            }
            activity.SelectedIndex = 0;
            viewModel.Activity     = ActivityCriteria.StatusActive;
            controlState_CloseUp(controlState, new DevExpress.XtraEditors.Controls.CloseUpEventArgs(true));

            weldingDateFrom.SetLimits();
            weldingDateTo.SetLimits();
        }
Exemple #19
0
        private void JointNewEditXtraForm_Load(object sender, EventArgs e)
        {
            foreach (var item in EnumWrapper <JointStatus> .EnumerateItems())
            {
                localizedAllJointStatus.Add(item.Item2);
            }
            BindCommands();
            BindToViewModel();
            viewModel.PropertyChanged += (s, eve) =>
            {
                if (eve.PropertyName != "Pieces")
                {
                    IsModified = true;
                }
            };
            IsEditMode = viewModel.JointIsActive;
            IsModified = false;

            loweringDate.SetLimits();
            repairDateEdit.SetLimits();
            operationDateEdit.SetLimits();
        }
Exemple #20
0
        private void MillInspectionXtraForm_Load(object sender, EventArgs e)
        {
            resultType.Properties.Items.Clear();
            controlType.Properties.Items.Clear();
            frequencyMeasure.Properties.Items.Clear();

            foreach (var item in EnumWrapper <PipeTestResultType> .EnumerateItems(skip0: true))
            {
                resultType.Properties.Items.Add(item.Item2);
            }
            foreach (var item in EnumWrapper <PipeTestControlType> .EnumerateItems(skip0: true))
            {
                controlType.Properties.Items.Add(item.Item2);
            }
            foreach (var item in EnumWrapper <FrequencyMeasure> .EnumerateItems(skip0: true))
            {
                frequencyMeasure.Properties.Items.Add(item.Item2);
            }
            BindToViewModel();
            boolExpected_CheckedChanged(null, null);

            code.SetAsIdentifier();
            code.SetRequiredText();
        }