コード例 #1
0
        /// <summary>
        /// binds datasource
        /// </summary>
        /// <param name="outVo"></param>
        private void BindDataSource(List <SapUserVo> outVo)
        {
            SapUserdetails_dgv.AutoGenerateColumns = false;
            BindingSource bindingSource1 = new BindingSource(outVo, null);

            if (bindingSource1 != null && bindingSource1.Count > 0)
            {
                SapUserdetails_dgv.DataSource = bindingSource1;
            }
            else
            {
                messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null);
                logger.Info(messageData);
                popUpMessage.Information(messageData, Text);
            }
            SapUserdetails_dgv.ClearSelection();
        }
コード例 #2
0
        /// <summary>
        /// Fills all user records to gridview control
        /// </summary>
        private void GridBind(SapUserVo conditionInVo)
        {
            SapUserdetails_dgv.DataSource = null;

            try
            {
                SapUserVo outVo = (SapUserVo)InvokeCbm(new GetSapUsersMasterMntCbm(), conditionInVo, false);

                SapUserdetails_dgv.AutoGenerateColumns = false;

                BindingSource bindingSource1 = new BindingSource(outVo.SapUserListVo, null);

                if (bindingSource1.Count > 0)
                {
                    SapUserdetails_dgv.DataSource = bindingSource1;
                    colSapUserId.SortMode         = DataGridViewColumnSortMode.Automatic;
                }
                else
                {
                    messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //Sap user
                    logger.Info(messageData);
                    popUpMessage.Information(messageData, Text);
                }

                SapUserdetails_dgv.ClearSelection();

                Update_btn.Enabled = false;

                Delete_btn.Enabled = false;
            }
            catch (Framework.ApplicationException exception)
            {
                popUpMessage.ApplicationError(exception.GetMessageData(), Text);
                logger.Error(exception.GetMessageData());
            }
        }