Ejemplo n.º 1
0
        public bool Init(long containerId, ContainerFormTypeEnum formType, List<int> containerNumberList)
        {
            isInitializing = true;

            _containerNumberList = containerNumberList;
            _formType = formType;
            //Wczytywanie dancyh
            _ContainerBL = new ContainerBL();
            _ContainerBL.Init();
            if (formType == ContainerFormTypeEnum.New)
                _ContainerBL.AddNewRecord();
            else
                _ContainerBL.FillRecord(containerId);

            if (_ContainerBL.ContainerTypeBL.ContainerDataSet.ContainerType.Rows.Count == 0)
            {
                MessageBox.Show("Nie zdefioniowano żadnych pojemników.", "Operacje na zbiornikach nie są możliwe.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }

            BindControls();

            if (_formType == ContainerFormTypeEnum.Update)
            {
                //tbCurrentDistance.Maximum = _ContainerBL.MainRow.Capacity;
                //tbCurrencyHeigh.Maximum = _ContainerBL.MainRow.Capacity;
            }

            //aktywowanie odpowiednich kontrolek w zaleznosci od typu formatki
            switch (formType)
            {
                case ContainerFormTypeEnum.Edit:
                    InitContainerParameterControls(true);
                    InitContainerStateControls(false);
                    InitHistoryControls(false);
                    comboContainerType.Enabled = false;
                    break;
                case ContainerFormTypeEnum.New:
                    InitContainerParameterControls(true);
                    InitContainerStateControls(false);
                    InitHistoryControls(false);
                    break;
                case ContainerFormTypeEnum.Update:
                    InitContainerParameterControls(false);
                    InitContainerStateControls(true);
                    InitHistoryControls(true);
                    break;
                case ContainerFormTypeEnum.View:
                    InitContainerParameterControls(false);
                    InitContainerStateControls(false);
                    InitHistoryControls(false);
                    break;
            }

            _ContainerBL.ContainerDataSet.Container.ContainerRowChanged += new ContainerDataSet.ContainerRowChangeEventHandler(Container_ContainerRowChanged);

            return true;
        }
Ejemplo n.º 2
0
        public void Init()
        {
            _containerBL = new ContainerBL();
            _containerBL.Init();
            //_containerDataTable =
            gridContainer.DataSource = _containerBL.FillList();

            foreach (DataColumn dataColumn in _containerBL.ContainerDataSet.Container.Columns)
            {
                if (dataColumn == _containerBL.ContainerDataSet.Container.ContainerNameColumn || dataColumn == _containerBL.ContainerDataSet.Container.ContainerNumberColumn || dataColumn == _containerBL.ContainerDataSet.Container.eToMeasureColumn)
                    continue;

                gridContainer.InitColumnsAsInvisible(dataColumn);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Rozpoczęcie sczytywania stanów zbiorników przez COM
        /// </summary>
        public void Init()
        {
            _measurementBL = new MeasurementBL();
            _measurementBL.Init();

            _containerBL = new ContainerBL();
            _containerBL.Init();

            SystemConfigBL configBL = new SystemConfigBL();
            configBL.Init();
            configBL.FillRecord();

            _rs232 = new RS232();
            _rs232.ReadTimeOut = 1000;
            _rs232.DataReceivedEvent += new RS232.DataReceived(_rs232_DataReceivedEvent);
            _rs232.CanReadExisting = true;
            _rs232.Open(configBL.MainRow.ComName, 1200);
        }
Ejemplo n.º 4
0
        public void Init()
        {
            _ContainerBL = new ContainerBL();
            _ContainerBL.Init();
            _ContainerBL.FillList();

            gridContainer.DataSource = _ContainerBL.ContainerDataSet.Container;

            gridContainer.InitColumnsAsInvisible(
                _ContainerBL.ContainerDataSet.Container.eToMeasureColumn,
                _ContainerBL.ContainerDataSet.Container.IsCapacityGrowColumn,
                _ContainerBL.ContainerDataSet.Container.ContainerIdColumn,
                _ContainerBL.ContainerDataSet.Container.CapacityDeliveredColumn,
                _ContainerBL.ContainerDataSet.Container.CapacityDeliveredDateColumn,
                _ContainerBL.ContainerDataSet.Container.IsDeletedColumn,
                _ContainerBL.ContainerDataSet.Container.ContainerTypeColumn,
                _ContainerBL.ContainerDataSet.Container.MaxHeightColumn,
                _ContainerBL.ContainerDataSet.Container.MinHeightColumn
            );
        }
Ejemplo n.º 5
0
        public void AddMeasurements()
        {
            MeasurementBL measurementBL = new MeasurementBL();
            measurementBL.Init();

            ContainerBL containerBL = new ContainerBL();
            containerBL.Init();
            containerBL.FillList();

            //dodanie aktualnego
            measurementBL.AddNewMeasurement(MainRow.ContainerId, MainRow.CurrentHeight, MainRow.CurrentCapacity);
            //przepisanie reszty
            foreach (ContainerDataSet.ContainerRow containerRow in containerBL.ContainerDataSet.Container.Select())
            {
                if (containerRow.ContainerId != MainRow.ContainerId)
                    measurementBL.AddNewMeasurement(containerRow.ContainerId, containerRow.CurrentHeight, containerRow.CurrentCapacity);
            }

            measurementBL.Save();
        }
Ejemplo n.º 6
0
        public MainForm()
        {
            InitializeComponent();

            ContainerBL containerBL = new ContainerBL();
            containerBL.Init();
            //_containerDataTable = containerBL.FillList();

            gridMeasures.DataSource = new DataView(containerBL.ContainerDataSet.Container);
            //gridMeasures.DataSource = new DataView(_containerDataTable, "0=1", "", DataViewRowState.CurrentRows);

            //InitNewTransmission(false);

            foreach (DataColumn dataColumn in containerBL.ContainerDataSet.Container.Columns)
            {
                if (dataColumn == containerBL.ContainerDataSet.Container.ContainerNameColumn || dataColumn == containerBL.ContainerDataSet.Container.ContainerNumberColumn || dataColumn == containerBL.ContainerDataSet.Container.CurrentHeightColumn)
                    continue;

                gridMeasures.InitColumnsAsInvisible(dataColumn);
            }
        }
Ejemplo n.º 7
0
        private void InitNewTransmission()
        {
            _containerDataTable.Clear();

            ContainerBL containerBL = new ContainerBL();
            containerBL.Init();
            _containerDataTable = containerBL.FillList();

            gridMeasures.DataSource = new DataView(_containerDataTable, "0=1", "", DataViewRowState.CurrentRows);
        }