Beispiel #1
0
 public SoftPart(string Part, PartType Type, string PID, bool Isflash)
 {
     this.Part = new PartNumber(Part);
     this.Type = Type;
     this.PID = PID;
     this.IsFlash = Isflash;
 }
Beispiel #2
0
        public void OBOM_GetPartsFromEBOM(string FileOBOM, string FileEBOM, string FileEBOMExtra, string FileSWCP, string SWCPSheet, int ColumnBoughtIn, int ColumnAssy)
        {
            IVSStructure EBOM = new IVSStructure(FileEBOM);
            if (FileEBOMExtra != "")
                EBOM.LoadEBOMExtra(FileEBOMExtra);

            if (SWCPSheet != "")
                this.SYMBLE_SWCP = SWCPSheet;

            //OBOM
            string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " + FileOBOM + ";Extended Properties=Excel 8.0";
            OleDbConnection myConn = new OleDbConnection(strCon);
            myConn.Open();
            string strCom = " SELECT * FROM [" + OBOM_SYMBLE_BOM + "$]";
            OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, myConn);
            myDataSet = new DataSet();

            //Read Feature Codes
            myCommand.Fill(myDataSet, "[" + OBOM_SYMBLE_BOM + "$]");
            DataTable OBOM = myDataSet.Tables[0];
            myConn.Close();


            //SWCP
            strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " + FileSWCP + ";Extended Properties=Excel 8.0";
            myConn = new OleDbConnection(strCon);
            myConn.Open();
            strCom = " SELECT * FROM [" + SYMBLE_SWCP + "$] ";
            myCommand = new OleDbDataAdapter(strCom, myConn);
            myDataSet = new DataSet();

            //Read Feature Codes
            myCommand.Fill(myDataSet, SYMBLE_SWCP);
            DataTable SWCP = myDataSet.Tables[0];
            myConn.Close();

            foreach (DataRow t in SWCP.Rows)
            {
                PartNumber theBoughtIn = new PartNumber(t[ColumnAssy].ToString());
                var p = from DataRow q in OBOM.AsEnumerable()
                        where q[2].ToString() == (theBoughtIn.Prefix + theBoughtIn.Infix + theBoughtIn.Suffix)
                        select q;
                int count = 0;
                foreach (var l in p)
                    count++;
                if (count != 0)
                {
                    PartLineage theModule = EBOM.GetModuleByAssyPN(t[ColumnAssy].ToString());
                    this.PARTS += theModule.ToBroadcast();
                }
            } 
        }