private void numFramesCnt_ValueChanged(object sender, EventArgs e)
        {
            if (dt == null || grdData.DataSource == null || grdData.Rows.Count == 0)
            {
                return;
            }

            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            bMarkingByCnt = true;

            if (numFramesCnt.Value > grdData.Rows.Count)
            {
                numFramesCnt.Value = grdData.Rows.Count;
            }

            decimal nBoxQnt = 0;

            if (!bMarkingByCheck)
            {
                grdData.MarkAllRows(false);
                for (int i = 0; i <= numFramesCnt.Value - 1; i++)
                {
                    dt.Rows[i]["IsMarked"] = true;
                    nBoxQnt += Convert.ToDecimal(dt.Rows[i]["BoxQnt"]);
                }
                lblBoxQnt.Text = ((decimal)(Math.Ceiling(nBoxQnt))).ToString("#########0").Trim() + " кор.";
            }

            bMarkingByCnt = false;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);
        }
Exemplo n.º 2
0
        private bool grdOutputsDocuments_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oOutputDocumentCur.ClearOne();

            oOutputDocumentList.ClearError();
            oOutputDocumentList.ClearFilters();
            oOutputDocumentList.ID     = null;
            oOutputDocumentList.IDList = null;

            grdOutputsDocuments.GetGridState();

            grdOutputsDocumentsGoods.DataSource = null;

            oTrip.FillTableOutputsDocumentsInTrip(chkOutputsShowCarried.Checked);
            grdOutputsDocuments.IsLockRowChanged = true;
            grdOutputsDocuments.Restore(oTrip.TableOutputsDocumentsInTrip);

            tmrRestore.Enabled = true;

            RecalcSumOutputsDocuments();
            ShowTotalInfo("OUTPUTSDOCUMENTS");

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oTrip.ErrorNumber == 0);
        }
        private bool grdDetailEnd_Restore()
        {
            grdDetailEnd.GetGridState();
            grdDetailEnd.DataSource = null;
            if (grdData.Rows.Count == 0 ||
                oCellContentSnapshotCur.ID == null ||
                grdData.CurrentRow != null && grdData.IsStatusRow(grdData.CurrentRow.Index))
            {
                return(true);
            }

            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oCellContentSnapshotList.ClearError();
            oCellContentSnapshotList.FillTableCellsContentsSnapshotsDetails((int)oCellContentSnapshotCur.ID, 1,
                                                                            false, false,
                                                                            false, chkInInventoryOnly.Checked);
            DataTable tableCellContentSnapshotsDetailsEnd = oCellContentSnapshotList.TableCellsContentsSnapshotsDetails;

            grdDetailEnd.Restore(tableCellContentSnapshotsDetailsEnd);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);
            return(oCellContentSnapshotList.ErrorNumber == 0);
        }
