/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind(ItemProcessWorkVo conditionInVo) { ItemProcessWork_dgv.DataSource = null; try { ItemProcessWorkVo outVo = (ItemProcessWorkVo)base.InvokeCbm(new GetItemProcessWorkMasterMntCbm(), conditionInVo, false); ItemProcessWork_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(outVo.ItemProcessWorkListVo, null); DataGridViewComboBoxColumn ComboColumn = (DataGridViewComboBoxColumn)(ItemProcessWork_dgv.Columns["colComment"]); ComboColumn.DataSource = processFlowRuleDatatable; ComboColumn.DisplayMember = "Comment"; ComboColumn.Selected = false; if (bindingSource1.Count > 0) { ItemProcessWork_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //item process work logger.Info(messageData); popUpMessage.Information(messageData, Text); } ItemProcessWork_dgv.ClearSelection(); ProcessWorkVo processWOutVo = (ProcessWorkVo)base.InvokeCbm(new GetProcessWorkMasterMntCbm(), new ProcessWorkVo(), false); outVo.ItemProcessWorkListVo.ForEach(t => t.OptionalProcessFlag = t.OptionalProcessFlag.Equals("1") ? "True" : "False"); outVo.ItemProcessWorkListVo.ForEach(t => t.SkipPreventionFlag = t.SkipPreventionFlag.Equals("1") ? "True" : "False"); List <ProcessWorkVo> exceptionList = outVo.ItemProcessWorkListVo.Select(e => new ProcessWorkVo { ProcessWorkId = e.ProcessWorkId } ).ToList(); List <ProcessWorkVo> procesWorkList = processWOutVo.ProcessWorkListVo.Where(p => !exceptionList.Any(p2 => p2.ProcessWorkId == p.ProcessWorkId)).ToList(); ProcessWork_dgv.AutoGenerateColumns = false; BindingSource bindingSource2 = new BindingSource(procesWorkList, null); ProcessWork_dgv.DataSource = bindingSource2; ProcessWork_dgv.ClearSelection(); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind(ProcessWorkLocalSupplierVo conditionInVo) { ProcessWork_dgv.DataSource = null; try { ProcessWorkLocalSupplierVo outVo = (ProcessWorkLocalSupplierVo)base.InvokeCbm(new GetProcessWorkLocalSupplierMasterMntCbm(), conditionInVo, false); ProcessWork_dgv.AutoGenerateColumns = false; outVo.ProcessWorkLocalSupplierListVo.ForEach(t => t.IsExists = t.LocalSupplierId > 0 ? "True" : "False"); BindingSource bindingSource1 = new BindingSource(outVo.ProcessWorkLocalSupplierListVo, null); if (bindingSource1.Count > 0) { ProcessWork_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //item process work logger.Info(messageData); popUpMessage.Information(messageData, Text); } ProcessWork_dgv.ClearSelection(); } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }
/// <summary> /// binds datasource /// </summary> /// <param name="outVo"></param> private void BindDataSource(List <ProcessWorkVo> outVo) { ProcessWork_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(outVo, null); if (bindingSource1 != null && bindingSource1.Count > 0) { ProcessWork_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } ProcessWork_dgv.ClearSelection(); }
/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind(ProcessWorkVo conditionInVo) { ProcessWorkVo inVo = new ProcessWorkVo(); ProcessWork_dgv.DataSource = null; try { ProcessWorkVo outVo = (ProcessWorkVo)base.InvokeCbm(new GetProcessWorkMasterMntCbm(), conditionInVo, false); ProcessWork_dgv.AutoGenerateColumns = false; foreach (ProcessWorkVo itemList in outVo.ProcessWorkListVo) { ProcessWorkVo bindVo = new ProcessWorkVo(); bindVo.ProcessWorkId = Convert.ToInt32(itemList.ProcessWorkId); bindVo.ProcessWorkCode = itemList.ProcessWorkCode.ToString(); bindVo.ProcessWorkName = itemList.ProcessWorkName.ToString(); bindVo.ProcessId = Convert.ToInt32(itemList.ProcessId); bindVo.ProcessCode = itemList.ProcessCode.ToString(); bindVo.ProcessName = itemList.ProcessName.ToString(); bindVo.IsPhantomDisplay = itemList.IsPhantomDisplay.ToString(); if (itemList.LineMachineSelection == 1) { bindVo.LineMachineSelectionDisplay = "SingleLine"; } else if (itemList.LineMachineSelection == 2) { bindVo.LineMachineSelectionDisplay = "SingleMachine"; } else if (itemList.LineMachineSelection == 3) { bindVo.LineMachineSelectionDisplay = "SingleLineandSingleMachine"; } bindVo.DisplayOrder = Convert.ToInt32(itemList.DisplayOrder); inVo.ProcessWorkListVo.Add(bindVo); } BindingSource bindingSource1 = new BindingSource(inVo.ProcessWorkListVo, null); if (bindingSource1.Count > 0) { ProcessWork_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //process work logger.Info(messageData); popUpMessage.Information(messageData, Text); } ProcessWork_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }