コード例 #1
0
 public override PlotVM MakePlot(CuttingUnitVM cuttingUnit)
 {
     return new FixCNTPlot(this.DAL)
     {
         CuttingUnit = cuttingUnit,
         Stratum = this,
         PlotNumber = GetNextPlotNumber(cuttingUnit.CuttingUnit_CN.Value)
     };
 }
コード例 #2
0
        public FormDataEntryLogic(CuttingUnitVM unit
            , IApplicationController controller
            , IDataEntryView view)
        {
            this.Unit = unit;
            this.Controller = controller;
            this.View = view;

            this.Unit.InitializeStrata();
            //this.Counts = this.Database.Read<CountTreeVM>((string)null);
        }
コード例 #3
0
 public void OnCuttingUnitsChanged()
 {
     if (this.Controller.CuttingUnits != null)
     {
         var units = new CuttingUnitVM[Controller.CuttingUnits.Count + 1];
         Controller.CuttingUnits.CopyTo(units, 1);
         units[0] = new CuttingUnitVM();
         this._BS_CuttingUnits.DataSource = units;
     }
     else
     {
         this._BS_CuttingUnits.DataSource = new CuttingUnitVM[0];
     }
     //this._cuttingUnitCB.Update();
 }
コード例 #4
0
        public FormDataEntry(IApplicationController controller
            , CuttingUnitVM unit)
        {
            InitializeComponent();

            if (ViewController.PlatformType == PlatformType.WM)
            {
                this.SIP = new Microsoft.WindowsCE.Forms.InputPanel();
                this.components.Add(SIP);
            }
            else if (ViewController.PlatformType == PlatformType.WinCE)
            {
                this.WindowState = FormWindowState.Maximized;
            }

            InitializeCommon(controller, unit);
        }
コード例 #5
0
 public virtual PlotVM MakePlot(CuttingUnitVM cuttingUnit)
 {
     if (this.Is3PPNT)
     {
         return new Plot3PPNT(this.DAL)
         {
             CuttingUnit = cuttingUnit,
             Stratum = this,
             PlotNumber = GetNextPlotNumber(cuttingUnit.CuttingUnit_CN.Value)
         };
     }
     else
     {
         return new PlotVM(this.DAL)
         {
             CuttingUnit = cuttingUnit,
             Stratum = this,
             PlotNumber = GetNextPlotNumber(cuttingUnit.CuttingUnit_CN.Value)
         };
     }
 }
コード例 #6
0
        public LoadCuttingUnitWorker(CuttingUnitVM unit)
        {
            Debug.Assert(unit != null);

            _unit = unit;
        }
コード例 #7
0
 public void ShowDataEntry(CuttingUnitVM unit)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
        public void ShowDataEntry(CuttingUnitVM unit)
        {
            lock (_dataEntrySyncLock)
            {
                try
                {
                    using (_dataEntryView = new FormDataEntry(this.ApplicationController, unit))
                    {
            #if !NetCF
                        _dataEntryView.Owner = MainView;
            #endif
                        _dataEntryView.ShowDialog();
                    }
                }
                catch (UserFacingException e)
                {
                    var exType = e.GetType();

                    MessageBox.Show(e.Message, exType.Name);
                }
                finally
                {
                    _dataEntryView = null;
                }
            }
        }
コード例 #9
0
        protected void InitializeCommon(IApplicationController controller
            , CuttingUnitVM unit)
        {
            KeyPreview = true;

            Controller = controller;
            LogicController = new FormDataEntryLogic(unit, Controller, this);

            // Set the form title (Text) with current cutting unit and description.
            this.Text = this.LogicController.GetViewTitle();

            InitializePageContainer();
        }
コード例 #10
0
        public DataEntryTests()
        {
            var cu = new CuttingUnitVM();

            _de = new FormDataEntryLogic(cu, _controller, _view);
        }
コード例 #11
0
 void UpdateCuttingUnits()
 {
     if (this.Controller.CuttingUnits != null)
     {
         var units = new CuttingUnitVM[Controller.CuttingUnits.Count + 1];
         Controller.CuttingUnits.CopyTo(units, 1);
         units[0] = new CuttingUnitVM();
         this._BS_cuttingUnits.DataSource = units;
         this._cuttingUnitCB.Enabled = true;
     }
     else
     {
         this._BS_cuttingUnits.DataSource = new CuttingUnitVM[0];
         this._cuttingUnitCB.Enabled = false;
     }
 }
コード例 #12
0
        private void LoadCuttingUnitInfo(CuttingUnitVM unit)
        {
            _strataView.SuspendLayout();
            _strataView.Controls.Clear();
            this._dataEntryMI.Enabled = (unit != null);
            if (unit != null)
            {
                var strata = unit.DAL.From<StratumDO>()
                    .Join("CuttingUnitStratum", "USING (Stratum_CN)", "CUST")
                    .Where("CUST.CuttingUnit_CN = ?")
                    .Query(unit.CuttingUnit_CN);

                foreach (StratumDO st in strata)
                {
                    Label stLBL = new Label();
                    stLBL.Text = st.GetDescriptionShort();
                    if (_fontHeight == 0)
                    {
                        using (Graphics g = base.CreateGraphics())
                        {
                            SizeF s = g.MeasureString(" ", stLBL.Font);
                            _fontHeight = (int)Math.Ceiling(s.Height);
                        }
                    }

                    stLBL.Dock = DockStyle.Top;
                    stLBL.Height = _fontHeight;
                    _strataView.Controls.Add(stLBL);
                }
            }
            _strataView.ResumeLayout();
        }
コード例 #13
0
 public FormDataEntry(IApplicationController controller
     , CuttingUnitVM unit)
 {
     InitializeComponent();
     InitializeCommon(controller, unit);
 }