示例#1
0
        private void SortMtls()
        {
            EpicorVPartSearch evps  = new EpicorVPartSearch();
            EpicorPartRev     eprev = new EpicorPartRev();

            foreach (string anitem in partBom)
            {
                if (anitem[0] == '%')
                {
                    continue;
                }

                bool rohsTag;
                bool subTag = evps.CheckSubRohs(anitem, out rohsTag);
                if (!subTag)
                {
                    MfgDataSubPart mdsp = new MfgDataSubPart();
                    subTag = mdsp.CheckPartExist(anitem);
                }

                if (subTag)
                {
                    string partNum = anitem;;
                    string pRev    = "";
                    // find the version first
                    if (anitem.IndexOf("=") == -1)
                    {
                        pRev = eprev.GetRevision(anitem);
                    }
                    else
                    {
                        string pn = "";
                        DBHelper.Util.ExtractPartInfo(anitem, ref pn, ref pRev);
                    }

                    PartBOM pb = new PartBOM(partNum, pRev);
                    if (!pb.GetBomRohsFlag())
                    {
                        this.bomRohs = false;
                    }
                    subs.Add(pb);
                }
                else
                {
                    MtlRohs mr = new MtlRohs();
                    mr.PartNum = anitem;
                    if (rohsTag)
                    {
                        mr.Rohs = true;
                    }
                    else
                    {
                        mr.Rohs      = false;
                        this.bomRohs = false;
                    }
                    endMtls.Add(mr);
                }
            } // foreach
        }     // SortMtls()
示例#2
0
        //private void partText_KeyUp(object sender, KeyEventArgs e)
        //{
        //    if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Tab))
        //    {
        //        chkBtn.Enabled = true;
        //        chkBtn.Select();
        //        resetBtn.Enabled = true;
        //        jobText.Enabled = false;
        //        partText.Enabled = false;
        //        verUD.Enabled = false;
        //    }
        //}

        private void chkBtn_Click(object sender, EventArgs e)
        {
            try
            {
                // Process input
                bool       goodToGo = false;
                MfgDataJob checkJob = new MfgDataJob();

                if (jobText.Text.Length == 5)
                {
                    DataTable dt = checkJob.SelectTbl(jobText.Text.ToString());

                    if (dt.Rows.Count != 0)
                    {
                        DataRow dr = dt.Rows[0];
                        partText.Text = dr["PartNumber"].ToString();
                        //verUD.Value = Convert.ToDecimal(dr["PartVersion"].ToString());
                        verText.Text = dr["PartVersion"].ToString();
                        goodToGo     = true;
                    }
                    else
                    {
                        MessageBox.Show("Cannot find the job " + jobText.Text + " in SQL Job table");
                    }
                }
                //else if (partText.Text.Length > 0)
                //{
                //    string tmp = checkJob.GetJobWithPart(partText.Text, verUD.Value.ToString());

                //    if (!string.IsNullOrEmpty(tmp))
                //    {
                //        jobText.Text = tmp;
                //        goodToGo = true;
                //    }
                //    else
                //    {
                //        MessageBox.Show("Cannot find the job with the Part Number and the Version provided in SQL Job table");
                //    }
                //}

                if (goodToGo)
                {
                    // application logic start here

                    ///PartBOM pb = new PartBOM(partText.Text, verUD.Value.ToString());
                    PartBOM pb       = new PartBOM(partText.Text, verText.Text.ToString());
                    bool    rohsYorn = pb.GetBomRohsFlag();

                    // Save the checking result to Job table
                    checkJob.UpdateROHS(jobText.Text, rohsYorn);

                    string msg = string.Format("This job BOM is ROHS complied - {0}", rohsYorn.ToString());
                    toolStripStatusLabel1.Text = msg;
                    //MessageBox.Show(msg);

                    DisplayBOMtree(pb, null);
                }

                chkBtn.Enabled = false;
            }
            catch (Exception ee)
            {
                string tmp = DBHelper.Util.RemoveSingleQuote(ee.ToString());
                //MfgDataTraceRecord.LogRecord(tmp);
                MessageBox.Show(ee.ToString());
            }
        }