Пример #1
0
        public PersonForm(PersonRowData person)
        {
            InitializeComponent();

            this.person = person;

            Text = person.Person.FullName + " - " + person.Person.UIId();
            personInfo.EditValue = person.Person.ToFullString();
            personInfo.SuperTip  = Utilities.CreateSuperTip(body: person.Person.ToFullString());

            infoSource.Caption   += person.Person.Source;
            infoStripeId.Caption += person.StripeId;
            infoYKID.Caption     += person.Person.YKID;
            infoYKID.SuperTip     = Utilities.CreateSuperTip("Row ID", person.Person.Id.ToString());

            foreach (DataTable table in person.DataSet.Tables)
            {
                var grid = new GridControl()
                {
                    Dock       = DockStyle.Fill,
                    DataSource = table,
                };

                tabs.TabPages.Add(new XtraTabPage {
                    Text     = table.TableName,
                    Controls = { grid }
                });

                var view = new GridView();
                grid.MainView = view;
                CustomizeDetailView(table, view);
            }
        }
Пример #2
0
 public int MergePerson(DbTransaction transaction, PersonRowData oldPerson, Person newPerson)
 {
     return
         transaction.ExecuteNonQuery(
             tables.Join(";\n\n\n", t => t.UpdateSql)
           + ";\n\n\nUPDATE Data.MasterDirectory SET StripeId = @oldStripeId WHERE Id = @newId AND StripeId IS NULL"
           + ";\n\n\nDELETE FROM Data.MasterDirectory WHERE Id = @oldId", new { oldId = oldPerson.Person.Id, newId = newPerson.Id, oldStripeId = oldPerson.StripeId });
 }
Пример #3
0
 public int MergePerson(DbTransaction transaction, PersonRowData oldPerson, Person newPerson)
 {
     return
         (transaction.ExecuteNonQuery(
              tables.Join(";\n\n\n", t => t.UpdateSql)
              + ";\n\n\nUPDATE Data.MasterDirectory SET StripeId = @oldStripeId WHERE Id = @newId AND StripeId IS NULL"
              + ";\n\n\nDELETE FROM Data.MasterDirectory WHERE Id = @oldId", new { oldId = oldPerson.Person.Id, newId = newPerson.Id, oldStripeId = oldPerson.StripeId }));
 }
Пример #4
0
        public PersonForm(PersonRowData person)
        {
            InitializeComponent();

            this.person = person;

            Text = person.Person.FullName + " - " + person.Person.Id;
            personInfo.EditValue = person.Person.ToFullString();
            personInfo.SuperTip = Utilities.CreateSuperTip(body: person.Person.ToFullString());

            infoSource.Caption += person.Person.Source;
            infoStripeId.Caption += person.StripeId;
            infoYKID.Caption += person.Person.YKID;

            foreach (DataTable table in person.DataSet.Tables) {
                var grid = new GridControl() {
                    Dock = DockStyle.Fill,
                    DataSource = table,
                };

                tabs.TabPages.Add(new XtraTabPage {
                    Text = table.TableName,
                    Controls = { grid }
                });

                var view = new GridView();
                grid.MainView = view;
                view.PopulateColumns();

                view.OptionsBehavior.Editable = false;

                foreach (GridColumn column in view.Columns) {
                    if (hiddenFields.Contains(column.FieldName)
                     || column.FieldName == pluralizer.Singularize(Path.GetExtension(table.TableName).TrimStart('.')) + "Id")
                        column.Visible = false;
                }

                view.BestFitColumns();
            }
        }
Пример #5
0
        public MergeForm(IEnumerable <PersonRowData> sources, string caption)
        {
            InitializeComponent();

            gridSource = new GridList(sources);

            target = gridSource.Sources.Last();

            label.Text = caption;
            Text       = $"Merge {gridSource.Sources.Count} people";

            gridControl1.DataSource = gridSource;
            // Remove grid columns from detail views or other non-data properties
            foreach (var gridColumn in gridView.Columns.ToList())
            {
                if (gridColumn.FieldName == nameof(Extensions.UIId) ||
                    gridColumn.FieldName == Person.IdColumn.Name ||
                    Person.Schema.Columns[gridColumn.FieldName]?.ReadOnly != false)
                {
                    gridView.Columns.Remove(gridColumn);
                }
            }
            gridView.BestFitColumns();
        }