Exemple #1
0
        private void PrintJobNo()
        {
            MES_M002_Job  temp          = mESM002JobBindingSource.Current as MES_M002_Job;
            JobReportForm jobReportForm = new JobReportForm();

            jobReportForm.CreateReport(temp.JobNo, null);
            jobReportForm.Show();
        }
Exemple #2
0
        /// <summary>
        /// baocun
        /// </summary>
        /// <param name="job"></param>
        /// <param name="lotList"></param>
        public void Save(MES_M002_Job job, List <MES_M002_Job_Lot> lotList, List <MES_M002_Job_Lot_Process> jobLotProcessList)
        {
            tb_Sys_User tempUser  = appCacheService.GetItem("user") as tb_Sys_User;
            var         existsJob = this.GetById(job.Id);

            if (existsJob == null)
            {
                job.CompCode   = tempUser.CompCode;
                job.CreateDt   = DateTime.Now;
                job.CreateUser = tempUser.UserName;
                job.Validate();
                this.MES_M002_JobRepository.Add(job);
            }
            else
            {
                job.ModifyDt   = DateTime.Now;
                job.ModifyUser = tempUser.UserName;
                job.Validate();
                this.MES_M002_JobRepository.SetValues(job, existsJob);
            }
            if (lotList != null)
            {
                foreach (var lot in lotList)
                {
                    var existstlot = this.jobLotRepository.GetByID(lot.Id);
                    if (existstlot == null)
                    {
                        lot.CompCode   = tempUser.CompCode;
                        lot.CreateDt   = DateTime.Now;
                        lot.CreateUser = tempUser.UserName;
                        lot.Validate();
                        this.jobLotRepository.Add(lot);
                    }
                    else
                    {
                        //lot.ModifyDt = DateTime.Now;
                        lot.ModifyUser = tempUser.UserName;
                        lot.Validate();
                        this.jobLotRepository.SetValues(lot, existstlot);
                    }
                }
            }
            if (jobLotProcessList != null && jobLotProcessList.Count > 0)
            {
                string Sqlcommand = string.Format("delete dbo.MES_M002_Job_Lot_Process where JobNo = '{0}'", job.JobNo);
                joblotProcessRepository.GetDbContext().Database.ExecuteSqlCommand(Sqlcommand);
                foreach (var lotProcess in jobLotProcessList)
                {
                    lotProcess.CompCode   = tempUser.CompCode;
                    lotProcess.CreateDt   = DateTime.Now;
                    lotProcess.CreateUser = tempUser.UserName;
                    lotProcess.Validate();
                    this.joblotProcessRepository.Add(lotProcess);
                }
            }
            this.runtimeService.Commit();
        }
Exemple #3
0
        public void Create(MES_M002_Job MES_M002_Job)
        {
            MES_M002_Job.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            MES_M002_Job.CreateUser = tempUser.UserName;
            MES_M002_Job.CompCode   = tempUser.CompCode;
            MES_M002_Job.Validate();
            this.MES_M002_JobRepository.Add(MES_M002_Job);
            this.runtimeService.Commit();
        }
Exemple #4
0
        public void Update(MES_M002_Job MES_M002_Job)
        {
            MES_M002_Job.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

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

            this.MES_M002_JobRepository.SetValues(MES_M002_Job, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Exemple #5
0
        private void EditForm(string formText, string btnCommand)
        {
            MES_M002_Job temp = mESM002JobBindingSource.Current as MES_M002_Job;
            JobEditForm  edit = new JobEditForm(temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                mESM002JobBindingSource.CancelEdit();
            }
        }
Exemple #6
0
 public JobEditForm(MES_M002_Job jobData)
 {
     InitializeComponent();
     this.jobData = jobData;
 }