Exemplo n.º 4
0
        private void CheckAll(bool isChecked)
        {
            if (dgvOutputGoodsShipment.Rows.Count == 0)
            {
                return;
            }

            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            if (dgvOutputGoodsShipment.CurrentCell.ColumnIndex == dgrcCheck.Index)
            {
                dgvOutputGoodsShipment.CurrentCell = dgvOutputGoodsShipment.Rows[dgvOutputGoodsShipment.CurrentRow.Index].Cells[dgrcCheck.Index + 1];
            }

            for (int i = 0; i < tTable.Rows.Count; i++)
            {
                tTable.Rows[i]["Checked"] = isChecked;
            }

            for (int i = 0; i < dgvOutputGoodsShipment.RowCount; i++)
            {
                dgvOutputGoodsShipment.Rows[i].Cells["dgrcCheck"].Value = isChecked;
            }
            dgvOutputGoodsShipment.Refresh();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
        private void btnMinus_Click(object sender, EventArgs e)
        {
            RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

            int currId     = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"],
                firstIndex = grdTrips.FirstDisplayedScrollingRowIndex;

            nudDelta.Value = 1;

            MoveGroup(true);

            grdTrips.CurrentCell = grdTrips.Rows[grdTrips.GridSource.Find("ID", currId)].Cells["grcByOrder"];
            if (grdTrips.CurrentRow.Index < firstIndex)
            {
                grdTrips.FirstDisplayedScrollingRowIndex = grdTrips.CurrentRow.Index;
            }
            else
            {
                grdTrips.FirstDisplayedScrollingRowIndex = firstIndex;
            }

            SetButtonStatus();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
        private bool grdData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            grdData.GetGridState();

            string sSelectedHostsIDList = "";

            if (ucSelectRecordID_Hosts.IsSelectedExist)
            {
                sSelectedHostsIDList = ucSelectRecordID_Hosts.GetIdString();
            }


            if (oCCS.FillTablePrepareInventoryAct(this.snapshotID,
                                                  sSelectedHostsIDList, sSelectedGoodsStatesIDList, sSelectedPackingsIDList))
            {
                grdData.Restore(oCCS.TablePrepareInventoryAct);
            }

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oCCS.ErrorNumber == 0);
        }
        private void btnMax_Click(object sender, EventArgs e)
        {
            int currId    = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"],
                dispCount = grdTrips.DisplayedRowCount(false),
                currIndex = grdTrips.CurrentRow.Index;

            int nextIndex = grdTrips.Rows.Count;
            int maxIndex  = (int)((DataTable)grdTrips.GridSource.DataSource).Compute("Max(ByOrder)", String.Empty) + 1;

            if (maxIndex > nextIndex)
            {
                nextIndex = maxIndex;
            }

            int stepsQnt = nextIndex - currIndex;

            if (stepsQnt > 0)
            {
                nudDelta.Value = stepsQnt;
                RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

                MoveGroup(false);

                grdTrips.CurrentCell = grdTrips.Rows[grdTrips.GridSource.Find("ID", currId)].Cells["grcByOrder"];
                int nIndex = grdTrips.CurrentRow.Index - dispCount + 1;
                if (nIndex >= 0)
                {
                    grdTrips.FirstDisplayedScrollingRowIndex = nIndex;
                }

                SetButtonStatus();

                RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            }
        }
        private void btnMin_Click(object sender, EventArgs e)
        {
            int currId    = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"],
                currIndex = grdTrips.CurrentRow.Index;
            int nextIndex = 0;

            int curIndex = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ByOrder"];

            if (curIndex > currIndex)
            {
                currIndex = curIndex;
            }

            int stepsQnt = currIndex - nextIndex;

            if (stepsQnt > 0)
            {
                nudDelta.Value = stepsQnt;
                RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

                MoveGroup(true);

                grdTrips.CurrentCell = grdTrips.Rows[grdTrips.GridSource.Find("ID", currId)].Cells["grcByORder"];
                grdTrips.FirstDisplayedScrollingRowIndex = grdTrips.CurrentRow.Index;

                SetButtonStatus();

                RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            }
        }
Exemplo n.º 9
0
        private void btnAddressContextMark_Click(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            if (txtAddress.Text.Trim().Length > 0 && dgvCells.Rows.Count > 0)
            {
                string sAddress   = txtAddress.Text.Trim().ToUpper();
                string sCellsList = "";
                foreach (DataRow r in oCell.MainTable.Rows)
                {
                    if (r["Address"].ToString().ToUpper().Contains(sAddress))
                    {
                        sCellsList += r["ID"].ToString() + ",";
                    }
                }
                if (sCellsList.Length > 0)
                {
                    sCellsList = RFMUtilities.NormalizeList(sCellsList);
                    dgvCells.MarkFromList(sCellsList);
                }
            }
            dgvCells.Refresh();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);
        }
Exemplo n.º 10
0
        private bool grdPrintForms_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);
            oPartnerRootCur.ClearOne();

            oPrintFormList.ClearError();
            oPrintFormList.ClearFilters();
            oPrintFormList.ID = null;

            // собираем условия
            grdPrintForms_Partners.DataSource = null;

            grdPrintForms.GetGridState();

            oPrintFormList.FillData();
            grdPrintForms.IsLockRowChanged = true;
            grdPrintForms.Restore(oPrintFormList.MainTable);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oPrintFormList.ErrorNumber == 0);
        }
