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); }
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); }
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); }
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 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); }
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); }
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 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); }
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 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); }
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); }
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 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); } }
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); }
private void ucSelectRecordID_Owners_Restore() { if (ucSelectRecordID_Owners.sourceData == null) { RFMCursorWait.Set(true); oPartner.FilterOwner = 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(); } }
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); }
private void frmOddments_Load(object sender, EventArgs e) { RFMCursorWait.Set(true); grcOddmentDetailQnt.AgrType = grcOddmentsSavedCalcQnt.AgrType = grcOddmentsSavedDiffQnt.AgrType = grcOddmentsSavedQnt.AgrType = grcQnt.AgrType = grcBoxQnt.AgrType = grcPalQnt.AgrType = grcNettoQnt.AgrType = grcQntStor.AgrType = grcOddmentDetailQnt.AgrType = grcOddmentDetailBoxQnt.AgrType = grcOddmentDetailPalQnt.AgrType = EnumAgregate.Sum; grdData.IsStatusShow = grdOddmentsDetails.IsStatusShow = true; btnClearTerms_Click(null, null); tcList.Init(); RFMCursorWait.Set(false); }
private void frmReportTraffics_Load(object sender, EventArgs e) { RFMCursorWait.Set(true); bool lResult = cboTrafficError_Restore(); if (!lResult) { RFMCursorWait.Set(false); RFMMessage.MessageBoxError("ќшибка при получении фильтров (операции транспортировки контейнеров)..."); Dispose(); } grcQntWished.AgrType = grcQntConfirmed.AgrType = grcBoxConfirmed.AgrType = grcBoxWished.AgrType = grcFrameBoxQnt.AgrType = grcFramePalQnt.AgrType = grcFrameQnt.AgrType = grcFrameWeight.AgrType = EnumAgregate.Sum; btnClearTerms_Click(null, null); tcList.Init(); RFMCursorWait.Set(false); }
private void ucSelectRecordID_GoodsBrands_Restore() { RFMCursorWait.Set(true); ucSelectRecordID_GoodsBrands.sourceData = null; oGoods.FilterGoodsBrandsList = null; oGoods.FilterHostsList = null; if (nHostID.HasValue) { oGoods.FilterHostsList = nHostID.ToString(); } else { if (ucSelectRecordID_Hosts.IsSelectedExist) { oGoods.FilterHostsList = ucSelectRecordID_Hosts.GetIdString(); } } oGoods.FillTableGoodsBrands(); RFMCursorWait.Set(false); if (oGoods.ErrorNumber != 0 || oGoods.TableGoodsBrands == null) { RFMMessage.MessageBoxError("Ошибка при получении данных (товарные бренды)..."); return; } if (oGoods.TableGoodsBrands.Rows.Count == 0) { RFMMessage.MessageBoxError("Нет данных (товарные бренды)..."); return; } ucSelectRecordID_GoodsBrands.Restore(oGoods.TableGoodsBrands); }
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(); } }
private void frmReportPickFreeRill_Load(object sender, EventArgs e) { RFMCursorWait.Set(true); tcList.SelectedTab = tabForFree; btnGo_Click(null, null); RFMCursorWait.Set(false); }
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 mniPrintInventoryTotalReport_Click(object sender, EventArgs e) { RFMMenuUtilities.MenuClear((ToolStripMenuItem)sender); if (grdData.CurrentRow == null) { return; } RFMCursorWait.Set(true); Inventory oInventoryPrint = new Inventory(); InventoryPrepareIDList(oInventoryPrint, true); if (oInventoryPrint.IDList == null || oInventoryPrint.IDList.Length == 0) { RFMMessage.MessageBoxError("Не отмечены записи для отчета..."); return; } oInventoryPrint.FillData(); if (oInventoryPrint.MainTable == null || oInventoryPrint.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("Ошибка при получении данных по отмеченным записям..."); return; } RFMCursorWait.Set(false); StartForm(new frmInventoriesTotalReport(oInventoryPrint)); }
private void ucSelectRecordID_Users_Restore() { if (ucSelectRecordID_Users.sourceData == null) { RFMCursorWait.Set(true); User oUsers = new User(); oUsers.FillDataTree(false); RFMCursorWait.Set(false); if (oUsers.ErrorNumber != 0 || oUsers.DS.Tables["TableDataTree"] == null) { RFMMessage.MessageBoxError("Ошибка при получении данных (cотрудники)..."); return; } if (oUsers.DS.Tables["TableDataTree"].Rows.Count == 0) { RFMMessage.MessageBoxError("Нет данных (сотрудники)..."); return; } ucSelectRecordID_Users.Restore(oUsers.DS.Tables["TableDataTree"]); } else { ucSelectRecordID_Users.Restore(); } }
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); }
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); }
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 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); }
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); }