示例#1
0
        public frmMovingsEdit(int?_nMovingID)
        {
            oMoving          = new Moving();
            oOwner           = new Partner();
            oGoodState       = new GoodState();
            oGoodStateNew    = new GoodState();
            oCellSource      = new Cell();
            oStoreZoneSource = new StoreZone();
            oCellTarget      = new Cell();
            oStoreZoneTarget = new StoreZone();
            if (oMoving.ErrorNumber != 0 ||
                oOwner.ErrorNumber != 0 ||
                oGoodState.ErrorNumber != 0 ||
                oGoodStateNew.ErrorNumber != 0 ||
                oCellSource.ErrorNumber != 0 ||
                oStoreZoneSource.ErrorNumber != 0 ||
                oCellTarget.ErrorNumber != 0 ||
                oStoreZoneTarget.ErrorNumber != 0)
            {
                IsValid = false;
            }
            if (IsValid)
            {
                InitializeComponent();

                if (_nMovingID.HasValue)
                {
                    nMovingID = (int)_nMovingID;
                }
                else
                {
                    nMovingID = 0;
                }
            }
        }
示例#2
0
        public frmTrafficsGoodsEdit()
        {
            oTraffic         = new TrafficGood();
            oCellSource      = new Cell();
            oStoreZoneSource = new StoreZone();
            oCellTarget      = new Cell();
            oStoreZoneTarget = new StoreZone();
            oUser            = new User();
            oDevice          = new Device();

            if (oTraffic.ErrorNumber != 0 ||
                oCellSource.ErrorNumber != 0 ||
                oStoreZoneSource.ErrorNumber != 0 ||
                oCellTarget.ErrorNumber != 0 ||
                oStoreZoneTarget.ErrorNumber != 0 ||
                oUser.ErrorNumber != 0 ||
                oDevice.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();
                oTraffic.ID = 0;
            }
        }
示例#3
0
        public frmTrafficsFramesManual(int?nFrameID)
        {
            oTraffic          = new TrafficFrame();
            oFrame            = new Frame();
            oCellSource       = new Cell();
            oBufferCellSource = new Cell();
            oStoreZoneSource  = new StoreZone();
            oCellTarget       = new Cell();
            oBufferCellTarget = new Cell();
            oStoreZoneTarget  = new StoreZone();

            if (oTraffic.ErrorNumber != 0 ||
                oFrame.ErrorNumber != 0 ||
                oCellSource.ErrorNumber != 0 ||
                oBufferCellSource.ErrorNumber != 0 ||
                oStoreZoneSource.ErrorNumber != 0 ||
                oCellTarget.ErrorNumber != 0 ||
                oBufferCellTarget.ErrorNumber != 0 ||
                oStoreZoneTarget.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();
                oFrame.ID = nFrameID;
            }
        }
        public frmOutputsGoodsConfirm(int?_ID)
        {
            oOutput      = new Output();
            oStoresZones = new StoreZone();
            oUsers       = new User();
            if (oOutput.ErrorNumber != 0 ||
                oStoresZones.ErrorNumber != 0 ||
                oUsers.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();

                if (_ID.HasValue)
                {
                    ID = (int)_ID;
                }

                dgvOutputGoodsShipment.ReadOnly = false;
                foreach (DataGridViewColumn c in dgvOutputGoodsShipment.Columns)
                {
                    c.ReadOnly = !(c.Name.Contains("Check") || c.Name.Contains("Confirmed"));
                }
            }
        }
