protected bool SelectFromList(List <CatalogItem> list, int selectedIndex, int rowHeight, out CatalogItem selectedItem) { var _selectingItemForm = new WMS_client.Base.Visual.SelectingItem(); _selectingItemForm.SetRowHeight(rowHeight); _selectingItemForm.DataSource = list; _selectingItemForm.SelectedIndex = selectedIndex; this.selectingItemForm = _selectingItemForm; selectingFromList = true; var selectResult = _selectingItemForm.ShowDialog(); selectingFromList = false; this.selectingItemForm = null; if (selectResult == DialogResult.OK) { selectedItem = list[_selectingItemForm.SelectedIndex < 0 ? 0 : _selectingItemForm.SelectedIndex]; return(true); } selectedItem = null; return(false); }
// どの項目が選択されたかを項目側からもらう public void SelectedItem(SelectingItem item) { isSelected = true; result = item.selectNo; }
public List <SelectingItem> GetSelected(string lstValue, int status) { var results = new List <SelectingItem>(); var s = lstValue.TrimEnd('#').Split('#'); if (status == 0) { for (int j = 0; j < s.Length; j++) { var commandNo = s[j].Split(',')[0]; var productCode = s[j].Split(',')[1]; var preProductLotNo = s[j].Split(',')[2]; var tableProduct = _unitOfWork.TabletProductRepository.Get( i => i.F56_KndCmdNo.Trim().Equals(commandNo.Trim()) && i.F56_ProductCode.Trim().Equals(productCode.Trim()) && i.F56_PrePdtLotNo.Trim().Equals(preProductLotNo.Trim())); var product = _unitOfWork.ProductRepository.Get(i => i.F09_ProductCode.Trim().Equals(productCode)); var selectItem = new SelectingItem(); selectItem.CommandNo = tableProduct.F56_KndCmdNo; selectItem.ProductCode = tableProduct.F56_ProductCode; selectItem.PreProductLotNo = tableProduct.F56_PrePdtLotNo; selectItem.ProductName = product.F09_ProductDesp; selectItem.LotNo = tableProduct.F56_ProductLotNo; selectItem.PackUnit = product.F09_PackingUnit; selectItem.PackQty = (tableProduct.F56_TbtCmdEndAmt - tableProduct.F56_StorageAmt) / product.F09_PackingUnit; //selectItem.Fraction = (tableProduct.F56_TbtCmdEndAmt - tableProduct.F56_StorageAmt) - // selectItem.PackQty*product.F09_PackingUnit; selectItem.Fraction = tableProduct.F56_TbtCmdEndFrtAmt; selectItem.TabletingEndDate = tableProduct.F56_TbtEndDate.ToString(); results.Add(selectItem); } } else { for (int j = 0; j < s.Length; j++) { var productCode = s[j].Split(',')[0]; var preProductLotNo = s[j].Split(',')[1]; var outOfPlanProduct = _unitOfWork.OutOfPlanProductRepository.Get( i => i.F58_ProductCode.Trim().Equals(productCode.Trim()) && i.F58_PrePdtLotNo.Trim().Equals(preProductLotNo.Trim())); var product = _unitOfWork.ProductRepository.Get(i => i.F09_ProductCode.Trim().Equals(productCode)); var selectItem = new SelectingItem(); selectItem.ProductCode = outOfPlanProduct.F58_ProductCode; selectItem.PreProductLotNo = outOfPlanProduct.F58_PrePdtLotNo; selectItem.ProductName = product.F09_ProductDesp; selectItem.LotNo = outOfPlanProduct.F58_ProductLotNo; selectItem.PackUnit = product.F09_PackingUnit; selectItem.PackQty = (outOfPlanProduct.F58_TbtCmdEndAmt - outOfPlanProduct.F58_StorageAmt) / product.F09_PackingUnit; selectItem.Fraction = (outOfPlanProduct.F58_TbtCmdEndAmt - outOfPlanProduct.F58_StorageAmt) - selectItem.PackQty * product.F09_PackingUnit; selectItem.TabletingEndDate = outOfPlanProduct.F58_TbtEndDate.ToString(); results.Add(selectItem); } } return(results); }