Пример #1
0
        public int Insert(MeasurementMethod measurementmethod_)
        {
            try
            {
                var methodtoinsert = new MeasurementMethod
                {
                    MeasurementMethodID = measurementmethod_.MeasurementMethodID,
                    Description_EN      = measurementmethod_.Description_EN,
                    Description_MX      = measurementmethod_.Description_MX,
                    Description_CN      = measurementmethod_.Description_CN,
                    IsActive            = true,
                    Notes      = measurementmethod_.Notes,
                    CreateDate = measurementmethod_.CreateDate,
                    CreatedBy  = measurementmethod_.CreatedBy,

                    LastEditDate = measurementmethod_.LastEditDate,
                    LastEditBy   = measurementmethod_.LastEditBy
                };

                _qualityEntities.AddToMeasurementMethods(methodtoinsert);
                _qualityEntities.SaveChanges(SaveOptions.None);
                return(methodtoinsert.MeasurementMethodID);
            }
            catch (Exception ex)
            {
                string errormessage = ex.ToString();
                return(0);
            }
        }
Пример #2
0
        // invoked every time even initially
        private async Task SetNextElement(IMeasurementMethod measurementMethod)
        {
            var element = ActivateNextElement(measurementMethod);

            ElementsViewModels.ForEach(evm => evm.Update());

            ActiveElementViewModel = ElementsViewModels.FirstOrDefault(x => x.Element == element);

            if (element == null)
            {
                return;
            }

            if (element.Plane == null)
            {
                await ShowPlaneSelectionDialog();
            }

            // Check if should show blocking dialog
            if (MeasurementMethod.SetupInitialPosition(null))
            {
                await ShowAxisBlockDialog();
            }

            Subscribe(measurementMethod, element);

            _measurementManager.GatherData = true;
        }
Пример #3
0
        public void Update(MeasurementMethod MeasurementMethod_)
        {
            var methodtoupdate = _qualityEntities.MeasurementMethods
                                 .FirstOrDefault(x => x.MeasurementMethodID == MeasurementMethod_.MeasurementMethodID);

            methodtoupdate.Description_EN = MeasurementMethod_.Description_EN;
            methodtoupdate.Description_MX = MeasurementMethod_.Description_MX;
            methodtoupdate.Description_CN = MeasurementMethod_.Description_CN;


            methodtoupdate.IsActive     = MeasurementMethod_.IsActive;
            methodtoupdate.Notes        = MeasurementMethod_.Notes;
            methodtoupdate.LastEditDate = MeasurementMethod_.LastEditDate;
            methodtoupdate.LastEditBy   = MeasurementMethod_.LastEditBy;

            _qualityEntities.SaveChanges(SaveOptions.None);
        }
Пример #4
0
 public bool CanCalculate() => MeasurementMethod != null && MeasurementMethod.CanCalculate();