Exemplo n.º 11
0
        private bool dgvCarsTasks_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oCarTaskCur.ClearOne();

            oCarTaskList.ClearError();
            oCarTaskList.ClearFilters();
            oCarTaskList.ID     = null;
            oCarTaskList.IDList = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oCarTaskList.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oCarTaskList.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }

            // владельцы
            oCarTaskList.FilterPartnersList = ucSelectRecordID_Owners.GetIdString();

            // акт привязан к рейсу
            if (optTripExistsNot.Checked)
            {
                oCarTaskList.FilterTripExists = false;
            }
            if (optTripExists.Checked)
            {
                oCarTaskList.FilterTripExists = true;
            }

            // состояние задания: подтверждение
            if (optIsConfirmedNot.Checked)
            {
                oCarTaskList.FilterIsConfirmed = false;
            }
            if (optIsConfirmed.Checked)
            {
                oCarTaskList.FilterIsConfirmed = true;
            }
            //

            dgvCarsTasks.GetGridState();
            oCarTaskList.FillData();
            dgvCarsTasks.IsLockRowChanged = true;
            dgvCarsTasks.Restore(oCarTaskList.MainTable);

            tmrRestore.Enabled = true;
            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oCarTaskList.ErrorNumber == 0);
        }
Exemplo n.º 12
0
        private bool grdData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            tableShifts.Clear();

            // Получение количества смен в день
            int nShiftsPerDay = (chkIfShift3Exits.Checked ? 3 : 2);

            int[] aShiftsDuration = new int[nShiftsPerDay];
            aShiftsDuration[0] = (int)numShift1Hours.Value;
            aShiftsDuration[1] = (int)numShift2Hours.Value;
            if (nShiftsPerDay == 3)
            {
                aShiftsDuration[2] = (int)numShift3Hours.Value;
            }

            DateTime dDateBeg, dDateEnd;
            bool     bIsNight;
            int      nShiftsCount = 0;

            // Погнали заполнять таблицу
            dDateBeg = dtpDateBeg.Value;
            while (true)
            {
                dDateEnd = dDateBeg.AddHours(aShiftsDuration[nShiftsCount % nShiftsPerDay]);
                bIsNight = ((dDateBeg.Day != dDateEnd.Day || dDateBeg.Hour >= 20) ? true : false);

                // Заполнение строки данных
                DataRow r = tableShifts.NewRow();
                r["ID"]        = nShiftsCount;
                r["DateBeg"]   = dDateBeg;
                r["DateEnd"]   = dDateEnd;
                r["MajorName"] = "";
                r["IsNight"]   = bIsNight;
                r["Note"]      = "";
                tableShifts.Rows.Add(r);

                // Проверка на окончание цикла
                if (dDateEnd >= dtpDateEnd.Value)
                {
                    break;
                }

                dDateBeg = dDateEnd;
                nShiftsCount++;
            }

            grdData.GetGridState();

            grdData.Restore(tableShifts);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(true);
        }
Exemplo n.º 13
0
        private bool grdData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oFactureCur.ClearOne();

            oFactureList.ClearError();
            oFactureList.ClearFilters();
            oFactureList.ID     = null;
            oFactureList.IDList = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oFactureList.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oFactureList.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }

            // номер контекст
            if (txtFactureNumberContext.Text.Trim().Length > 0)
            {
                oFactureList.FilterNumberContext = txtFactureNumberContext.Text.Trim();
            }

            // партнеры
            if (sSelectedPartnersSourceIDList.Length > 0)
            {
                oFactureList.FilterPartnersSourceList = sSelectedPartnersSourceIDList;
            }
            if (sSelectedPartnersTargetIDList.Length > 0)
            {
                oFactureList.FilterPartnersTargetList = sSelectedPartnersTargetIDList;
            }

            // коды заказов на отгрузку

            //

            grdData.GetGridState();

            oFactureList.FillData();
            grdData.IsLockRowChanged = true;
            grdData.Restore(oFactureList.MainTable);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oFactureList.ErrorNumber == 0);
        }
