Esempio n. 1
0
        // Target

        private bool cboStoresZonesTarget_Restore()
        {
            oStoreZoneTarget.FillData();
            cboStoresZonesTarget.ValueMember   = oStoreZoneTarget.MainTable.Columns[0].Caption;
            cboStoresZonesTarget.DisplayMember = oStoreZoneTarget.MainTable.Columns[1].Caption;
            cboStoresZonesTarget.DataSource    = oStoreZoneTarget.MainTable;
            return(oStoreZoneTarget.ErrorNumber == 0);
        }
 private bool cboStoresZones_Restore()
 {
     oStoresZones.FilterStoreZoneTypeForPicking = true;
     oStoresZones.FillData();
     cboStoresZones.ValueMember   = oStoresZones.ColumnID;
     cboStoresZones.DisplayMember = oStoresZones.MainTable.Columns[("Name")].ToString();
     cboStoresZones.DataSource    = oStoresZones.MainTable;
     return(oStoresZones.ErrorNumber == 0);
 }
Esempio n. 3
0
 private bool cboStoresZonesBuffer_Restore()
 {
     oStoreZoneBuffer.FilterStoreZoneTypeShortCode = "BUF";
     oStoreZoneBuffer.FillData();
     cboStoresZonesBuffer.ValueMember   = oStoreZoneBuffer.MainTable.Columns[0].Caption;
     cboStoresZonesBuffer.DisplayMember = oStoreZoneBuffer.MainTable.Columns[1].Caption;
     cboStoresZonesBuffer.DataSource    = oStoreZoneBuffer.MainTable;
     return(oStoreZoneBuffer.ErrorNumber == 0);
 }
Esempio n. 4
0
        // Target

        private bool cboStoresZonesTarget_Restore()
        {
            oStoreZoneTarget.FilterStoreZoneTypeForFrames = false;
            oStoreZoneTarget.FillData();
            dtStoreZoneTarget = CopyTable(oStoreZoneTarget.MainTable, "dtStoreZoneTarget", "Special = false", "");
            cboStoresZonesTarget.ValueMember   = dtStoreZoneTarget.Columns[0].Caption;
            cboStoresZonesTarget.DisplayMember = dtStoreZoneTarget.Columns[1].Caption;
            cboStoresZonesTarget.DataSource    = dtStoreZoneTarget;
            return(oStoreZoneTarget.ErrorNumber == 0);
        }
Esempio n. 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   = "";
        }
Esempio n. 6
0
        private bool cboStoresZones_Restore()
        {
            oStoreZone.FilterStoreZoneTypeForStorage = true;
            oStoreZone.FillData();

            /*
             * DataTable dt = oStoreZone.MainTable.Copy();
             * oStoreZone.ClearFilters();
             * oStoreZone.FilterStoreZoneTypeShortCode = "PICK";
             * oStoreZone.FillData();
             * foreach (DataRow dr in dt.Rows)
             *      oStoreZone.MainTable.ImportRow(dr);
             * dt.Clear();
             */
            cboStoresZones.ValueMember   = oStoreZone.MainTable.Columns[0].Caption;
            cboStoresZones.DisplayMember = oStoreZone.MainTable.Columns[1].Caption;
            cboStoresZones.DataSource    = oStoreZone.MainTable;
            return(oStoreZone.ErrorNumber == 0);
        }
Esempio n. 7
0
        private void frmSelectOneCell_Load(object sender, EventArgs e)
        {
            if (useCheck)
            {
                Text = "¬ыберите несколько ¤чеек";
            }
            else
            {
                Text = "¬ыберите ¤чейку";
            }

            bool lResult = cboCBuilding_Restore() &&
                           cboCLine_Restore() &&
                           cboCLevel_Restore() &&
                           cboCRack_Restore() &&
                           cboCPlace_Restore();

            oStoreZone.FillData();
            oStoreZone.FillTableStoresZonesTypes();

            if (sStoresZonesList != null)
            {
                string sStoresZonesText = "";
                foreach (DataRow sz in oStoreZone.MainTable.Rows)
                {
                    if (((string)("," + sStoresZonesList + ",")).Contains("," + sz["ID"].ToString().Trim() + ","))
                    {
                        sStoresZonesText += ", " + sz["Name"].ToString();
                    }
                }
                if (sStoresZonesText.Substring(0, 1) == ",")
                {
                    sStoresZonesText = sStoresZonesText.Substring(2).Trim();
                }
                txtStoresZonesChoosen.Text = sStoresZonesText;
            }

            cntData.SplitterDistance = 0;
            cntData.Panel1MinSize    = 0;
            //lblTreeWait.Visible = false;
        }
Esempio n. 8
0
        private bool cboStoreZone_Restore()
        {
            oStoreZone.FilterStoreZoneTypeForPicking = true;
            oStoreZone.FillData();
            if (oStoreZone.ErrorNumber == 0 && oStoreZone.MainTable != null)
            {
                DataTable dtStoreZone = oStoreZone.MainTable;
                if (chkOutlayOnly.Checked)
                {
                    // оставить только те, что есть в расходе
                    oOutput.FillTableOutputsGoods((int)oOutput.ID);
                    if (oOutput.ErrorNumber == 0 && oOutput.TableOutputsGoods != null)
                    {
                        dtStoreZone = oStoreZone.MainTable.Clone();
                        foreach (DataRow rSZ in oStoreZone.MainTable.Rows)
                        {
                            int nTableStoreZoneID = Convert.ToInt32(rSZ["ID"]);
                            foreach (DataRow rOG in oOutput.TableOutputsGoods.Rows)
                            {
                                if (!Convert.IsDBNull(rOG["StoreZoneID"]))
                                {
                                    if (Convert.ToInt32(rOG["StoreZoneID"]) == nTableStoreZoneID)
                                    {
                                        dtStoreZone.ImportRow(rSZ);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                cboStoreZone.ValueMember   = oStoreZone.ColumnID;
                cboStoreZone.DisplayMember = oStoreZone.ColumnName;
                cboStoreZone.DataSource    = dtStoreZone;              //oStoreZone.MainTable;
            }
            return(oStoreZone.ErrorNumber == 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);
        }
Esempio n. 10
0
 private void uctZones_Restore()
 {
     oStoreZone.FillData();
     uctZones.Restore(oStoreZone.MainTable);
 }