Exemple #1
0
 protected void ctrlPrintOffline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
 {
     if (e.MessageHead == "OFFLINE")
     {
         string[] txt = e.MessageBody.ToString().Split('^');
         Sn = txt[0];
         string       quality_status = txt[1];
         PlanSnEntity plansn1        = PlanSnFactory.GetBySn(Sn);
         PlanCode = plansn1.PLAN_CODE;
         PrintOfflineLabel();
     }
     else if (e.MessageHead == "SN")
     {
         RMESEventArgs args = new RMESEventArgs();
         args.MessageHead = "OFFCTRL";
         args.MessageBody = "";
         SendDataChangeMessage(args);
     }
 }
Exemple #2
0
        protected void ctrlStationOnline_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string plan_code, sn, order_code, sn_flag;

            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "ONLINE")
            {
                //DialogResult dlg=MessageBox.Show("是否上线", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ;
                //if (dlg == DialogResult.No) return;

                sn = e.MessageBody.ToString();

                //获取当前第一条计划的未上线流水号,打印流水号
                //流水号做上线
                PlanSnEntity ent_sn = PlanSnFactory.GetBySn(sn);
                if (ent_sn == null)//如果没有sn,则msgbd为plancode
                {
                    plan_code = "";
                    sn        = "";
                    MessageBox.Show("流水号非法!", "提示");
                    //sn = PlanFactory.GetByKey(plan_code).PLAN_BATCH;
                }
                else
                {
                    //order_code = PlanSnFactory.GetBySn(sn).ORDER_CODE;
                    //plan_code = PlanFactory.GetByOrder(order_code).PLAN_CODE;
                    plan_code = ent_sn.PLAN_CODE;
                }

                ProductDataFactory.Station_OnLine(plan_code, sn, DateTime.Now.ToString("yyyy-MM-dd"), LoginInfo.StationInfo.STATION_CODE, LoginInfo.ShiftInfo.SHIFT_CODE, LoginInfo.TeamInfo.TEAM_CODE, LoginInfo.UserInfo.USER_CODE);

                RMESEventArgs arg = new RMESEventArgs();
                arg.MessageHead = "SN";
                arg.MessageBody = sn;
                SendDataChangeMessage(arg);
            }
        }
Exemple #3
0
        private bool DealSn(string pSn)
        {
            string        sn      = pSn;
            RMESEventArgs arg     = new RMESEventArgs();
            PlanSnEntity  plansn1 = PlanSnFactory.GetBySn(sn);

            if (plansn1 == null)
            {
                return(false);
            }
            arg.MessageHead = plansn1.SN_FLAG == "N" ? "ONLINE" : "SN";
            string plan_code = plansn1.PLAN_CODE;
            string quality_status = "A", complete_flag = "0";

            List <ProductCompleteEntity> prc = ProductCompleteFactory.GetByPlanSn(CompanyCode, PlineCode, plan_code, sn, StationCode);

            if (prc.Count > 0)
            {
                complete_flag = prc.First <ProductCompleteEntity>().COMPLETE_FLAG;
            }
            if (complete_flag == "1")
            {
                MessageBox.Show("此项装配任务已经完成下线");
                return(false);
            }
            List <ProductDataEntity> prd = ProductDataFactory.GetProductDataByPlanSn(CompanyCode, PlineCode, plan_code, sn);

            //if (prd.Count > 0) quality_status = prd.First<ProductDataEntity>().QUALITY_STATUS;
            if (quality_status == "B")
            {
                DialogResult dlg = MessageBox.Show("此项装配工件质量不合格,要继续装配吗", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dlg == DialogResult.No)
                {
                    return(false);
                }
            }
            return(true);
        }