Exemplo n.º 14
0
        private bool grdWayBills_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oWayBillCur.ClearOne();

            oWayBillList.ClearError();
            oWayBillList.ClearFilters();
            oWayBillList.ID     = null;
            oWayBillList.IDList = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oWayBillList.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oWayBillList.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }

            // закрыт?
            if (optIsConfirmed.Checked)
            {
                oWayBillList.FilterIsConfirmed = true;
            }
            if (optIsConfirmedNot.Checked)
            {
                oWayBillList.FilterIsConfirmed = false;
            }

            // типы машин, машины, водители
            oWayBillList.FilterCarsList             = ucSelectRecordID_Cars.GetIdString();
            oWayBillList.FilterCarsTypesList        = ucSelectRecordID_CarsTypes.GetIdString();
            oWayBillList.FilterDriversEmployeesList = ucSelectRecordID_Drivers.GetIdString();
            //

            grdWayBills_Trips.DataSource    = null;
            grdWayBills_Fillings.DataSource = null;

            grdWayBills.GetGridState();
            oWayBillList.FillData();
            grdWayBills.IsLockRowChanged = true;
            grdWayBills.Restore(oWayBillList.MainTable);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oWayBillList.ErrorNumber == 0);
        }
Exemplo n.º 15
0
        private bool grdData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oShift.ID = null;

            oShift.ClearError();
            oShift.ClearFilters();
            oShift.ID     = null;
            oShift.IDList = null;

            // собираем условия
            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oShift.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oShift.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }
            // старшие смен
            if (ucSelectRecordID_Majors.IsSelectedExist)
            {
                oShift.FilterMajorsList = ucSelectRecordID_Majors.GetIdString();
            }
            // смены
            if (optAll.Checked)
            {
                oShift.FilterIsNight = null;
            }
            else if (optNight.Checked)
            {
                oShift.FilterIsNight = true;
            }
            else if (optDay.Checked)
            {
                oShift.FilterIsNight = false;
            }


            grdData.GetGridState();

            oShift.FillData();
            grdData.Restore(oShift.MainTable);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oShift.ErrorNumber == 0);
        }
Exemplo n.º 16
0
        private bool grdPartnersRoots_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oPartnerRootCur.ClearOne();

            oPartnerRootList.ClearError();
            oPartnerRootList.ClearFilters();
            oPartnerRootList.ID     = null;
            oPartnerRootList.IDList = null;

            // собираем условия

            // контексты
            if (txtNameContext.Text.Trim().Length > 0)
            {
                oPartnerRootList.FilterNameContext = txtNameContext.Text.Trim().ToUpper();
            }
            if (txtInnContext.Text.Trim().Length > 0)
            {
                oPartnerRootList.FilterInnContext = txtInnContext.Text.Trim().ToUpper();
            }

            // выбор
            oPartnerRootList.FilterPartnersRootsList = ucSelectRecordID_PartnersRoots.GetIdString();

            // checks
            if (optActual.Checked)
            {
                oPartnerRootList.FilterActual = true;
            }
            if (optActualNot.Checked)
            {
                oPartnerRootList.FilterActual = false;
            }
            //

            grdPartnersRoots_Partners.DataSource = null;

            grdPartnersRoots.GetGridState();

            oPartnerRootList.FillTablePartnersRoots();
            grdPartnersRoots.IsLockRowChanged = true;
            grdPartnersRoots.Restore(oPartnerRootList.TablePartnersRoots);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oPartnerRootList.ErrorNumber == 0);
        }
