/// <summary> /// Fills all user records to gridview control /// </summary> private void GridBind() { Customer_dgv.DataSource = null; CustomerLineVo outVo = null; CustomerLineVo inVo = new CustomerLineVo(); inVo.CustomerId = Convert.ToInt32(CustomerLine_cmb.SelectedValue); inVo.LineId = Convert.ToInt32(Line_cmb.SelectedValue); try { outVo = (CustomerLineVo)DefaultCbmInvoker.Invoke(new GetCustomerLineCbm(), inVo); Customer_dgv.AutoGenerateColumns = false; Customer_dgv.DataSource = outVo.customerLineListVo; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } BindingSource CustomerLineBindingSource = new BindingSource(outVo.customerLineListVo, null); if (CustomerLineBindingSource.Count == 0) { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006); logger.Info(messageData); popUpMessage.Information(messageData, Text); return; } Customer_dgv.ClearSelection(); }
/// <summary> /// binds datasource /// </summary> /// <param name="outVo"></param> private void BindDataSource(List <CustomerLineVo> outVo) { Customer_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(outVo, null); if (bindingSource1 != null && bindingSource1.Count > 0) { Customer_dgv.DataSource = bindingSource1; } else { messageData = new MessageData("tpci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); } Customer_dgv.ClearSelection(); }