private void AddModel(TransactionContext trxContext, ValueObjectList <MoldItemVo> moldModelInVo)
        {
            foreach (MoldItemVo moldModelVo in moldModelInVo.GetList())
            {
                // Checking existing data
                Vo.ModelVo modelInVo = new Vo.ModelVo();

                modelInVo.ModelCode = moldModelVo.ModelCode;
                modelInVo.ModelName = moldModelVo.ModelCode;


                ValueObjectList <ModelVo> modelCheckVo = (ValueObjectList <ModelVo>)checkModelMasterMntCbm.Execute(trxContext, modelInVo);

                if (modelCheckVo != null && modelCheckVo.GetList() != null && modelCheckVo.GetList().Count > 0)
                {
                    foreach (Vo.ModelVo curVo in modelCheckVo.GetList())
                    {
                        if (!modelList.ContainsKey(curVo.ModelCode))
                        {
                            modelList.Add(curVo.ModelCode, curVo.ModelId);
                        }
                    }
                }
                else
                {
                    Vo.ModelVo modelOutVo = (Vo.ModelVo)addModelMasterMntCbm.Execute(trxContext, modelInVo);
                    modelList.Add(modelInVo.ModelCode, modelOutVo.ModelId);
                }
            }
        }
Пример #2
0
        private void GridBind()
        {
            Machine_dgv.DataSource = null;

            try
            {
                ModelVo vo = new Vo.ModelVo
                {
                    ModelCode = ModelCode_txt.Text,
                    ModelName = ModelName_txt.Text
                };
                ValueObjectList <ModelVo> volist = (ValueObjectList <ModelVo>)DefaultCbmInvoker.Invoke(new GetModelCbm(), 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());
            }
        }