public EnterRadioGraphyReport()
            : base()
        {
            InitializeComponent();
            this.ExcludePropertiesFromTracking.Add("RGReport");
            this.ExcludePropertiesFromTracking.Add("RGReportRows");
            this.ExcludePropertiesFromTracking.Add("CanDelete");
            this.ExcludePropertiesFromTracking.Add("RowsDeleted");
            this.ExcludePropertiesFromTracking.Add("ThicknessRangeUI");
            this.ExcludePropertiesFromTracking.Add("Thickness");
            this.ExcludePropertiesFromTracking.Add("FilmSizeWithCount");
            this.ExcludePropertiesFromTracking.Add("FilmSizeStringInCms");
            this.ExcludePropertiesFromTracking.Add("FilmSizeWithCountInCms");
            this.ExcludePropertiesFromTracking.Add("TotalAreaInCms");
            this.ExcludePropertiesFromTracking.Add("RetakeReasonText");


            this.OnCancelNavigation = "/RadiographyReports";

            if (App.RGReport == null)
            {
                //Means new RG Report, allow add
                this.IsEditMode = false;
                //clerk or not
                string currentRole = WebContext.Current.User.Roles.FirstOrDefault();
                if (currentRole.ToLower() == "clerk")
                {
                    clerkMode = true;
                    this.RGReportDataGrid.Visibility      = Visibility.Collapsed;
                    this.RGReportDataGridClerk.Visibility = Visibility.Visible;

                    //make sure the rows are not frozen for the clerk-specific datagrid
                    CustomGrid.IsEditAllowed = true;
                }
            }
            else
            {
                this.RGReport   = App.RGReport;
                DataContext     = this.RGReport;
                this.IsEditMode = true;
                //set the query parameter here, the binding in the xaml is not working fine
                this.EditRGReportsSource.QueryParameters[0].Value = this.RGReport.ID;
            }

            //wire up event handlers
            AddEventHandlers();
            SetBindings();

            if (IsEditMode)
            {
                DomainSource.Load();
            }
            UpdateEnergyWiseArea();
        }
Пример #2
0
        private void FetchOperation(object sender, RoutedEventArgs e)
        {
            //ensure that the mandatory fields are filled
            if (String.IsNullOrEmpty(this.txtFPNo.Text) ||
                String.IsNullOrEmpty(this.txtRTNo.Text) ||
                this.cmbCoverage.SelectedIndex == -1)
            {
                MessageBox.Show("Please fill FP No, Coverage and RT No before fetching");
                return;
            }

            this.IsEditMode = false;
            this.RGReportDataGrid.CommitEdit();
            if (DomainSource.HasChanges)
            {
                DomainSource.RejectChanges();
            }
            DomainSource.Load();
        }
Пример #3
0
        public FinalRadioGraphyReport()
            : base()
        {
            InitializeComponent();

            if (App.FinalReport == null)
            {
                //Means we came here by mistake go to casting status page
                Navigate("/CastingStatusReport");
            }
            else
            {
                this.FinalReport = App.FinalReport;

                //set the query parameter here, the binding in the xaml won't work fine
                this.DomainSource.QueryParameters[0].Value = this.FinalReport.RTNo;
            }

            //wire up event handlers
            AddEventHandlers();
            SetBindings();
            DomainSource.Load();
        }
 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     DomainSource.Load();
 }