Exemplo n.º 17
0
        private void ReOrderAll()
        {
            RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

            int currId = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"];

            RFMBindingSource bs = grdTrips.GridSource;
            int curId           = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"];

            UpdateGroupIndex(ref bs, "", 1);
            grdTrips.CurrentCell = grdTrips.Rows[bs.Find("ID", curId)].Cells["grcByOrder"];
            grdTrips.Refresh();

            grdTrips.CurrentCell = grdTrips.Rows[grdTrips.GridSource.Find("ID", currId)].Cells["grcByOrder"];

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
Exemplo n.º 18
0
        private void btnByTime_Click(object sender, EventArgs e)
        {
            // расставить по времени выезда
            if (RFMMessage.MessageBoxYesNo("Изменить порядок выхода машин в соответствии с указанным планируемым временем выхода?") != DialogResult.Yes)
            {
                return;
            }

            RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

            RFMBindingSource bs = grdTrips.GridSource;

            bs.Sort = "TimeBeg, Alias";

            int         nByOrder = 0;
            string      sTime    = "00:00";
            DataRowView drv;

            bs.MoveFirst();
            for (int i = 0; i < bs.Count; i++)
            {
                drv = (DataRowView)bs.Current;

                /*if (drv["TimeBeg"].ToString().Trim().Length <= 1 || drv["TimeBeg"].ToString() == "00:00")
                 *      nByOrder = 0;
                 * else
                 * {
                 *      //if (sTime != drv["TimeBeg"].ToString().Trim())
                 *      nByOrder++;
                 * }*/
                nByOrder++;
                drv["ByOrder"] = nByOrder;

                sTime = drv["TimeBeg"].ToString().Trim();
                bs.MoveNext();
            }

            grdTrips.Invalidate();

            bs.Sort = "ByOrder";

            SetButtonStatus();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
Exemplo n.º 19
0
        private bool Grids_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            // Собираем условия
            string sMode       = (optPicking.Checked ? "P" : "L");
            string sOwnersList = (ucSelectRecordID_Owners.IsSelectedExist ? ucSelectRecordID_Owners.GetIdString() : null);
            bool?  bWeightingGoods;

            if (optWeighting.Checked)
            {
                bWeightingGoods = true;
            }
            else if (optNonWeighting.Checked)
            {
                bWeightingGoods = false;
            }
            else
            {
                bWeightingGoods = null;
            }

            // Вызываем отчет
            Report oReport = new Report();

            oReport.ReportShiftsProductivity(sMode, dtpDateBeg.Value, dtpDateEnd.Value, sOwnersList, bWeightingGoods);

            // Обновляем таблицы
            if (oReport.ErrorNumber == 0)
            {
                dgvMajors.Restore(oReport.DS.Tables[0]);
                dgvUsers.Restore(oReport.DS.Tables[1]);
            }
            else
            {
                dgvMajors.Restore(null);
                dgvUsers.Restore(null);
            }

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(true);
        }
Exemplo n.º 20
0
        private void btnPgUp_Click(object sender, EventArgs e)
        {
            int currId    = (int)((DataRowView)grdTrips.CurrentRow.DataBoundItem)["ID"],
                dispCount = grdTrips.DisplayedRowCount(false),
                currIndex = grdTrips.CurrentRow.Index;
            int nextIndex;

            if (currIndex == grdTrips.FirstDisplayedScrollingRowIndex)
            {
                nextIndex = currIndex - dispCount + 1;
            }
            else
            {
                nextIndex = grdTrips.FirstDisplayedScrollingRowIndex;
            }

            int minIndex = (int)grdTrips.Rows[grdTrips.FirstDisplayedScrollingRowIndex].Cells["grcByOrder"].Value;

            if (minIndex < nextIndex)
            {
                nextIndex = minIndex;
            }

            if (nextIndex < 1)
            {
                nextIndex = 0;
            }
            int stepsQnt = currIndex - nextIndex;

            if (stepsQnt > 0)
            {
                nudDelta.Value = stepsQnt;
                RFMCursorWait.LockWindowUpdate(grdTrips.Handle);

                MoveGroup(true);

                grdTrips.CurrentCell = grdTrips.Rows[grdTrips.GridSource.Find("ID", currId)].Cells["grcByOrder"];
                grdTrips.FirstDisplayedScrollingRowIndex = grdTrips.CurrentRow.Index;

                SetButtonStatus();

                RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            }
        }
Exemplo n.º 21
0
        private bool grdCarsTypes_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oCarTypeCur.ClearOne();

            oCarTypeList.ClearError();
            oCarTypeList.ClearFilters();
            oCarTypeList.ID     = null;
            oCarTypeList.IDList = null;

            // собираем условия
            // выбор из списков
            if (ucSelectRecordID_CarsTypes.IsSelectedExist)
            {
                oCarTypeList.IDList = ucSelectRecordID_CarsTypes.GetIdString();
            }

            // актуальность
            if (optActual.Checked)
            {
                oCarTypeList.FilterActual = true;
            }
            if (optActualNot.Checked)
            {
                oCarTypeList.FilterActual = false;
            }

            grdCarsTypes_Cars.DataSource = null;

            grdCarsTypes.GetGridState();

            oCarTypeList.FillData();
            grdCarsTypes.IsLockRowChanged = true;
            grdCarsTypes.Restore(oCarTypeList.MainTable);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oCarTypeList.ErrorNumber == 0);
        }