示例#5
0
        private void btnStoresZonesChoose_Click(object sender, EventArgs e)
        {
            _SelectedIDList = null;
            _SelectedText   = "";

            StoreZone oStoreZone = new StoreZone();

            oStoreZone.FillData();
            if (oStoreZone.ErrorNumber != 0 || oStoreZone.MainTable == null)
            {
                RFMMessage.MessageBoxError("ќшибка при получении данных о зонах склада...");
                return;
            }
            if (oStoreZone.MainTable.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Ќет данных о зонах склада...");
                return;
            }

            if (StartForm(new frmSelectID(this, oStoreZone.MainTable, "Name", "«она склада", true)) == DialogResult.Yes)
            {
                if (_SelectedIDList == null || !_SelectedIDList.Contains(","))
                {
                    btnStoresZonesClear_Click(null, null);
                    return;
                }

                if (((RFMButton)sender).Name.Contains("Source"))
                {
                    sSelectedStoresZonesSourceIDList = "," + _SelectedIDList;

                    txtStoresZonesSourceChoosen.Text = _SelectedText;
                    ttToolTip.SetToolTip(txtStoresZonesSourceChoosen, txtStoresZonesSourceChoosen.Text);
                }
                if (((RFMButton)sender).Name.Contains("Target"))
                {
                    sSelectedStoresZonesTargetIDList = "," + _SelectedIDList;

                    txtStoresZonesTargetChoosen.Text = _SelectedText;
                    ttToolTip.SetToolTip(txtStoresZonesTargetChoosen, txtStoresZonesTargetChoosen.Text);
                }

                tabTrafficsFrames.IsNeedRestore = true;
                tabTrafficsGoods.IsNeedRestore  = true;
                tabInputsFrames.IsNeedRestore   = true;
            }

            _SelectedIDList = null;
            _SelectedText   = "";
        }
示例#6
0
        public frmCellsAddSpecial()
        {
            oCell      = new Cell();
            oStoreZone = new StoreZone();
            if (oCell.ErrorNumber != 0 ||
                oStoreZone.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();
            }
        }
示例#7
0
        public frmOutputsLoaders(int nOutputID)
        {
            oValidateUser = new User();
            oOutput       = new Output();
            oStoreZone    = new StoreZone();
            oUser         = new User();
            if (oValidateUser.ErrorNumber != 0 ||
                oOutput.ErrorNumber != 0 ||
                oStoreZone.ErrorNumber != 0 ||
                oUser.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();
                oOutput.ID = nOutputID;
            }
        }
        public frmCellsNewFrameCollect(int nCellID, DataTable _tCellContent)
        {
            oCellSource      = new Cell();
            oCellTarget      = new Cell();
            oStoreZoneTarget = new StoreZone();
            oFrame           = new Frame();
            if (oCellSource.ErrorNumber != 0 ||
                oCellTarget.ErrorNumber != 0 ||
                oStoreZoneTarget.ErrorNumber != 0 ||
                oFrame.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();

                oCellSource.ID = nCellID;
                tCellContent   = _tCellContent;
            }
        }
示例#9
0
        private void btnStoresZonesTypesChoose_Click(object sender, EventArgs e)
        {
            _SelectedIDList = null;
            _SelectedText   = "";

            StoreZone oStoreZone = new StoreZone();

            oStoreZone.FillTableStoresZonesTypes();
            if (oStoreZone.ErrorNumber != 0 || oStoreZone.TableStoresZonesTypes == null)
            {
                RFMMessage.MessageBoxError("ќшибка при получении данных о типах зон склада...");
                return;
            }
            if (oStoreZone.TableStoresZonesTypes.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Ќет данных о типах зон склада...");
                return;
            }

            if (StartForm(new frmSelectID(this, oStoreZone.TableStoresZonesTypes, "Name", "“ип скл.зоны", true)) == DialogResult.Yes)
            {
                if (_SelectedIDList == null || !_SelectedIDList.Contains(","))
                {
                    btnStoresZonesTypesClear_Click(null, null);
                    return;
                }

                sSelectedStoresZonesTypesIDList = "," + _SelectedIDList;

                txtStoresZonesTypesChoosen.Text = _SelectedText;
                ttToolTip.SetToolTip(txtStoresZonesTypesChoosen, txtStoresZonesTypesChoosen.Text);

                tabHistory.IsNeedRestore = true;
            }

            _SelectedIDList = null;
            _SelectedText   = "";
        }
