예제 #1
0
        public static bool FillData_PartnersDetails(Partner oPartner, int?nPartnerID)
        {
            if (oPartner == null)
            {
                return(false);
            }

            RFMCursorWait.Set(true);
            //oPartner.FilterActual = true;
            bool bResult = false;

            if (nPartnerID.HasValue)
            {
                bResult = oPartner.FillTablePartnersDetails((int)nPartnerID);
            }
            else
            {
                bResult = oPartner.FillTablePartnersDetails();
            }
            if (!bResult ||
                oPartner.ErrorNumber != 0 ||
                oPartner.TablePartnersDetails == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (реквизиты партнеров)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oPartner.TablePartnersDetails.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Нет данных (реквизиты партнеров)...");
                return(false);
            }
            return(true);
        }
예제 #2
0
        public static bool FillData_ManagerNames(OutputDocument oOutputDocument, DateTime?dDateBeg, DateTime?dDateEnd)
        {
            if (oOutputDocument == null)
            {
                return(false);
            }

            if (!dDateBeg.HasValue)
            {
                dDateBeg = DateTime.Now;
            }
            if (!dDateEnd.HasValue)
            {
                dDateEnd = DateTime.Now;
            }

            RFMCursorWait.Set(true);
            if (!oOutputDocument.FillTableManagerNames(dDateBeg, dDateEnd) ||
                oOutputDocument.ErrorNumber != 0 ||
                oOutputDocument.TableManagerNames == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (менеджеры)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oOutputDocument.TableManagerNames.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Нет данных (менеджеры)...");
                return(false);
            }
            return(true);
        }
        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);
        }
예제 #4
0
        public static bool FillData_PartnersRoots(Partner oPartner)
        {
            if (oPartner == null)
            {
                return(false);
            }

            RFMCursorWait.Set(true);
            //oPartner.FilterActual = true;
            if (!oPartner.FillTablePartnersRoots() ||
                oPartner.ErrorNumber != 0 ||
                oPartner.TablePartnersRoots == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (объединения партнеров)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oPartner.TablePartnersRoots.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Нет данных (объединения партнеров)...");
                return(false);
            }
            return(true);
        }
예제 #5
0
        private void ucSelectRecordID_Owners_Restore()
        {
            if (ucSelectRecordID_Owners.sourceData == null)
            {
                RFMCursorWait.Set(true);
                Partner oPartner = new Partner();
                oPartner.FilterIsOwner = true;
                oPartner.FillData();
                RFMCursorWait.Set(false);
                if (oPartner.ErrorNumber != 0 || oPartner.MainTable == null)
                {
                    RFMMessage.MessageBoxError("ќшибка при получении данных (владельцы)...");
                    return;
                }
                if (oPartner.MainTable.Rows.Count == 0)
                {
                    RFMMessage.MessageBoxError("Ќет данных (владельцы)...");
                    return;
                }

                ucSelectRecordID_Owners.Restore(oPartner.MainTable);
            }
            else
            {
                ucSelectRecordID_Owners.Restore();
            }
        }
예제 #6
0
        private void frmReportCellsFramesHistory_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

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

            if (!lResult)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("ќшибка при заполнении существующих значений параметров адреса...");
                return;
            }

            grcQnt.AgrType            =
                grcBoxQnt.AgrType     =
                    grcPalQnt.AgrType =
                        EnumAgregate.Sum;

            btnClearTerms_Click(null, null);

            tcList.Init();

            RFMCursorWait.Set(false);
        }
예제 #7
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);
        }
예제 #8
0
        public static bool FillData_Drivers(Driver oDriver)
        {
            if (oDriver == null)
            {
                return(false);
            }

            RFMCursorWait.Set(true);
            //oDriver.FilterActual = true;
            if (!oDriver.FillData() ||
                oDriver.ErrorNumber != 0 ||
                oDriver.MainTable == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (водители)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oDriver.MainTable.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Нет данных (водители)...");
                return(false);
            }
            return(true);
        }
