private void GridBind()
        {
            Machine_dgv.DataSource = null;

            try
            {
                GroupMachineVo vo = new Vo.GroupMachineVo
                {
                    GroupMachineName = GroupMachine_cmb.Text
                };
                ValueObjectList <GroupMachineVo> volist = (ValueObjectList <GroupMachineVo>)DefaultCbmInvoker.Invoke(new GetGroupMachineCbm(), vo);
                if (volist.GetList() != null && volist.GetList().Count > 0)
                {
                    Machine_dgv.AutoGenerateColumns = false;
                    BindingSource bindingSource1 = new BindingSource(volist.GetList(), null);
                    Machine_dgv.DataSource = bindingSource1;
                }
                else
                {
                    messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null);
                    logger.Info(messageData);
                    popUpMessage.Information(messageData, Text);
                }
                Machine_dgv.ClearSelection();

                Update_btn.Enabled = false;

                Delete_btn.Enabled = false;
            }
            catch (Com.Nidec.Mes.Framework.ApplicationException exception)
            {
                popUpMessage.ApplicationError(exception.GetMessageData(), Text);
                logger.Error(exception.GetMessageData());
            }
        }
示例#2
0
        /// <summary>
        /// Fills all user records to gridview control
        /// </summary>
        private void GridBind(MachineVo conditionInVo)
        {
            Machine_dgv.DataSource = null;

            try
            {
                MachineVo outVo = (MachineVo)base.InvokeCbm(new GetMachineMasterMntCbm(), conditionInVo, false);

                Machine_dgv.AutoGenerateColumns = false;

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

                if (bindingSource1.Count > 0)
                {
                    Machine_dgv.DataSource = bindingSource1;
                }
                else
                {
                    messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //process
                    logger.Info(messageData);
                    popUpMessage.Information(messageData, Text);
                }

                Machine_dgv.ClearSelection();

                Update_btn.Enabled = false;

                Delete_btn.Enabled = false;
            }
            catch (Framework.ApplicationException exception)
            {
                popUpMessage.ApplicationError(exception.GetMessageData(), Text);
                logger.Error(exception.GetMessageData());
            }
        }
        private void GroupMachineForm_Load(object sender, EventArgs e)
        {
            ValueObjectList <GroupMachineVo> machinevo = (ValueObjectList <GroupMachineVo>)DefaultCbmInvoker.Invoke(new GetGroupMachineNameCbm(), new GroupMachineVo());

            GroupMachine_cmb.DisplayMember = "GroupMachineName";
            BindingSource b4 = new BindingSource(machinevo.GetList(), null);

            GroupMachine_cmb.DataSource = b4;
            GroupMachine_cmb.ResetText();

            Machine_dgv.ClearSelection();

            Update_btn.Enabled = false;

            Delete_btn.Enabled = false;
        }
示例#4
0
        /// <summary>
        /// binds datasource
        /// </summary>
        /// <param name="outVo"></param>
        private void BindDataSource(List <MachineVo> outVo)
        {
            Machine_dgv.AutoGenerateColumns = false;
            BindingSource bindingSource1 = new BindingSource(outVo, null);

            if (bindingSource1 != null && bindingSource1.Count > 0)
            {
                Machine_dgv.DataSource = bindingSource1;
            }
            else
            {
                messageData = new MessageData("tpci00006", Properties.Resources.mmci00006, null);
                logger.Info(messageData);
                popUpMessage.Information(messageData, Text);
            }
            Machine_dgv.ClearSelection();
        }