示例#10
0
        public frmTrafficsGoodsManual(int?nTrafficOldID)
        {
            oTraffic         = new TrafficGood();
            oTrafficOld      = new TrafficGood();
            oCellSource      = new Cell();
            oStoreZoneSource = new StoreZone();
            oCellTarget      = new Cell();
            oStoreZoneTarget = new StoreZone();

            if (oTraffic.ErrorNumber != 0 ||
                oCellSource.ErrorNumber != 0 ||
                oStoreZoneSource.ErrorNumber != 0 ||
                oCellTarget.ErrorNumber != 0 ||
                oStoreZoneTarget.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                InitializeComponent();
                oTrafficOld.ID = nTrafficOldID;
            }
        }
示例#11
0
        private int ForLoad(bool bAgain)
        {
            oOutput.ClearError();

            // перемещения коробок/штук в расходе
            oOutput.FillTableOutputsTraffics(ID, false);
            if (oOutput.ErrorNumber != 0)
            {
                RFMMessage.MessageBoxError("Ошибка при получении данных о перемещениях коробок/штук для расхода...");
                return(0);
            }
            if (oOutput.TableOutputsTrafficsGoods.Rows.Count == 0)
            {
                if (!bAgain)
                {
                    RFMMessage.MessageBoxInfo("Для расхода не создано перемещений коробок/штук.\n\r" +
                                              "Нечего подтверждать...");
                }
                return(0);
            }

            // оставить в списке зон только те, которые есть среди перемещений
            cboStoresZones.Enabled = true;
            for (int i = oStoresZones.MainTable.Rows.Count - 1; i >= 0; i--)
            {
                DataView dv = new DataView(oOutput.TableOutputsTrafficsGoods);
                dv.RowFilter = "StoreZoneSourceID = " + oStoresZones.MainTable.Rows[i]["ID"].ToString();
                if (chkUnConfirmed.Checked)
                {
                    dv.RowFilter += " and IsConfirmed = false";
                }
                if (dv.Count == 0)
                {
                    oStoresZones.MainTable.Rows.Remove(oStoresZones.MainTable.Rows[i]);
                }
            }
            // добавить виртуальную зону для перемещений из Lost&Found
            Setting oSet = new Setting();

            sLostFoundAddress = oSet.FillVariable("sLostFoundAddress");
            if (sLostFoundAddress != null && sLostFoundAddress.Length > 0)
            {
                Cell oCellLostFound = new Cell();
                oCellLostFound.FilterAddress = sLostFoundAddress;
                oCellLostFound.FillData();
                if (oCellLostFound.MainTable.Rows.Count > 0)
                {
                    DataRow rclf = oCellLostFound.MainTable.Rows[0];
                    if (rclf != null)
                    {
                        nLostFoundID = (int)rclf["ID"];
                    }
                }
            }
            DataView dvlf = new DataView(oOutput.TableOutputsTrafficsGoods);

            dvlf.RowFilter = "CellSourceID = " + nLostFoundID.ToString();
            if (chkUnConfirmed.Checked)
            {
                dvlf.RowFilter += " and IsConfirmed = false";
            }
            if (dvlf.Count > 0)
            {
                // найдем эту зону и добавим ее в список
                StoreZone oStoreZoneVirtual = new StoreZone();
                oStoreZoneVirtual.FillData();
                foreach (DataRow sz in oStoreZoneVirtual.MainTable.Rows)
                {
                    if (Convert.ToBoolean(sz["Special"]))
                    {
                        sz["Name"] = "_неизвестен";
                        oStoresZones.MainTable.ImportRow(sz);
                    }
                }
            }

            /*
             * if (oStoresZones.MainTable.Rows.Count <= 1)
             * {
             *      cboStoresZones.Enabled = false;
             * }
             */

            btnSelect_Click(null, null);

            if (dgvOutputGoodsShipment.Rows.Count > 0)
            {
                // стать на первую строку, в ячейку "Коробок Факт"
                dgvOutputGoodsShipment.CurrentCell = dgvOutputGoodsShipment.Rows[0].Cells["dgrcBoxConfirmed"];
            }

            if (oStoresZones.MainTable.Rows.Count == 0)
            {
                if (!bAgain)
                {
                    RFMMessage.MessageBoxInfo("Для расхода нет неподтвержденных перемещений коробок/штук.\n\r" +
                                              "Нечего подтверждать...");
                }
            }

            return(oStoresZones.MainTable.Rows.Count);
        }