public ActionResult MeasurementMethodMaintenance()
        {
            GetUserInfo();
            MeasurementMethodViewModel viewModel = new MeasurementMethodViewModel()
            {
                MeasurementMethods = _measurementmethodRepository.MeasurementMethod.Where(a => a.IsActive == true),
                CanUserEdit        = UserCanEdit
            };


            return(View("MeasurementMethodMaintenance", viewModel));
        }
        public ActionResult MeasurementMethodCreate()
        {
            GetUserInfo();
            bool canuseredit = CanUserEdit();


            MeasurementMethodViewModel viewModel = new MeasurementMethodViewModel()
            {
                CanUserEdit = canuseredit
            };

            return(View());
        }
        public ActionResult MeasurementMethodEdit(int id_)
        {
            GetUserInfo();
            bool canuseredit = CanUserEdit();
            MeasurementMethodViewModel viewModel = new MeasurementMethodViewModel()
            {
                CanUserEdit       = canuseredit,
                MeasurementMethod = _measurementmethodRepository.MeasurementMethod.FirstOrDefault(a => a.MeasurementMethodID == id_)
            };

            viewModel.IsActive = viewModel.MeasurementMethod.IsActive;
            return(View(viewModel));
        }
Exemple #4
0
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            if (_measurementManager.SelectedMeasurementMethod == null)
            {
                EventAggregator
                .GetEvent <ResetMeasurement>()
                .Publish(null);
            }

            UpdateNavigationCommands();

            if (parameter is MeasurementCalibrationViewModel)
            {
                await MeasurementMethodViewModel.SetNextElement();
            }
        }
        public ActionResult MeasurementMethodCreate(MeasurementMethodViewModel viewModel_)
        {
            if (viewModel_.MeasurementMethod.Description_EN == null)
            {
                ModelState.AddModelError("CategoryCreateError", "An English description is required.");
            }



            GetUserInfo();

            if (ModelState.IsValid)
            {
                int measurementmethodid = 0;
                viewModel_.MeasurementMethod.Description_EN = viewModel_.MeasurementMethod.Description_EN;
                viewModel_.MeasurementMethod.Description_MX = viewModel_.MeasurementMethod.Description_MX;
                viewModel_.MeasurementMethod.Description_CN = viewModel_.MeasurementMethod.Description_CN;
                viewModel_.MeasurementMethod.IsActive       = true;
                viewModel_.MeasurementMethod.Notes          = viewModel_.MeasurementMethod.Notes;
                viewModel_.MeasurementMethod.CreateDate     = DateTime.Now;
                viewModel_.MeasurementMethod.CreatedBy      = username;
                viewModel_.MeasurementMethod.LastEditDate   = DateTime.Now;
                viewModel_.MeasurementMethod.LastEditBy     = username;


                measurementmethodid = _measurementmethodRepository.Insert(viewModel_.MeasurementMethod);
                string anchor = "measure" + measurementmethodid.ToString();
                this.ShowSaveSuccessfull();
                MeasurementMethodViewModel viewModel = new MeasurementMethodViewModel()
                {
                    MeasurementMethods = _measurementmethodRepository.MeasurementMethod.Where(a => a.IsActive == true),
                    CanUserEdit        = UserCanEdit,
                    returnanchor       = anchor
                };


                return(View("MeasurementMethodMaintenance", viewModel));
            }
            else
            {
                return(View(viewModel_));
            }
        }
Exemple #6
0
        protected override async Task <bool> OnNext()
        {
            await MeasurementMethodViewModel.SetNextElement();

            return(await base.OnNext());
        }