Exemplo n.º 22
0
        private void dgvOutputGoodsShipment_CellValidated(object sender, DataGridViewCellEventArgs e)
        {
            if (!bLoaded)
            {
                return;
            }

            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            DataGridViewRow r = dgvOutputGoodsShipment.Rows[e.RowIndex];

            if (dgvOutputGoodsShipment.Columns[e.ColumnIndex].Name == "dgrcQntConfirmed")
            {
                if (r.Cells["dgrcQntConfirmed"].Value == DBNull.Value)
                {
                    r.Cells["dgrcQntConfirmed"].Value = 0;
                }
                if (!(bool)r.Cells["dgrcWeighting"].Value &&
                    ((decimal)r.Cells["dgrcQntConfirmed"].Value > (decimal)r.Cells["dgrcQntWished"].Value))
                {
                    RFMMessage.MessageBoxError("Введено число больше допустимого!");
                    r.Cells["dgrcQntConfirmed"].Value = (decimal)r.Cells["dgrcQntWished"].Value;
                }
            }

            if (dgvOutputGoodsShipment.Columns[e.ColumnIndex].Name == "dgrcBoxConfirmed")
            {
                if (r.Cells["dgrcBoxConfirmed"].Value == DBNull.Value)
                {
                    r.Cells["dgrcBoxConfirmed"].Value = 0;
                }
                if (!(bool)r.Cells["dgrcWeighting"].Value &&
                    ((decimal)r.Cells["dgrcBoxConfirmed"].Value > (decimal)r.Cells["dgrcBoxWished"].Value))
                {
                    RFMMessage.MessageBoxError("Введено число больше допустимого!");
                    r.Cells["dgrcBoxConfirmed"].Value = (decimal)r.Cells["dgrcBoxWished"].Value;
                }
            }
            ShowStrikes();
            dgvOutputGoodsShipment.Refresh();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
Exemplo n.º 23
0
        private bool dgvOuputsShipment_Restore()
        {
            RFMCursorWait.LockWindowUpdate(dgvOutputGoodsShipment.Handle);

            /*
             * oTrafficsGoods.FilterOutputsList = ID.ToString();
             * if (cboStoresZones.SelectedValue != null)
             * {
             *      oTrafficsGoods.FilterStoresZonesSourceList = cboStoresZones.SelectedValue.ToString();
             * }
             * oTrafficsGoods.FillData();
             * oTrafficsGoods.MainTable.PrimaryKey = new DataColumn[] { oTrafficsGoods.MainTable.Columns["TrafficID"] };
             * dgvOutputGoodsShipment.DataSource = oTrafficsGoods.MainTable;
             */

            dgvOutputGoodsShipment.DataSource = null;
            tTable = null;
            oOutput.ClearError();

            if (cboStoresZones.SelectedValue != null)
            {
                DataView dvz = new DataView(oOutput.TableOutputsTrafficsGoods);
                dvz.RowFilter     = "StoreZoneSourceID = " + cboStoresZones.SelectedValue.ToString();
                tTable            = dvz.ToTable();
                tTable.PrimaryKey = new DataColumn[] { tTable.Columns["ID"] };
            }
            else
            {
                tTable = oOutput.TableOutputsTrafficsGoods;
            }

            dgvOutputGoodsShipment.GridSource = new RFMBindingSource(tTable);
            if (chkUnConfirmed.Checked)
            {
                dgvOutputGoodsShipment.GridSource.Filter = "IsConfirmed = false";
            }
            dgvOutputGoodsShipment.Restore(dgvOutputGoodsShipment.GridSource);

            ShowStrikes();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            return(oOutput.ErrorNumber == 0);
        }
Exemplo n.º 24
0
        private bool grdFillings_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oFillingCur.ClearOne();

            oFillingList.ClearError();
            oFillingList.ClearFilters();
            oFillingList.ID     = null;
            oFillingList.IDList = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oFillingList.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oFillingList.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }

            // машины, типы, водители
            oFillingList.FilterCarsList             = ucSelectRecordID_Cars.GetIdString();
            oFillingList.FilterCarsTypesList        = ucSelectRecordID_CarsTypes.GetIdString();
            oFillingList.FilterDriversEmployeesList = ucSelectRecordID_Drivers.GetIdString();
            // типы заправок, типы топлива
            oFillingList.FilterFillingsTypesList = ucSelectRecordID_FillingsTypes.GetIdString();
            oFillingList.FilterFuelTypesList     = ucSelectRecordID_FuelTypes.GetIdString();
            //

            grdFillings.GetGridState();
            oFillingList.FillData();
            grdFillings.IsLockRowChanged = true;
            grdFillings.Restore(oFillingList.MainTable);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oFillingList.ErrorNumber == 0);
        }
