示例#1
0
        public void Save(MES_M003_LotTx lotTx, List <MES_M003_LotTx_NG> lotTXNGList)
        {
            tb_Sys_User tempUser    = appCacheService.GetItem("user") as tb_Sys_User;
            var         existslotTx = this.GetById(lotTx.Id);

            if (existslotTx == null)
            {
                lotTx.CompCode   = tempUser.CompCode;
                lotTx.CreateDt   = DateTime.Now;
                lotTx.CreateUser = tempUser.UserName;
                lotTx.Validate();
                this.MES_M003_LotTxRepository.Add(lotTx);
            }
            else
            {
                lotTx.ModifyDt   = DateTime.Now;
                lotTx.ModifyUser = tempUser.UserName;
                lotTx.Validate();
                this.MES_M003_LotTxRepository.SetValues(lotTx, existslotTx);
            }
            if (lotTXNGList != null)
            {
                foreach (var lotTxNG in lotTXNGList)
                {
                    var existstLotTxNG = this.lotTxNGReposiotry.GetByID(lotTxNG.Id);
                    if (existstLotTxNG == null)
                    {
                        lotTxNG.CompCode   = tempUser.CompCode;
                        lotTxNG.CreateDt   = DateTime.Now;
                        lotTxNG.CreateUser = tempUser.UserName;
                        lotTxNG.Validate();
                        this.lotTxNGReposiotry.Add(lotTxNG);
                    }
                    else
                    {
                        lotTxNG.ModifyDt   = DateTime.Now;
                        lotTxNG.ModifyUser = tempUser.UserName;
                        lotTxNG.Validate();
                        this.lotTxNGReposiotry.SetValues(lotTxNG, existstLotTxNG);
                    }
                }
            }
            this.runtimeService.Commit();
        }
示例#2
0
        public void Create(MES_M003_LotTx MES_M003_LotTx)
        {
            MES_M003_LotTx.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M003_LotTx.CreateUser = tempUser.UserName;
            MES_M003_LotTx.CompCode   = tempUser.CompCode;
            MES_M003_LotTx.Validate();
            this.MES_M003_LotTxRepository.Add(MES_M003_LotTx);
            this.runtimeService.Commit();
        }
示例#3
0
        public void Update(MES_M003_LotTx MES_M003_LotTx)
        {
            MES_M003_LotTx.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M003_LotTx.ModifyUser = tempUser.UserName;
            MES_M003_LotTx.Validate();
            var existstb_Sys_Menu = this.GetById(MES_M003_LotTx.Id);

            this.MES_M003_LotTxRepository.SetValues(MES_M003_LotTx, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }