当前位置: 首页>>代码示例>>C#>>正文


C# Snapshot.CompareData方法代码示例

本文整理汇总了C#中Snapshot.CompareData方法的典型用法代码示例。如果您正苦于以下问题:C# Snapshot.CompareData方法的具体用法?C# Snapshot.CompareData怎么用?C# Snapshot.CompareData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Snapshot的用法示例。


在下文中一共展示了Snapshot.CompareData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btn_Setting_Fill_SWCP_Click

        private void btn_Setting_Fill_SWCP_Click(object sender, EventArgs e)
        {


            //Test Codes
            /*
            Snapshot a = new Snapshot();
            a.Load(this.tbx_Setting_Snapshot.Text);
            test = a.CompareData("ABS", "F190", "L2CVA2BG6FG000518");
            */
            //End of Test Codes


            tbx_SWCP_Result.Text = "";
            try
            {
                tbc_Main.SelectTab(tbp_SWCPGen.Name);
                IVSStructure EBOM = new IVSStructure(tbx_Setting_EBOM.Text);
                Snapshot theSS = new Snapshot();
                DirectoryInfo theVBFDir;
                DirectoryInfo ExportVBFDir;
                string[] VBFFileNameList = new string[1];


                if (cbx_SWCP_ifCompare.Checked == true)
                {
                    if (theSS.Load(this.tbx_Setting_Snapshot.Text))
                    {

                    }
                    else
                    {
                        throw new Exception("SnapShot File Error, Please choose again");
                    }
                }

                if (cbx_SWCP_CompareVBF.Checked)
                {
                    theVBFDir = new DirectoryInfo(this.tbx_Setting_VBFFolder.Text);
                    FileInfo[] VBFList = theVBFDir.GetFiles();
                    VBFFileNameList = new string[VBFList.Length];
                    for (int j = 0; j < VBFList.Length; j++)
                    {
                        VBFFileNameList[j] = VBFList[j].Name.ToUpper();
                    }
                }

                if (cbx_SWCP_ExportVBF.Checked)
                {
                    theVBFDir = new DirectoryInfo(this.tbx_Setting_VBFFolder.Text);
                    FileInfo[] VBFList = theVBFDir.GetFiles();
                    VBFFileNameList = new string[VBFList.Length];
                    for (int j = 0; j < VBFList.Length; j++)
                    {
                        VBFFileNameList[j] = VBFList[j].Name.ToUpper();
                    }
                    if (fbd_SWCP_ExportVBF.ShowDialog() == DialogResult.OK)
                    {
                        ExportVBFDir = new DirectoryInfo(fbd_SWCP_ExportVBF.SelectedPath);
                    }
                    else
                    {
                        throw new Exception("Please select VBF Export Folder");
                    }
                }
                


                if (tbx_Setting_EBOMExtra.Text != "")
                    EBOM.LoadEBOMExtra(tbx_Setting_EBOMExtra.Text);
                if (tbx_Setting_EBOMExtra.Text != "")
                    EBOM.LoadEBOMExtra(tbx_Setting_EBOMExtra.Text);
                Microsoft.Office.Interop.Excel.Application xlApp = null;
                Microsoft.Office.Interop.Excel.Workbook xlBook = null;
                Microsoft.Office.Interop.Excel.Worksheet xlSheet = null;
                object missing = Missing.Value;

                xlApp = new Microsoft.Office.Interop.Excel.Application();
                xlBook = xlApp.Workbooks.Add(tbx_Setting_SWCP.Text);
                xlSheet = xlBook.Sheets[tbx_Setting_SWCPSheetName.Text];

                int i = 2;
                while (IVSStructure.isValidPN(xlSheet.Cells[Convert.ToInt32(nud_Setting_SWCPTopAssyCol.Value)][i].Value))
                {


                    PartLineage PN = EBOM.GetModuleByAssyPN(xlSheet.Cells[nud_Setting_SWCPTopAssyCol.Value][i].Value);
                    if (PN == null)
                    {
                        tbx_SWCP_Result.AppendText("Warning:" + xlSheet.Cells[nud_Setting_SWCPTopAssyCol.Value][i].Value + " Data NOT Found in EBOM\r\n");
                        xlSheet.Cells[nud_Setting_Comment_Column.Value][i].Value = "Part Number NOT Found in EBOM";
                    }
                    else
                    {
                        tbx_SWCP_Result.AppendText("Working on " + xlSheet.Cells[nud_Setting_SWCPTopAssyCol.Value][i].Value);
                        //ECU Address
                        if (PN.NodeAddr != null)
                        {
                            xlSheet.Cells[(Convert.ToInt32(nud_Setting_EDUAddress_Column.Value))][i].Value = ("0x" + PN.NodeAddr);
                        }
//.........这里部分代码省略.........
开发者ID:demonzhq,项目名称:JLR,代码行数:101,代码来源:SoftwareTools.cs


注:本文中的Snapshot.CompareData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。