Exemplo n.º 25
0
        private void btnClearTerms_Click(object sender, EventArgs e)
        {
            RFMCursorWait.LockWindowUpdate(Handle);

            dtrDates.dtpBegDate.Value = DateTime.Now.Date;
            dtrDates.dtpEndDate.Value = DateTime.Now.Date;

            optDeliveryNeed.Checked = true;

            txtPartnerSourceNameContext.Text = "";
            ucSelectRecordID_PartnersSource.ClearData();

            txtPartnerTargetNameContext.Text = "";
            ucSelectRecordID_PartnersTarget.ClearData();

            ucSelectRecordID_Owners.ClearData();

            optOutputExistsAll.Checked = true;

            optOutputsDocumentsIsConfirmedAll.Checked = true;
            optOutputsDocumentsIsBroughtAll.Checked   = true;

            optTripExistsAll.Checked = true;
            numTripID.Value          = 0;
            txtTripAliasContext.Text = "";

            ucSelectRecordID_Hosts.ClearData();

            btnPackingsClear_Click(null, null);

            if (Control.ModifierKeys == Keys.Shift)
            {
                dtrDates.dtpBegDate.HideControl(false);
                dtrDates.dtpEndDate.HideControl(false);
            }

            SetStartTerms();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);

            tabOutputsDocuments.IsNeedRestore = true;
        }
Exemplo n.º 26
0
        private bool dgvExtraWorks_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oSalaryExtraWorkList.ClearError();
            oSalaryExtraWorkList.ClearFilters();
            oSalaryExtraWorkList.ID = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oSalaryExtraWorkList.FilterDateBeg = dtrDates.dtpBegDate.Value.Date;
            }
            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oSalaryExtraWorkList.FilterDateEnd = dtrDates.dtpEndDate.Value.Date;
            }

            if (ucSelectRecordID_DriversEmployees.IsSelectedExist)
            {
                oSalaryExtraWorkList.FilterDriversEmployeesList = ucSelectRecordID_DriversEmployees.GetIdString();
            }

            if (txtWorkName.Text.Trim().Length > 0)
            {
                oSalaryExtraWorkList.FilterWorkNameContext = txtWorkName.Text.Trim();
            }

            dgvExtraWorks.GetGridState();
            oSalaryExtraWorkList.FillTableSalaryExtraWorks();
            dgvExtraWorks.IsLockRowChanged = true;
            dgvExtraWorks.Restore(oSalaryExtraWorkList.TableSalaryExtraWorks);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oSalaryExtraWorkList.ErrorNumber == 0);
        }
