Exemple #1
0
        public ctrPlanSn(string planId, string batchCode)
        {
            InitializeComponent();
            Batch_Code  = batchCode;
            CompanyCode = LoginInfo.CompanyInfo.COMPANY_CODE;
            PlineCode   = LoginInfo.ProductLineInfo.RMES_ID;
            StationCode = LoginInfo.StationInfo.STATION_CODE;

            List <PlanSnEntity> listSnData = PlanSnFactory.GetSnByPlanCode(planId);
            string adstatus = "A";

            try
            {
                //dataConn dc = new dataConn();
                adstatus = dataConn.GetValue(" select increase_flag from code_sn where pline_code='" + LoginInfo.ProductLineInfo.PLINE_CODE + "' ");
                //dataConn.CloseConn();
            }
            catch { }
            if (adstatus != "A")
            {
                listSnData = PlanSnFactory.GetSnByPlanCodedesc(planId);
            }


            listSn.Items.Clear();
            int i = 0;
            int j = 1;

            foreach (PlanSnEntity se in listSnData)
            {
                listSn.Items.Add((j++) + "--" + se.SN + "--" + se.SN_FLAG);
                if (se.SN_FLAG != "N")
                {
                    i++;
                }
            }
            label1.Text = "计划流水号总数:" + listSnData.Count + ";已上线计划流水号数量:" + i;
        }
Exemple #2
0
        private void GridPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //得到计划号
            if (e.RowIndex < 0)
            {
                return;
            }
            ////string plan_code = GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value.ToString();
            ////string stationcode1 = "";
            ////try
            ////{
            ////    stationcode1 = LoginInfo.StationInfo.STATION_CODE;
            ////}
            ////catch { }
            ////if (stationcode1 == "")
            ////{
            ////    MessageBox.Show("站点为空!","提示");
            ////    return;
            ////}
            ////Form form13 = new Form();
            ////form13.Text = "BOM查看";
            ////form13.WindowState = FormWindowState.Maximized;
            ////ctrlShowBom print13 = new ctrlShowBom(plan_code, stationcode1);
            ////print13.Width = 1000;
            ////print13.Height = 500;
            ////print13.Top = 6;
            ////print13.Left = 6;
            ////form13.Controls.Add(print13);
            ////form13.Show(this);

            //timer1.Enabled = false;
            if (string.IsNullOrWhiteSpace(GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value as string))
            {
                return;
            }
            string plan_code = GridPlan.Rows[e.RowIndex].Cells["ColPlanCode"].Value.ToString();
            //string item_code = GridPlan.Rows[e.RowIndex].Cells["colPlanSo"].Value.ToString();
            //string batch_code = GridPlan.Rows[e.RowIndex].Cells["colPlanBatch"].Value.ToString();
            //string order_code = GridPlan.Rows[e.RowIndex].Cells["colOrderCode"].Value.ToString();
            //string sn_flag=GridPlan.Rows[e.RowIndex].Cells["colSnFlag"].Value.ToString();

            //if (!TheProcessValid(plan_code))
            //{
            //    MessageBox.Show("前一工序没有完成!", "工序错误提示");
            //    return;
            //}

            List <PlanSnEntity> lstsn = PlanSnFactory.GetSnByPlanCode(plan_code);

            if (lstsn.Count > 0)//如果已经有SN在data_plan_sn表中
            {
                FrmShowPlanSn ps = new FrmShowPlanSn(plan_code, "");
                ps.Show();
            }
            //else//这是另一种逻辑,没有预分配SN,则不按序列号管理。
            //{

            //    RMESEventArgs thisEventArg = new RMESEventArgs();
            //    thisEventArg.MessageHead = "PLAN";
            //    thisEventArg.MessageBody = plan_code;
            //   SendDataChangeMessage(thisEventArg);

            //}
        }