Exemplo n.º 1
0
        private bool dgvActs_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oActCur.ClearOne();

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

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

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

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

            // выбранные товары
            if (ucSelectRecordIDForm_Packings.IsSelectedExist)
            {
                oActList.FilterPackingsList = ucSelectRecordIDForm_Packings.GetIdString();
            }

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

            // приход готов к обработке на складе
            if (optReadyForWMSNot.Checked)
            {
                oActList.FilterReadyForWMS = false;
            }
            if (optReadyForWMS.Checked)
            {
                oActList.FilterReadyForWMS = true;
            }

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

            if (optPutExistsNot.Checked)
            {
                oActList.FilterPutExists = false;
            }

            if (optPutExists.Checked)
            {
                oActList.FilterPutExists = true;
                if (chkInput.Checked)
                {
                    oActList.FilterInputExists = true;
                }
                if (chkOutput.Checked)
                {
                    oActList.FilterOutputExists = true;
                }
            }

            if (nUserHostID.HasValue)
            {
                oActList.FilterHostsList = nUserHostID.ToString();
            }
            else
            {
                if (ucSelectRecordID_Hosts.IsSelectedExist)
                {
                    oActList.FilterHostsList = ucSelectRecordID_Hosts.GetIdString();
                }
            }
            //

            dgvActs.GetGridState();
            oActList.FillData();
            dgvActs.IsLockRowChanged = true;
            dgvActs.Restore(oActList.MainTable);
            tmrRestore.Enabled = true;

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

            return(oActList.ErrorNumber == 0);
        }