Beispiel #1
0
        private void textBox_CurPlanNo_Fisrt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                var planId = this.textBox_CurPlanNo_Fisrt.Text.Trim();

                using (_dbcontext = new FlowManageSystemEntities())
                {
                    orderRepositoy = new OrderRepository(_dbcontext);

                    if (!orderRepositoy.PlanNoExist(planId))
                    {
                        MessageBox.Show("计划单号不存在,请输入正确的单号!!!");
                        return;
                    }

                    var order  = orderRepositoy.getOrderByPlanNo(planId);
                    var snMin  = order.SnMin;
                    var snMax  = order.SnMax;
                    var needDo = order.OnLineQuantity;

                    //根据SN范围查询已经做了测试的
                    using (_opwayDbContext = new ATSDATABASEEntities())
                    {
                        opwayDataRepository = new OpwayDataRepository(_opwayDbContext);


                        //拿到已做的数量更新界面
                        var count = 0;
                        if (this.cBox_FistUndo.Checked == true)
                        {
                            var listFinishedSn = opwayDataRepository.GetFistTestFinishedSN(snMin, snMax);
                            var AllList        = SnHelper.GetSnlist(snMin, needDo);
                            count = listFinishedSn.Count();
                            //更新界面未做的SN
                            this.ltBox_FistUndo.DataSource = AllList.Except(listFinishedSn).ToList();
                        }
                        else
                        {
                            count = opwayDataRepository.GetFirstTestCount(snMin, snMax);
                        }
                        this.lbFistTestFinished.Text = count.ToString();
                    }
                }
            }
        }
Beispiel #2
0
        private void textBox_searchPlanOrder_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                var planId = this.textBox_searchPlanOrder.Text.Trim();

                using (var dbContext = new FlowManageSystemEntities())
                {
                    orderRepositoy = new OrderRepository(dbContext);

                    collectionRepository = new CollectionRepository(dbContext);

                    assembleRepository = new AssembleRepository(dbContext);

                    if (!orderRepositoy.PlanNoExist(planId))
                    {
                        MessageBox.Show("计划单号不存在,请输入正确的单号!!!");
                        return;
                    }

                    //更新界面--订单相关信息
                    var order   = orderRepositoy.getOrderByPlanNo(planId);
                    var orderId = order.OrderId;

                    this.lbOrderDate.Text       = order.OrderDate.ToShortDateString();
                    this.lbPlanOnlineDate.Text  = order.PlannedLaunchDate.ToShortDateString();
                    this.lbDemandDate.Text      = order.CustomDemandDate.ToShortDateString();
                    this.lbPlanStorageDate.Text = order.PlanStorageDate.ToShortDateString();

                    //更新界面--领料相关信息
                    if (collectionRepository.IsOrderCollectionExist(orderId))
                    {
                        var collectionInfo = collectionRepository.GetCurrentOrderCollectionInfo(orderId);

                        this.lbCollectionCount.Text = collectionInfo.Item1.ToString();
                        this.lbCollectionTime.Text  = collectionInfo.Item2.ToString();
                    }
                    else
                    {
                        this.lbCollectionCount.Text = "未领取物料";
                        this.lbCollectionTime.Text  = "";
                    }

                    //更新界面--组装相关信息
                    if (assembleRepository.IsOrderAssembleExist(orderId))
                    {
                        var collectionInfo = assembleRepository.GetCurrentOrderAssembleInfo(orderId);
                        this.lbAssembleCount.Text = collectionInfo.Item1.ToString();
                        this.lbAssembleTime.Text  = collectionInfo.Item2.ToString();
                    }
                    else
                    {
                        this.lbCollectionCount.Text = "未开始组装";
                        this.lbCollectionTime.Text  = "";
                    }

                    //初调相关信息  //终测相关信息
                    using (_opwayDbContext = new ATSDATABASEEntities())
                    {
                        opwayDataRepository = new OpwayDataRepository(_opwayDbContext);

                        var snMin = order.SnMin;
                        var snMax = order.SnMax;

                        this.lbFirstTestCount.Text = opwayDataRepository.GetFirstTestCount(snMin, snMax).ToString();

                        this.lbFInishedTestCount.Text = opwayDataRepository.GetLastTestCount(snMin, snMax).ToString();
                    }
                }
            }
        }