public void ScreeningChanged(Screening screening) { if (dateEdit.DataBindings.Count > 0) { dateEdit.DataBindings[0].WriteValue(); } dateEdit.DataBindings.Clear(); if (screening.IsNotNull()) { dateEdit.DataBindings.Add(new Binding("EditValue", screening, "Date")); } else { dateEdit.EditValue = null; } if (checkEdit.DataBindings.Count > 0) { checkEdit.DataBindings[0].WriteValue(); } checkEdit.DataBindings.Clear(); if (screening.IsNotNull()) { checkEdit.Enabled = true; checkEdit.DataBindings.Add(new Binding("EditValue", screening, "Completed")); } else { checkEdit.EditValue = "N"; checkEdit.Enabled = false; } if (richTextBox.DataBindings.Count > 0) { richTextBox.DataBindings[0].WriteValue(); } richTextBox.DataBindings.Clear(); if (screening.IsNotNull()) { richTextBox.DataBindings.Add(new Binding("Text", screening, "Comment")); richTextBox.Enabled = true; } else { richTextBox.Text = string.Empty; richTextBox.Enabled = false; } }
public virtual void AcceptChanges(long id, string SessionId) { WorksheetContext ctx = Session.GetSessionData(SessionId, "WorksheetContext").CastToType <WorksheetContext>(); Screening screening = ctx.Screenings.FirstOrDefulatEntity(s => s.Id == id); if (screening.IsNotNull()) { screening.AcceptChanges(); } }
public virtual void Recalculate(long id, string SessionId) { WorksheetContext ctx = Session.GetSessionData(SessionId, "WorksheetContext").CastToType <WorksheetContext>(); Screening screening = ctx.Screenings.FirstOrDefulatEntity(s => s.Id == id); if (screening.IsNotNull()) { screening.ValueResult = (long.Parse(screening.ValueA) + long.Parse(screening.ValueB)).ToString(); } }
public void ScreeningChanged(Screening screening) { if (screening.IsNotNull()) { screening.WorksheetRows.AddPropertyDescriptor("C1", typeof(string)); gridControl.DataSource = screening.WorksheetRows; gridControl.Enabled = true; gridView.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; } else { gridControl.DataSource = null; gridControl.Enabled = false; gridView.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.None; } }
public virtual object Lock(long id, string SessionId) { WorksheetContext ctx = Session.GetSessionData(SessionId, "WorksheetContext").CastToType <WorksheetContext>(); Screening screening = ctx.Screenings.FirstOrDefulatEntity(s => s.Id == id); if (screening.IsNotNull()) { if (screening.IsFrozen) { WorksheetContext.UnFreeze(screening); } else { WorksheetContext.Freeze(screening); } } return(new { Id = id, Frozen = screening.IsFrozen }); }
public void ScreeningChanged(Screening screening) { foreach (XtraTabPage tp in xtraTabControl.TabPages) { ScreeningCtrl control = tp.Controls[0].CastToType <ScreeningCtrl>(); if (control.IsNotNull() && control.Id == screening.Id) { if (xtraTabControl.SelectedTabPage != tp) { this.xtraTabControl.SelectedPageChanged -= new DevExpress.XtraTab.TabPageChangedEventHandler(this.xtraTabControl_SelectedPageChanged); xtraTabControl.SelectedTabPage = tp; this.xtraTabControl.SelectedPageChanged += new DevExpress.XtraTab.TabPageChangedEventHandler(this.xtraTabControl_SelectedPageChanged); } break; } } Probe probe = gridView.GetFocusedRow() as Probe; if (probe.IsNotNull()) { GridView view = gridView.GetDetailView(gridView.FocusedRowHandle, 0) as GridView; if (view.IsNotNull()) { for (int i = 0; i < view.RowCount; i++) { Screening s = view.GetRow(i) as Screening; if (s.IsNotNull() && s.Id == screening.Id) { if (view.FocusedRowHandle != i) { view.FocusedRowChanged -= new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gridViewScreening_FocusedRowChanged); view.FocusedRowHandle = i; view.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gridViewScreening_FocusedRowChanged); } break; } } } } }
private void FocusProperProbe(Screening screening) { if (screening.IsNotNull()) { for (int i = 0; i < gridView.RowCount; i++) { Probe probe = gridView.GetRow(i) as Probe; if (probe.IsNotNull()) { if (probe.Id == screening.ProbeId) { if (gridView.FocusedRowHandle != i) { gridView.FocusedRowHandle = i; } break; } } } } }