예제 #9
0
        private void ucSelectRecordID_Hosts_Restore()
        {
            if (ucSelectRecordID_Hosts.sourceData == null)
            {
                RFMCursorWait.Set(true);
                oHost.FillData();
                RFMCursorWait.Set(false);
                if (oHost.ErrorNumber != 0 || oHost.MainTable == null)
                {
                    RFMMessage.MessageBoxError("Ошибка при получении данных (хосты)...");
                    return;
                }
                if (oHost.MainTable.Rows.Count == 0)
                {
                    RFMMessage.MessageBoxError("Нет данных (хосты)...");
                    return;
                }

                ucSelectRecordID_Hosts.Restore(oHost.MainTable);
            }
            else
            {
                ucSelectRecordID_Hosts.Restore();
            }
        }
예제 #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);
        }
예제 #11
0
        private void ucSelectRecordID_PartnersRoots_Restore()
        {
            if (ucSelectRecordID_PartnersRoots.sourceData == null)
            {
                RFMCursorWait.Set(true);
                Partner oPartner = new Partner();
                oPartner.FillTablePartnersRoots();
                RFMCursorWait.Set(false);
                if (oPartner.ErrorNumber != 0 || oPartner.TablePartnersRoots == null)
                {
                    RFMMessage.MessageBoxError("Ошибка при получении данных (объединения партнеров)...");
                    return;
                }
                if (oPartner.TablePartnersRoots.Rows.Count == 0)
                {
                    RFMMessage.MessageBoxError("Нет данных (объединения партнеров)...");
                    return;
                }

                ucSelectRecordID_PartnersRoots.Restore(oPartner.TablePartnersRoots);
            }
            else
            {
                ucSelectRecordID_PartnersRoots.Restore();
            }
        }
        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);
        }
예제 #13
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);
        }
예제 #14
0
        private void frmActs_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

            nUserHostID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.HostID;

            lblHosts.Visible =
                ucSelectRecordID_Hosts.Visible     =
                    ucSelectRecordID_Hosts.Enabled =
                        (oHost.Count() > 1 && !nUserHostID.HasValue);

            // назначение суммировани¤ на колонки
            foreach (Control ctrl in Controls)
            {
                Utilities.ctrl_AgrTypeSet(ctrl);
            }

            btnClearTerms_Click(null, null);

            tcList.Init();

            dtrDates.dtpBegDate.Select();

            RFMCursorWait.Set(false);
        }
예제 #15
0
        private void frmFrames_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

            bool lResult = cboPalletsTypes_Restore();

            if (!lResult)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении фильтров (контейнеры)...");
                Dispose();
            }

            grcQntFramesContents.AgrType                             =
                grcBoxQntFramesContents.AgrType                      =
                    grcPalQntFramesContents.AgrType                  =
                        grcFramesHistoryQnt.AgrType                  =
                            grcFramesHistoryBoxQnt.AgrType           =
                                grcFramesHistoryPalQnt.AgrType       =
                                    grcFrameWeight.AgrType           =
                                        grcFrames_Qnt.AgrType        =
                                            grcFrames_BoxQnt.AgrType =
                                                EnumAgregate.Sum;

            btnClearTerms_Click(null, null);

            tcList.Init();

            txtBarCode.Select();

            RFMCursorWait.Set(false);
        }
