private void Process_lst_SelectedIndexChanged(object sender, EventArgs e) { if (isProcessListLoading) { return; } if (Process_lst.SelectedIndex < 0) { return; } if (StockLocation_chlst.Items.Count == 0) { LoadStockLocationListBox(); } ProcessStockLocationVo inVo = new ProcessStockLocationVo(); inVo.ProcessId = Convert.ToInt32(Process_lst.SelectedValue.ToString()); // ValueObjectList<ProcessStockLocationVo> checkVo = (ProcessStockLocationVo)base.InvokeCbm(new GetProcessStockLocationMasterMntCbm(), new ProcessStockLocationVo(), false); StockLocation_chlst.ClearSelected(); ValueObjectList <ProcessStockLocationVo> outVo = null; try { outVo = (ValueObjectList <ProcessStockLocationVo>)base.InvokeCbm(new GetProcessStockLocationMasterMntCbm(), inVo, false); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); return; } for (int i = 0; i < StockLocation_chlst.Items.Count; i++) { var stocklocation = (StockLocationVo)StockLocation_chlst.Items[i]; if (outVo == null || outVo.GetList() == null || outVo.GetList().Count == 0) { StockLocation_chlst.SetItemChecked(i, false); } else { StockLocation_chlst.SetItemChecked(i, outVo.GetList().Exists(x => x.StockLocationId == stocklocation.StockLocationId)); } } }
/// <summary> /// Checks mandatory fields /// </summary> /// <returns></returns> private bool CheckMandatory() { if (Process_lst.SelectedValue == null || Process_lst.SelectedValue.ToString() == string.Empty) { messageData = new MessageData("mmce00002", Properties.Resources.mmce00002, Process_lbl.Text); popUpMessage.Warning(messageData, Text); Process_lst.Focus(); return(false); } if (StockLocation_chlst.Items != null && StockLocation_chlst.Items.Count > 0 && StockLocation_chlst.CheckedItems.Count > 1) { messageData = new MessageData("mmce00016", Properties.Resources.mmce00016, Process_lbl.Text); popUpMessage.Warning(messageData, Text); StockLocation_chlst.Focus(); return(false); } return(true); }