private bool cboGoodState_Restore() { oGoodState.FillData(); cboGoodState.DataSource = oGoodState.MainTable; cboGoodState.ValueMember = oGoodState.ColumnID; cboGoodState.DisplayMember = oGoodState.ColumnName; return(oGoodState.ErrorNumber == 0); }
private bool cboFixedGoodState_Restore(int nFixedGoodState) { oFixedGoodState.ID = nFixedGoodState; oFixedGoodState.FillData(); cboFixedGoodState.DataSource = oFixedGoodState.MainTable; cboFixedGoodState.ValueMember = oFixedGoodState.ColumnID; cboFixedGoodState.DisplayMember = oFixedGoodState.ColumnName; return(oFixedGoodState.ErrorNumber == 0); }
private bool cboGoodStateNew_Restore() { oGoodStateNew.FillData(); if (oMoving.ErrorNumber == 0) { cboGoodStateNew.ValueMember = oGoodStateNew.ColumnID; cboGoodStateNew.DisplayMember = oGoodStateNew.ColumnName; cboGoodStateNew.DataSource = oGoodStateNew.MainTable; } return(oGoodStateNew.ErrorNumber == 0); }
private bool cboNewGoodState_Restore() { oGoodState.FillData(); if (oGoodState.ErrorNumber == 0) { cboNewGoodState.ValueMember = oGoodState.ColumnID; cboNewGoodState.DisplayMember = oGoodState.ColumnName; cboNewGoodState.DataSource = new DataView(oGoodState.MainTable); } return(oGoodState.ErrorNumber == 0); }
private bool cboGoodsState_Restore() { oGoodState.ClearError(); if (oGoodState.FillData()) { cboGoodsState.ValueMember = oGoodState.ColumnID; cboGoodsState.DisplayMember = oGoodState.ColumnName; cboGoodsState.Restore(oGoodState.MainTable); } return(oGoodState.ErrorNumber == 0); }
private bool cboGoodsState_Restore() { oGoodState.ClearError(); if (oGoodState.FillData()) { cboGoodsState.DataSource = new DataView(oGoodState.MainTable); cboGoodsState.ValueMember = oGoodState.ColumnID; cboGoodsState.DisplayMember = "Name"; cboGoodsState.Restore(); } return(oPartner.ErrorNumber == 0); }
private bool cboGoodsState_Restore() { oGoodState.ClearError(); if (nGoodStateID > 0) { oGoodState.IDList = nGoodStateID.ToString(); // только полученное значение } if (oGoodState.FillData()) { cboGoodsState.ValueMember = oGoodState.ColumnID; cboGoodsState.DisplayMember = oGoodState.ColumnName; cboGoodsState.Restore(oGoodState.MainTable); } return(oGoodState.ErrorNumber == 0); }
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 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); }
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; }
private void frmReportPackingsTurnover_Load(object sender, EventArgs e) { oGood.PackingID = nPackingID; oGood.FillData(); if (oGood.ErrorNumber != 0) { return; } if (oGood.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("ќшибка при получении данных о товаре..."); return; } DataRow r = oGood.MainTable.Rows[0]; bWeighting = !Convert.IsDBNull(r["Weighting"]) && Convert.ToBoolean(r["Weighting"]) || !Convert.IsDBNull(r["InBox"]) && Convert.ToDecimal(r["InBox"]) != Convert.ToInt32(r["InBox"]); if (bWeighting) { numInBox.DecimalPlaces = numQntBeg.DecimalPlaces = numQntEnd.DecimalPlaces = 3; grcQntPlus.DefaultCellStyle.Format = grcQntMinus.DefaultCellStyle.Format = "### ### ###.000"; } else { numInBox.DecimalPlaces = numQntBeg.DecimalPlaces = numQntEnd.DecimalPlaces = 0; grcQntPlus.DefaultCellStyle.Format = grcQntMinus.DefaultCellStyle.Format = "### ### ###"; } txtGoodAlias.Text = oGood.MainTable.Rows[0]["GoodAlias"].ToString(); numInBox.Value = Convert.ToDecimal(oGood.MainTable.Rows[0]["InBox"]); oGoodState.ID = nGoodStateID; oGoodState.FillData(); if (oGoodState.ErrorNumber != 0) { return; } if (oGoodState.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("ќшибка при получении данных о состо¤нии товара..."); return; } txtGoodStateName.Text = oGoodState.MainTable.Rows[0]["Name"].ToString(); if (nOwnerID.HasValue) { oOwner.ID = nOwnerID; oOwner.FillData(); if (oOwner.ErrorNumber != 0) { return; } if (oOwner.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("ќшибка при получении данных о владельце/хранителе..."); return; } txtOwnerName.Text = oOwner.MainTable.Rows[0]["Name"].ToString(); } dtrDates.dtpBegDate.Value = dDateBeg; dtrDates.dtpEndDate.Value = dDateEnd; btnFilter_Click(null, null); }