private bool ExistValidation() { int cnt = shelfView.RowCount; TranboundItem item = new TranboundItem(); item.toShelfNo = cboShelfNoTo.Text.Trim(); string tip; for (int i = 0; i < cnt; i++) { if (shelfInventoryView.IsRowChecked(i) == false) { continue; } shelfInventoryView.GetTranBoundItem(i, item); if (tranboundEditView.FindTranDetail(item) == true) { tip = string.Format("Row:{0} From Shelf#: {1} , Art#: {2} , Size#: {3} already exists.", i + 1, item.fromShelfNo, item.lotNo, item.sizeNo); MsgBox.Error(tip); return(false); } }//end for return(true); }
private void btnAdd_Click(object sender, EventArgs e) { if (ValidTranRows() == false) { return; } if (ExistValidation() == false) { return; } int cnt = shelfView.RowCount; TranboundItem item = new TranboundItem(); item.toShelfNo = cboShelfNoTo.Text.Trim(); for (int i = 0; i < cnt; i++) { if (shelfInventoryView.IsRowChecked(i) == false) { continue; } shelfInventoryView.GetTranBoundItem(i, item); // if (tranboundEditView.FindTranDetail(item) == false) // { tranboundEditView.AddTranBoundDetail(item); // } shelfInventoryView.SetRowCheckedState(i, false); }//end for //shelfInventoryView.ClearRows(); }
public void GetTranBoundItem(int rowHandle, TranboundItem item) { if (item == null) { item = new TranboundItem(); } item.lotNo = gridView.GetRowCellValue(rowHandle, colLotNo).ToString(); item.sizeNo = gridView.GetRowCellValue(rowHandle, colSizeNo).ToString(); item.fromShelfNo = gridView.GetRowCellValue(rowHandle, colShelfNo).ToString(); item.quantity = Convert.ToInt32(gridView.GetRowCellValue(rowHandle, colTranCnt)); }
public void AddTranBoundDetail(TranboundItem item) { DataRow dr = dataTable.NewRow(); dr["DetailID"] = ""; dr["ShelfNoFrom"] = item.fromShelfNo; dr["ShelfNoTo"] = item.toShelfNo; dr["LotNo"] = item.lotNo; dr["SizeNo"] = item.sizeNo; dr["NumOfPlan"] = item.quantity.ToString(); dataTable.Rows.Add(dr); }
public bool FindTranDetail(TranboundItem item) { return(FindTranDetail(item.lotNo, item.sizeNo, item.fromShelfNo)); }