Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CurrentSpecs.IsCheckAll = true;
            foreach (ListViewItem item in lvMain.Items)
            {
                SpecsDetail detail = CurrentSpecs.FindByID(Int32.Parse(item.Tag.ToString()));
                detail.isChecked = item.Checked;
                if (!detail.isChecked)
                {
                    CurrentSpecs.IsCheckAll = false;
                }
            }
            //JobDetail jobdetail = CurrentJob.FindBySpecsID(CurrentSpecs.ID);
            JobDetail jobdetail = CurrentJob.findByBarCode(CurrentSpecs.BarCode);

            if (jobdetail == null)
            {
                jobdetail = new JobDetail();
            }
            jobdetail.JobID           = CurrentJob.ID;
            jobdetail.SpecsID         = CurrentSpecs.ID;
            jobdetail.CheckTime       = DateTime.Now;
            jobdetail.isChecked       = CurrentSpecs.IsCheckAll;
            jobdetail.CheckDetailList = CurrentSpecs.CheckDetailList;
            jobdetail.BarCode         = CurrentSpecs.BarCode;
            CurrentJob.Items.Add(jobdetail);
            if (jobdetail.ID == 0)
            {
                jobdetail.ID              = DbFactory.JobDetailInsert(jobdetail);
                CurrentJob.CheckPosition += 1;
            }
            else
            {
                DbFactory.JobDetailUpdate(jobdetail);
            }


            //DbFactory.SaveJob(CurrentJob);
            if (AppHelper.IsLockOnCheck == false)
            {
                Specs spec = DbFactory.FindBySequence(CurrentSpecs.Sequence + 1, CurrentJob.IsFull);
                if (spec != null)
                {
                    CurrentSpecs = spec;
                    InitView();
                }
                else
                {
                    //work done.
                    MessageBox.Show("已经检查到最大序号!");
                }
            }
            else
            {
                InitView();
            }
        }
Ejemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (CurrentSpecs == null)
            {
                return;
            }
            Int32 sequ = CurrentSpecs.Sequence + 1;

            if (sequ >= CurrentJob.NeedCheckPosition)
            {
                sequ = CurrentJob.NeedCheckPosition;
            }
            Specs spec = DbFactory.FindBySequence(sequ, CurrentJob.IsFull);

            if (spec != null)
            {
                CurrentSpecs = spec;
                InitView();
            }
        }
Ejemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (CurrentSpecs == null)
            {
                return;
            }
            Int32 sequ = CurrentSpecs.Sequence - 1;

            if (sequ <= 0)
            {
                sequ = 1;
            }
            Specs spec = DbFactory.FindBySequence(sequ, CurrentJob.IsFull);

            if (spec != null)
            {
                CurrentSpecs = spec;
                InitView();
            }
        }
Ejemplo n.º 4
0
 private void txtSequ_ValueChanged(object sender, EventArgs e)
 {
     CurrentSpecs = DbFactory.FindBySequence(Int32.Parse(txtSequ.Value.ToString()), true);
     InitView();
 }
Ejemplo n.º 5
0
 private void FormSpecsEdit_Load(object sender, EventArgs e)
 {
     CurrentSpecs = DbFactory.FindBySequence(1, true);
     InitCombobox();
     InitView();
 }