Пример #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);
                }
            }
        }