예제 #16
0
        public static bool FillData_Employees(Employee oEmployee)
        {
            if (oEmployee == null)
            {
                return(false);
            }

            RFMCursorWait.Set(true);
            //oEmployee.FilterActual = true;
            if (!oEmployee.FillData() ||
                oEmployee.ErrorNumber != 0 ||
                oEmployee.MainTable == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (сотрудники)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oEmployee.MainTable.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Нет данных (сотрудники)...");
                return(false);
            }
            return(true);
        }
        private void frmOutputsInputsCarries_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

            // назначение суммирования на колонки
            foreach (Control ctrl in Controls)
            {
                Utilities.ctrl_AgrTypeSet(ctrl);
            }
            grdOutputs.IsStatusShow          =
                grdOutputsGoods.IsStatusShow =
                    grdOutputsDocumentsInOutputs.IsStatusShow           =
                        grdOutputsDocuments.IsStatusShow                =
                            grdOutputsDocumentsGoods.IsStatusShow       =
                                grdInputs.IsStatusShow                  =
                                    grdInputsGoods.IsStatusShow         =
                                        grdInputsDocuments.IsStatusShow =
                                            true;

            btnClearTerms_Click(null, null);

            tcList.Init();

            tcOutputsGoods.Init();
            tcOutputsDocumentsGoods.Init();
            tcInputsGoods.Init();

            btnPrint.ShortCutSet(mnuPrint);
            //btnService.ShortCutSet(mnuService);

            RFMCursorWait.Set(false);
        }
예제 #18
0
        public static bool FillData_CarsTypes(CarType oCarType)
        {
            if (oCarType == null)
            {
                return(false);
            }

            RFMCursorWait.Set(true);
            //oCarType.FilterActual = true;
            if (!oCarType.FillData() ||
                oCarType.ErrorNumber != 0 ||
                oCarType.MainTable == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ошибка при получении данных (типы машин)...");
                return(false);
            }
            RFMCursorWait.Set(false);
            if (oCarType.MainTable.Rows.Count == 0)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Нет данных (типы машин)...");
                return(false);
            }
            return(true);
        }
예제 #19
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);
        }
예제 #20
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);
        }
예제 #21
0
        private void frmTripEfficiency_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(false);

            grcExpences.AgrType  = grcCleanMarkup.AgrType = RFMBaseClasses.EnumAgregate.Sum;
            dgvMain.IsStatusShow = true;

            dgvMain.Restore(tableEfficiency);
        }
예제 #22
0
        private void frmWarrantsNumbers_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

            btnClearTerms_Click(null, null);

            tcList.Init();

            RFMCursorWait.Set(false);
        }
예제 #23
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);
        }
예제 #24
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);
        }
예제 #25
0
        private bool dgvCells_Restore()
        {
            RFMCursorWait.Set(true);

            oCell.ClearFilters();
            oCell.IDList = null;

            if (trvCells.GetMarkedNodes() > 0)
            {
                DataTable dtMarkedCells = CopyTable((DataTable)trvCells.TreeSource.DataSource, "MarkedCells", "IsMarked AND NOT IsNode", "", new string[] { "ID" });
                string    strCells      = "";
                foreach (DataRow r in dtMarkedCells.Rows)
                {
                    strCells += r["ID"].ToString() + ",";
                }
                if (strCells != null && strCells.Length > 0)
                {
                    oCell.IDList = strCells;
                }
            }

            if (uctZones.IsSelectedExist)
            {
                DataTable dt       = CopyTable(uctZones.selectData, "MarkedZones", "", "", new string[] { "ID" });
                string    strZones = "";
                foreach (DataRow r in dt.Rows)
                {
                    strZones += r["ID"].ToString() + ",";
                }
                if (strZones != null && strZones.Length > 0)
                {
                    oCell.FilterStoresZonesList = strZones;
                }
            }

            oCell.FillData();

            if (!oCell.MainTable.Columns.Contains("PreRank"))
            {
                oCell.MainTable.Columns.Add("PreRank", Type.GetType("System.Int32"));
            }
            foreach (DataRow r in oCell.MainTable.Rows)
            {
                r["PreRank"] = r["Rank"];
            }

            dgvCells.Restore(oCell.MainTable);

            SetButtonStatus(dgvCells.GridSource.Count > 0);

            RFMCursorWait.Set(false);

            return(true);
        }
예제 #26
0
        private void frmSalaryExtraWorks_Load(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);

            btnClearTerms_Click(null, null);

            tcList.Init();

            dtrDates.dtpBegDate.Select();

            RFMCursorWait.Set(false);
        }
