コード例 #1
0
ファイル: StatusCtrl.cs プロジェクト: gkudel/mvc-for-net
        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;
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
ファイル: WorksheetCtrl.cs プロジェクト: gkudel/mvc-for-net
 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;
     }
 }
コード例 #5
0
        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 });
        }
コード例 #6
0
ファイル: WorksheetForm.cs プロジェクト: gkudel/mvc-for-net
        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;
                        }
                    }
                }
            }
        }
コード例 #7
0
ファイル: WorksheetForm.cs プロジェクト: gkudel/mvc-for-net
 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;
                 }
             }
         }
     }
 }