public frmFramesMedication(int nFrameID) { oFrame = new Frame(); oGood = new Good(); oOwner = new Partner(); oGoodState = new GoodState(); oCell = new Cell(); nCellCurID = null; oGoodAdd = new Good(); if (oFrame.ErrorNumber != 0 || oGood.ErrorNumber != 0 || oOwner.ErrorNumber != 0 || oGoodState.ErrorNumber != 0 || oCell.ErrorNumber != 0 || oGoodAdd.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); oFrame.ID = nFrameID; } }
public frmMovingsEdit(int?_nMovingID) { oMoving = new Moving(); oOwner = new Partner(); oGoodState = new GoodState(); oGoodStateNew = new GoodState(); oCellSource = new Cell(); oStoreZoneSource = new StoreZone(); oCellTarget = new Cell(); oStoreZoneTarget = new StoreZone(); if (oMoving.ErrorNumber != 0 || oOwner.ErrorNumber != 0 || oGoodState.ErrorNumber != 0 || oGoodStateNew.ErrorNumber != 0 || oCellSource.ErrorNumber != 0 || oStoreZoneSource.ErrorNumber != 0 || oCellTarget.ErrorNumber != 0 || oStoreZoneTarget.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); if (_nMovingID.HasValue) { nMovingID = (int)_nMovingID; } else { nMovingID = 0; } } }
public frmPackingsNotFixed(string _sPackingsList, string _sInputsList, string _sOutputsList) { oPacking = new Good(); if (oPacking.ErrorNumber != 0) { IsValid = false; } oOwner = new Partner(); oGoodState = new GoodState(); if (oOwner.ErrorNumber != 0 || oGoodState.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); sInputsList = _sInputsList; sOutputsList = _sOutputsList; sPackingsList = _sPackingsList; } }
public frmReportPackingsTurnover(DateTime _dDateBeg, DateTime _dDateEnd, int _nPackingID, int?_nOwnerID, int _nGoodStateID) { oReport = new Report(); oGood = new Good(); oGoodState = new GoodState(); oOwner = new Partner(); if (oReport.ErrorNumber != 0 || oGood.ErrorNumber != 0 || oGoodState.ErrorNumber != 0 || oOwner.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); dDateBeg = _dDateBeg; dDateEnd = _dDateEnd; nPackingID = _nPackingID; nOwnerID = _nOwnerID; nGoodStateID = _nGoodStateID; grcQntPlus.AgrType = grcQntMinus.AgrType = EnumAgregate.Sum; } }
public async Task Init() { await Loaders.Load(); await Localization.Init(); GoodState = new GoodState(await Loaders.GoodsLoader.Load()); Countries = Country.GetAllCountries(this); Buildings = Building.Bootstrap(this, await Loaders.BuildingLoader.Load()); }
public frmMovingsDocumentsEdit(int _nMovingDocumentID) { nMovingDocumentID = _nMovingDocumentID; oMovingDocument = new MovingDocument(); if (oMovingDocument.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oGoodStateSource = new GoodState(); oGoodStateTarget = new GoodState(); if (oGoodStateSource.ErrorNumber != 0 || oGoodStateTarget.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oOwnerSource = new Partner(); oOwnerTarget = new Partner(); if (oOwnerSource.ErrorNumber != 0 || oOwnerTarget.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGood = new Good(); if (oGood.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } nUserHostID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.HostID; if (nMovingDocumentID > 0 || nUserHostID.HasValue) { PreFormName = ""; } }
public frmActsEdit(int _ActID, int?_nInputID, int?_OutputID) { nActID = _ActID; nInputID = _nInputID; nOutputID = _OutputID; oAct = new Act(); if (oAct.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oGood = new Good(); if (oGood.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oPartner = new Partner(); if (oPartner.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGoodState = new GoodState(); if (oGoodState.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } nUserHostID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.HostID; if (nActID > 0 || nInputID.HasValue || nOutputID.HasValue || nUserHostID.HasValue) { PreFormName = ""; } }
//private bool bIsEditQnt = false; //private bool bIsEditBox = false; public frmOutputsDocumentsEdit(int _nOutputDocumentID) { nOutputDocumentID = _nOutputDocumentID; oOutputDocument = new OutputDocument(); if (oOutputDocument.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oGoodState = new GoodState(); if (oGoodState.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oOwner = new Partner(); if (oOwner.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGood = new Good(); if (oGood.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } nUserHostID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.HostID; if (nOutputDocumentID > 0 || nUserHostID.HasValue) { PreFormName = ""; } }
public frmTripsReturnsEdit(int _TripReturnID, int _nTripID) { nTripReturnID = _TripReturnID; nTripID = _nTripID; oTripReturn = new TripReturn(); if (oTripReturn.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oGood = new Good(); if (oGood.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oOwner = new Partner(); if (oOwner.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGoodState = new GoodState(); if (oGoodState.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } nUserHostID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.HostID; if (nTripReturnID > 0 || nUserHostID.HasValue) { PreFormName = ""; } }
public frmTrafficsFramesForPickingCreate() { oTraffic = new TrafficFrame(); oFrame = new Frame(); oGood = new Good(); if (oTraffic.ErrorNumber != 0 || oFrame.ErrorNumber != 0 || oGood.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oCell = new Cell(); oCellPicking = new Cell(); oCellOutput = new Cell(); if (oCell.ErrorNumber != 0 || oCellPicking.ErrorNumber != 0 || oCellOutput.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oOwner = new Partner(); oGoodState = new GoodState(); if (oOwner.ErrorNumber != 0 || oGoodState.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } }
public frmInputsBoxesEdit(int?_ID) : base() { oInput = new Input(); oGoodState = new GoodState(); oUser = new User(); oCell = new Cell(); IsValid = (oInput.ErrorNumber == 0 && oGoodState.ErrorNumber == 0 && oCell.ErrorNumber == 0 && oUser.ErrorNumber == 0); if (IsValid) { InitializeComponent(); if (_ID.HasValue) { nInputID = (int)_ID; } } }
private void btnGoodsStatesChoose_Click(object sender, EventArgs e) { _SelectedIDList = null; _SelectedText = ""; GoodState oGoodState = new GoodState(); oGoodState.FillData(); if (oGoodState.ErrorNumber != 0 || oGoodState.MainTable == null) { RFMMessage.MessageBoxError("Ошибка при получении данных о состояниях товаров..."); return; } if (oGoodState.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("Нет данных о состояниях товаров..."); return; } if (StartForm(new frmSelectID(this, oGoodState.MainTable, "Name", "Состояние товара", true)) == DialogResult.Yes) { if (_SelectedIDList == null || !_SelectedIDList.Contains(",")) { btnGoodsStatesClear_Click(null, null); return; } sSelectedGoodsStatesIDList = "," + _SelectedIDList; txtGoodsStatesChoosen.Text = _SelectedText; ttToolTip.SetToolTip(txtGoodsStatesChoosen, txtGoodsStatesChoosen.Text); tabData.IsNeedRestore = tabOddmentsSaved.IsNeedRestore = true; } _SelectedIDList = null; _SelectedText = ""; }
public frmCellsMedicationNotFrames(int nCellID) { oCell = new Cell(); oGood = new Good(); oOwner = new Partner(); oGoodState = new GoodState(); oGoodAdd = new Good(); if (oCell.ErrorNumber != 0 || oGood.ErrorNumber != 0 || oOwner.ErrorNumber != 0 || oGoodState.ErrorNumber != 0 || oGoodAdd.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); oCell.ID = nCellID; } }
public static bool FillData_GoodsStates(GoodState oGoodState) { if (oGoodState == null) { return(false); } RFMCursorWait.Set(true); if (!oGoodState.FillData() || oGoodState.ErrorNumber != 0 || oGoodState.MainTable == null) { RFMCursorWait.Set(false); RFMMessage.MessageBoxError("Ошибка при получении данных (состояния товаров)..."); return(false); } RFMCursorWait.Set(false); if (oGoodState.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("Нет данных (состояния товаров)..."); return(false); } return(true); }
public frmTripsReturnsActsCreate(int _nTripID, DataTable _dt) { nTripID = _nTripID; dt = _dt; if (dt == null) { return; } if (dt.Rows.Count > 0) { nGoodStateID = (int)dt.Rows[0]["GoodStateID"]; nOwnerID = (int)dt.Rows[0]["OwnerID"]; } oTrip = new Trip(); if (oTrip.ErrorNumber != 0) { IsValid = false; } if (IsValid) { oTripReturn = new TripReturn(); if (oTripReturn.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oAct = new Act(); if (oAct.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oOwner = new Partner(); if (oOwner.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGoodState = new GoodState(); if (oGoodState.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { oGood = new Good(); if (oGood.ErrorNumber != 0) { IsValid = false; } } if (IsValid) { InitializeComponent(); } }
private void mniChooseGoodState_Click(object sender, EventArgs e) { DataGridViewRow grdR = grdData.CurrentRow; DataRow dr = ((DataRowView)grdR.DataBoundItem).Row; if (nFixedGoodStateID != null) { if (RFMMessage.MessageBoxYesNo("ячейка закреплена за состо¤нием\n" + sFixedGoodStateName + "!\n" + "¬се-таки сменить состо¤ние?") != DialogResult.Yes) { return; } //dr["GoodStateID_After"] = nFixedGoodStateID; //dr["GoodStateName_After"] = sFixedGoodStateName; } _SelectedID = null; GoodState oGoodStateTemp = new GoodState(); oGoodStateTemp.FillData(); if (oGoodStateTemp.ErrorNumber == 0 && oGoodStateTemp.MainTable != null && oGoodStateTemp.MainTable.Rows.Count > 0) { if (StartForm(new frmSelectID(this, oGoodStateTemp.MainTable, "ID, Name, Actual", "ID, —осто¤ние, јкт.")) == DialogResult.Yes) { if (_SelectedID != null) { // нет ли уже записи дл¤ того же товара с тем же владельцем? // текуща¤ запись int nCellContentID = Convert.ToInt32(dr["ID"]); int nPackingCurID = Convert.ToInt32(dr["PackingID"]); int nGoodStateCurID = Convert.ToInt32(_SelectedID); // int?nOwnerCurID = null; if (!Convert.IsDBNull(dr["OwnerID_After"])) { nOwnerCurID = Convert.ToInt32(dr["OwnerID_After"]); } // перебираем записи int nPackingID, nGoodStateID; int?nOwnerID = null; foreach (DataRow drC in ((DataTable)grdData.GridSource.DataSource).Rows) { nPackingID = Convert.ToInt32(drC["PackingID"]); nGoodStateID = Convert.ToInt32(drC["GoodStateID_After"]); nOwnerID = null; if (!Convert.IsDBNull(drC["OwnerID_After"])) { nOwnerID = Convert.ToInt32(drC["OwnerID_After"]); } // если что-то отличаетс¤ или это та же запись - идем дальше if (nPackingID != nPackingCurID || nGoodStateID != nGoodStateCurID || nOwnerID.HasValue && !nOwnerCurID.HasValue || !nOwnerID.HasValue && nOwnerCurID.HasValue || nOwnerID.HasValue && nOwnerCurID.HasValue && nOwnerID != nOwnerCurID || Convert.ToInt32(drC["ID"]) == nCellContentID) { continue; } RFMMessage.MessageBoxError("”же есть запись о таком товаре/состо¤нии/хранителе..."); return; } dr["GoodStateID_After"] = nGoodStateCurID; dr["GoodStateName_After"] = _SelectedText; } } } _SelectedID = null; }