예제 #27
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);
        }
예제 #28
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);
        }
예제 #29
0
        private void btnGuiltyEmloyeeSelect_Click(object sender, EventArgs e)
        {
            RFMCursorWait.Set(true);
            // ранее введеные значени¤
            OutputDocument oOutputDocumentTemp = new OutputDocument();

            oOutputDocumentTemp.FilterDateBeg = oOutputDocument.DateOutput.AddMonths(-1);
            oOutputDocumentTemp.FilterDateEnd = DateTime.Now.Date;
            oOutputDocumentTemp.FillData();
            if (oOutputDocumentTemp.ErrorNumber != 0 || oOutputDocumentTemp.MainTable == null)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("ќшибка при получении данных о расходных документах...");
                return;
            }
            if (oOutputDocument.MainTable.Rows.Count == 0)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Ќет данных...");
                return;
            }

            DataView  dv = new DataView(oOutputDocumentTemp.MainTable, "GuiltyEmployees > ''", "GuiltyEmployees", DataViewRowState.CurrentRows);
            DataTable tdGuiltyEmployees = dv.ToTable(true, "GuiltyEmployees");

            /*
             * DataTable dtGuiltyEmployeesDistinct = new DataTable();
             * dtGuiltyEmployeesDistinct.Columns.Add("GuiltyEmployees");
             * System.Collections.Hashtable hash = new System.Collections.Hashtable();
             * foreach (DataRow row in oOutputDocumentTemp.MainTable.Rows)
             *      hash[row["GuiltyEmployees"]] = row["GuiltyEmployees"];
             * foreach (object name in hash.Values)
             *      dtGuiltyEmployeesDistinct.Rows.Add(name);
             * DataTable tdGuiltyEmployees = CopyTable(dtGuiltyEmployeesDistinct, "tdGuiltyEmployees", "GuiltyEmployees > ''", "GuiltyEmployees");
             */
            RFMCursorWait.Set(false);

            if (StartForm(new frmSelectID(this, tdGuiltyEmployees, "GuiltyEmployees", "¬иновник проблем", false)) == DialogResult.Yes)
            {
                if (_SelectedID == null)
                {
                    return;
                }
                txtGuiltyEmployees.Text = _SelectedText;
            }
            _SelectedID   = null;
            _SelectedText = "";

            return;
        }
예제 #30
0
        private void mniPrintInventoryEmpty_Click(object sender, EventArgs e)
        {
            RFMMenuUtilities.MenuClear((ToolStripMenuItem)sender);

            if (grdData.CurrentRow == null)
            {
                return;
            }

            RFMCursorWait.Set(true);

            int nPages = 1;

            if (StartForm(new frmInputBoxNumeric("Страниц:", nPages)) == DialogResult.Yes)
            {
                Refresh();
                nPages = Convert.ToInt32(GotParam[0]);
            }

            Inventory oInventoryPrint = new Inventory();

            // получение данных
            oInventoryPrint.ID = (int)grdData.CurrentRow.Cells["grcID"].Value;
            oInventoryPrint.FillData();
            if (oInventoryPrint.ErrorNumber != 0 || oInventoryPrint.MainTable == null || oInventoryPrint.MainTable.Rows.Count != 1)
            {
                RFMCursorWait.Set(false);
                RFMMessage.MessageBoxError("Нет данных о ревизии...");
                return;
            }

            if (nPages > 1)
            {
                oInventoryPrint.MainTable.PrimaryKey           = null;
                oInventoryPrint.MainTable.Columns["ID"].Unique = false;
                DataRow r = oInventoryPrint.MainTable.Rows[0];
                for (int i = 1; i < nPages; i++)
                {
                    oInventoryPrint.MainTable.ImportRow(r);
                }
            }

            RFMCursorWait.Set(false);

            // отчет
            repInventoryEmpty rep = new repInventoryEmpty();

            StartForm(new frmActiveReport(oInventoryPrint.MainTable, rep));
        }