public override PlotVM MakePlot(CuttingUnitVM cuttingUnit) { return new FixCNTPlot(this.DAL) { CuttingUnit = cuttingUnit, Stratum = this, PlotNumber = GetNextPlotNumber(cuttingUnit.CuttingUnit_CN.Value) }; }
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); }
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(); }
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); }
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) }; } }
public LoadCuttingUnitWorker(CuttingUnitVM unit) { Debug.Assert(unit != null); _unit = unit; }
public void ShowDataEntry(CuttingUnitVM unit) { throw new NotImplementedException(); }
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; } } }
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(); }
public DataEntryTests() { var cu = new CuttingUnitVM(); _de = new FormDataEntryLogic(cu, _controller, _view); }
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; } }
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(); }
public FormDataEntry(IApplicationController controller , CuttingUnitVM unit) { InitializeComponent(); InitializeCommon(controller, unit); }