Exemplo n.º 27
0
        private void CheckAll(bool isChecked)
        {
            if (dgvOutputFramesShipment.Rows.Count == 0)
            {
                return;
            }

            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            foreach (DataGridViewRow rg in dgvOutputFramesShipment.Rows)
            {
                DataRow r = oOutput.TableOutputsTrafficsFrames.Rows.Find(Convert.ToInt32(rg.Cells["dgrcID"].Value));
                if (r != null)
                {
                    r["Checked"] = isChecked;
                }
            }
            dgvOutputFramesShipment.Refresh();

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
        }
        private bool grdOutputsDocuments_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oOutputDocumentCur.ClearOne();

            oReportOutputDocument.ClearError();

            grdOutputsDocumentsGoods.DataSource = null;

            grdOutputsDocuments.GetGridState();

            // собираем условия
            bool?bIsConfirmed = null;

            if (optIsConfirmedNot.Checked)
            {
                bIsConfirmed = false;
            }
            if (optIsConfirmed.Checked)
            {
                bIsConfirmed = true;
            }

            oReportOutputDocument.Report_TripsCarries(GetTripsList(), 2,
                                                      sSelectedOwnersIDList, GetPartnersList(), sSelectedPackingsIDList, bIsConfirmed);

            grdOutputsDocuments.IsLockRowChanged = true;

            grdOutputsDocuments.Restore(oReportOutputDocument.MainTable);

            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oReportOutputDocument.ErrorNumber == 0);
        }
Exemplo n.º 29
0
        private bool grdOddmentsSaved_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oOddmentSavedCur.ID = null;

            oOddmentSavedList.ClearError();
            oOddmentSavedList.ClearFilters();
            oOddmentSavedList.ID = null;

            // собираем условия

            // даты
            if (!dtrDates.dtpBegDate.IsEmpty)
            {
                oOddmentSavedList.FilterDateBeg = dtrDates.dtpBegDate.Value;
            }

            if (!dtrDates.dtpEndDate.IsEmpty)
            {
                oOddmentSavedList.FilterDateEnd = dtrDates.dtpEndDate.Value;
            }

            grdOddmentsSavedGoods.DataSource = null;
            grdOddmentsSaved.GetGridState();

            oOddmentSavedList.FillTableOddmentsSaved();

            grdOddmentsSaved.IsLockRowChanged = true;
            grdOddmentsSaved.Restore(oOddmentSavedList.TableOddmentsSaved);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oOddmentSavedList.ErrorNumber == 0);
        }
Exemplo n.º 30
0
        private bool grdDetailGroupAll_Restore()
        {
            grdDetailGroupAll.GetGridState();
            grdDetailGroupAll.DataSource = null;
            if (grdData.Rows.Count == 0 ||
                oCellContentSnapshotCur.ID == null ||
                grdData.CurrentRow != null && grdData.IsStatusRow(grdData.CurrentRow.Index))
            {
                return(true);
            }

            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            // не показываем для незакрытых копий
            oCellContentSnapshotCur.FillData();
            if (oCellContentSnapshotCur.ErrorNumber != 0 ||
                oCellContentSnapshotCur.MainTable == null ||
                oCellContentSnapshotCur.MainTable.Rows.Count != 1 ||
                Convert.IsDBNull(oCellContentSnapshotCur.MainTable.Rows[0]["DateEnd"]))
            {
                RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
                RFMCursorWait.Set(false);
                return(true);
            }

            oCellContentSnapshotList.ClearError();
            oCellContentSnapshotList.FillTableCellsContentsSnapshotsDetails((int)oCellContentSnapshotCur.ID, 3,
                                                                            false, chkExcludeLostFoundEndGroupAll.Checked,
                                                                            chkDiffOnly.Checked, chkInInventoryOnly.Checked);
            DataTable tableCellContentSnapshotsDetailsGroupAll = oCellContentSnapshotList.TableCellsContentsSnapshotsDetails;

            grdDetailGroupAll.Restore(tableCellContentSnapshotsDetailsGroupAll);

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);
            return(oCellContentSnapshotList.ErrorNumber == 0);
        }