Ejemplo n.º 1
0
        private void GridPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //得到计划号
            if (e.RowIndex < 0)
            {
                return;
            }
            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 sn_flag = GridPlan.Rows[e.RowIndex].Cells["colSnFlag"].Value.ToString();


            ItemEntity iItem = ItemFactory.GetByItem(LoginInfo.CompanyInfo.COMPANY_CODE, item_code);

            if (iItem != null)
            {
                if (iItem.MANAGE_FLAG == "A")
                {
                    FrmShowPlanSn ps = new FrmShowPlanSn(plan_code, batch_code);
                    ps.Show();
                }
                else if (iItem.MANAGE_FLAG == "A" && sn_flag == "N")
                {
                    List <ProductInfoEntity> newProduct   = ProductInfoFactory.GetByCompanyCodeSN(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code);
                    RMESEventArgs            thisEventArg = new RMESEventArgs();
                    if (newProduct.Count != 0)
                    {
                        thisEventArg.MessageHead = "SN";
                        thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>();
                    }
                }
                else
                {
                    List <ProductInfoEntity> newProduct   = ProductInfoFactory.GetByCompanyCodeBatch(LoginInfo.CompanyInfo.COMPANY_CODE, batch_code);
                    RMESEventArgs            thisEventArg = new RMESEventArgs();
                    if (newProduct.Count != 0)
                    {
                        thisEventArg.MessageHead = "BATCH";
                        thisEventArg.MessageBody = newProduct.First <ProductInfoEntity>();
                    }
                    else
                    {
                        thisEventArg.MessageHead = null;
                        thisEventArg.MessageBody = null;
                    }
                    SendDataChangeMessage(thisEventArg);
                }
            }
        }
Ejemplo n.º 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);

            //}
        }