示例#1
0
        public void Save(MES_M202_Task_Detail taskDetail, List <MES_M202_Task_JobLot> taskJobLotList)
        {
            tb_Sys_User tempUser   = appCacheService.GetItem("user") as tb_Sys_User;
            var         existstemp = this.GetById(taskDetail.Id);

            if (existstemp == null)
            {
                taskDetail.CompCode   = tempUser.CompCode;
                taskDetail.CreateDt   = DateTime.Now;
                taskDetail.CreateUser = tempUser.UserName;
                taskDetail.Validate();
                this.MES_M202_Task_DetailRepository.Add(taskDetail);
            }
            else
            {
                taskDetail.ModifyDt   = DateTime.Now;
                taskDetail.ModifyUser = tempUser.UserName;
                taskDetail.Validate();
                this.MES_M202_Task_DetailRepository.SetValues(taskDetail, existstemp);
            }
            if (taskJobLotList != null)
            {
                string sql = string.Format("Delete MES_M202_Task_JobLot where JobNo = '{0}'", taskDetail.TaskNo);
                taskJobLotRepository.GetDbContext().Database.ExecuteSqlCommand(sql);
                foreach (var taskJobLot in taskJobLotList)
                {
                    taskJobLot.JobNo    = taskDetail.TaskNo;
                    taskJobLot.CompCode = tempUser.CompCode;
                    taskJobLot.Validate();
                    this.taskJobLotRepository.Add(taskJobLot);
                }
            }
            this.runtimeService.Commit();
        }
示例#2
0
        public void Save(MES_M501_JobTx MES_M501_JobTx, MES_M202_Task_Detail task, List <MES_M501_JobTx_NG> jobLotNgList)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            var existsdevice = this.GetById(MES_M501_JobTx.Id);

            if (existsdevice == null)
            {
                MES_M501_JobTx.CompCode   = tempUser.CompCode;
                MES_M501_JobTx.CreateDt   = DateTime.Now;
                MES_M501_JobTx.CreateUser = tempUser.UserName;
                MES_M501_JobTx.Validate();
                this.MES_M501_JobTxRepository.Add(MES_M501_JobTx);
            }
            else
            {
                MES_M501_JobTx.ModifyDt   = DateTime.Now;
                MES_M501_JobTx.ModifyUser = tempUser.UserName;
                MES_M501_JobTx.Validate();
                this.MES_M501_JobTxRepository.SetValues(MES_M501_JobTx, existsdevice);
            }

            var existsmatSupp = this.taskRepository.GetByID(task.Id);

            if (existsmatSupp == null)
            {
                task.CompCode   = tempUser.CompCode;
                task.CreateDt   = DateTime.Now;
                task.CreateUser = tempUser.UserName;
                task.Validate();
                this.taskRepository.Add(task);
            }
            else
            {
                task.ModifyDt   = DateTime.Now;
                task.ModifyUser = tempUser.UserName;
                task.Validate();
                this.taskRepository.SetValues(task, existsmatSupp);
            }
            foreach (var jobLotNg in jobLotNgList)
            {
                jobLotNg.CompCode   = tempUser.CompCode;
                jobLotNg.CreateDt   = DateTime.Now;
                jobLotNg.CreateUser = tempUser.UserName;
                jobLotNg.Validate();
                jobtxNgRepository.Add(jobLotNg);
            }

            this.runtimeService.Commit();
        }
示例#3
0
        public void Create(MES_M202_Task_Detail MES_M202_Task_Detail)
        {
            MES_M202_Task_Detail.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

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

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

            this.MES_M202_Task_DetailRepository.SetValues(MES_M202_Task_Detail, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
示例#5
0
        public void ShenHe(MES_M202_Task_Detail mesM202TaskDetail)
        {
            mesM202TaskDetail.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            mesM202TaskDetail.ModifyUser = tempUser.UserName;
            mesM202TaskDetail.Status     = "04";
            mesM202TaskDetail.Auditor    = tempUser.UserName;
            mesM202TaskDetail.AuditingDt = DateTime.Now;
            mesM202TaskDetail.Validate();
            var existstb_Sys_Menu = this.GetById(mesM202TaskDetail.Id);

            this.MES_M202_Task_DetailRepository.SetValues(mesM202TaskDetail, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }