コード例 #1
0
 private void createPeopleTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.people_table();
 }
コード例 #2
0
 private void fastenerTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.ini_fasttable();
 }
コード例 #3
0
 private void createEveryDayTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.everyday_table();
 }
コード例 #4
0
        public static void creatVERI(Dictionary <string, string> rncaao, bool overcover = false, bool closeword = true)
        {
            BackupOperation.backupfile(rncaao["鉴定表保存地址"]);
            if (!rncaao.Keys.Contains("图纸名称"))
            {
                rncaao.Add("图纸名称", AutorivetDB.queryno(rncaao["图号"], "图纸名称"));
            }



            var wordApp = new Microsoft.Office.Interop.Word.Application();

            wordApp.Visible = !closeword;
            var myAO = new Document();

            if (File.Exists(rncaao["鉴定表保存地址"]) && (!overcover))
            {
                myAO = wordApp.Documents.Open(rncaao["鉴定表保存地址"]);
            }
            else
            {
                try
                {
                    File.Copy(Program.InfoPath + "SAMPLE\\RULE\\VERI_SH.doc", rncaao["鉴定表保存地址"], true);
                }
                catch
                {
                    MessageBox.Show("生成文件" + rncaao["图号"] + "鉴定表未成功,请关闭所有打开的word,运行kill word!");
                    return;
                }


                myAO = wordApp.Documents.Open(rncaao["鉴定表保存地址"]);
            }

            //处理程序编号
            int progno = System.Convert.ToInt32(rncaao["程序编号"].Substring(5, 2));



            //鉴定表编号

            myAO.Tables[1].Cell(1, 5).Range.Text = "S2B-NCH-22100-" + progno.ToString();

            wordMethod.SearchReplace(wordApp, myAO, "[5]", rncaao["图号"]);
            wordMethod.SearchReplace(wordApp, myAO, "[6]", rncaao["中文名称"] + "壁板组件");
            wordMethod.SearchReplace(wordApp, myAO, "[7]", rncaao["图纸版次"]);
            wordMethod.SearchReplace(wordApp, myAO, "[11]", rncaao["程序编号"]);
            //开始处理试片编号
            //  DbHelperSQL.ExecuteSqlTran(autorivet_op.rfcouponno(rncaao["图号"]));

            //List< string> cplist=   DbHelperSQL.getlist("select CONCAT('T',编号) from 试片列表 where 产品图号='"+rncaao["图号"] + "' group by 编号 order by 编号;");

            //    string couponstr = rncaao["图号"].Replace("-001", cplist.First());

            //    for(int i=1;i<cplist.Count();i++)
            //    {
            //        couponstr = couponstr + "," + cplist[i];
            //    }

            //    wordMethod.SearchReplace(wordApp, myAO, "[8]", couponstr);
            myAO.Save();
            FormMethod.scanfiledoc(rncaao["鉴定表保存地址"], myAO, closeword);
            //  MessageBox.Show("生成完毕,请补全其他信息");



            // return myAO;
        }
コード例 #5
0
        public static void creatPACR(Dictionary <string, string> rncaao, bool overcover = false, bool closeword = true)
        {
            BackupOperation.backupfile(rncaao["PACR保存地址"]);
            if (!rncaao.Keys.Contains("图纸名称"))
            {
                rncaao.Add("图纸名称", AutorivetDB.queryno(rncaao["图号"], "图纸名称"));
            }



            var wordApp = new Microsoft.Office.Interop.Word.Application();

            wordApp.Visible = !closeword;
            var myAO = new Document();

            if (File.Exists(rncaao["PACR保存地址"]) && (!overcover))
            {
                myAO = wordApp.Documents.Open(rncaao["PACR保存地址"]);
            }
            else
            {
                try
                {
                    File.Copy(Program.InfoPath + "SAMPLE\\AOI\\PACR.doc", rncaao["PACR保存地址"], true);
                }
                catch
                {
                    MessageBox.Show("生成文件" + rncaao["图号"] + "PACR未成功,请关闭所有打开的word,运行kill word!");
                    return;
                }


                myAO = wordApp.Documents.Open(rncaao["PACR保存地址"]);
            }



            //控制记录编号
            wordMethod.SearchReplace(wordApp, myAO, "[1]", rncaao["AOI编号"] + "-PACR");
            //      myAO.Tables[1].Cell(2, 6).Range.Text = rncaao["AOI编号"] + "-PACR";
            //myAO.Tables[2].Cell(2, 6).Range.Text = rncaao["AOI编号"] + "-PACR";
            //myAO.Tables[3].Cell(2, 6).Range.Text = rncaao["AOI编号"] + "-PACR";
            //myAO.Tables[4].Cell(2, 6).Range.Text = rncaao["AOI编号"] + "-PACR";

            //控制记录名称


            myAO.Tables[1].Cell(4, 3).Range.Text = "自动钻铆\rAUTO-RIVETING";

            //装配图号
            //myAO.Tables[1].Cell(4, 2).Range.Text = rncaao["装配图号"];
            myAO.Tables[1].Cell(10, 1).Range.Text = "1";
            myAO.Tables[1].Cell(10, 2).Range.Text = rncaao["装配图号"];
            myAO.Tables[1].Cell(10, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];
            // myAO.Tables[1].Cell(10, 5).Range.Text = rncaao["图纸版次"];
            //程序编号

            myAO.Tables[1].Cell(16, 1).Range.Text = "1";
            myAO.Tables[1].Cell(16, 2).Range.Text = rncaao["程序编号"];
            //2015.8.13不再需要状态编号
            //   myAO.Tables[1].Cell(16, 6).Range.Text = rncaao["状态编号"];
            //  myAO.Tables[1].Cell(16, 7).Range.Text = rncaao["中文名称"] + "壁板装配交付状态\rCOS OF " + rncaao["图纸名称"];



            //进入零件表填写


            //第一条


            myAO.Tables[4].Cell(5, 1).Range.Text = "1";
            //     myAO.Tables[2].Cell(3, 1).Height=
            myAO.Tables[4].Cell(5, 2).Range.Text = rncaao["图号"];
            myAO.Tables[4].Cell(5, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];
            myAO.Tables[4].Cell(5, 4).Range.Text = "A";
            myAO.Tables[4].Cell(5, 5).Range.Text = "1";
            //    myAO.Tables[4].Cell(5, 6).Range.Text = rncaao["装配图号"];

            // myAO.Tables[1].Cell(7, 10).Range.Text = rncaao["架次"];
            // myAO.Tables[1].Cell(7, 1).Range.Text = dataGridView1.Rows[0].

            //开始统计紧固件

            System.Data.DataTable fsttable = AutorivetDB.allqtytable(rncaao["图号"]);;

            int fstcount = fsttable.Rows.Count;
            int nut5     = 0;
            int nut6     = 0;

            if (fstcount != 0)
            {
                for (int i = 0; i < fstcount; i++)
                {
                    string fstno = fsttable.Rows[i][0].ToString();
                    myAO.Tables[4].Cell(6 + i, 1).Range.Text = (i + 2).ToString();
                    myAO.Tables[4].Cell(6 + i, 2).Range.Text = fstno;
                    //string fstname = "";


                    if (fstno.Contains("B020600"))
                    {
                        myAO.Tables[4].Cell(6 + i, 3).Range.Text = "高锁\rHI-LITE";
                        int hiqty = System.Convert.ToInt16(fsttable.Rows[i][1].ToString());

                        if (fstno.Contains("AG5"))
                        {
                            nut5 = nut5 + hiqty;
                        }
                        else
                        {
                            nut6 = nut6 + hiqty;
                        }
                    }
                    else
                    {
                        myAO.Tables[4].Cell(6 + i, 3).Range.Text = "铆钉\rRIVET";
                    }
                    myAO.Tables[4].Cell(6 + i, 4).Range.Text = "U";
                    myAO.Tables[4].Cell(6 + i, 5).Range.Text = fsttable.Rows[i][1].ToString();
                    //   myAO.Tables[4].Cell(6 + i, 6).Range.Text = rncaao["装配图号"];
                }



                fstcount = 6 + fstcount;
                if (nut5 != 0)
                {
                    myAO.Tables[4].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                    myAO.Tables[4].Cell(fstcount, 2).Range.Text = "B0203013-08";
                    myAO.Tables[4].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                    myAO.Tables[4].Cell(fstcount, 4).Range.Text = "U";
                    myAO.Tables[4].Cell(fstcount, 5).Range.Text = nut5.ToString();
                    // myAO.Tables[4].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    if (nut6 != 0)
                    {
                        fstcount = fstcount + 1;
                        myAO.Tables[4].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[4].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[4].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[4].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[4].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        //  myAO.Tables[4].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                else
                {
                    if (nut6 != 0)
                    {
                        //fstcount = fstcount + 1;
                        myAO.Tables[4].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[4].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[4].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[4].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[4].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        myAO.Tables[4].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                //添加密封胶
                if ((nut5 + nut6) == 0)
                {
                }
                else
                {
                    fstcount = fstcount + 1;
                }

                myAO.Tables[4].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                myAO.Tables[4].Cell(fstcount, 3).Range.Text = "密封剂\rSEALANT";
                myAO.Tables[4].Cell(fstcount, 2).Range.Text = "MIL-PRF-81733 Type IV";
                myAO.Tables[4].Cell(fstcount, 4).Range.Text = "M";
                myAO.Tables[4].Cell(fstcount, 5).Range.Text = "340g";
                //  myAO.Tables[4].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];


                fstcount = fstcount + 1;
            }



            myAO.Save();
            FormMethod.scanfiledoc(rncaao["PACR保存地址"], myAO, closeword);
            //  MessageBox.Show("生成完毕,请补全其他信息");



            // return myAO;
        }
コード例 #6
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     GridView1.DataSource = AutorivetDB.TVA_fstlist("C01322200-001");
     GridView1.DataBind();
 }
コード例 #7
0
        private Document creatAOI()
        {
            if (!rncaao.Keys.Contains("图纸名称"))
            {
                rncaao.Add("图纸名称", AutorivetDB.queryno(rncaao["图号"], "图纸名称"));
            }



            wordApp         = new Microsoft.Office.Interop.Word.Application();
            wordApp.Visible = true;
            myAO            = new Document();
            if (File.Exists(rncaao["AOI保存地址"]) && (!checkBox1.Checked))
            {
                myAO = wordApp.Documents.Open(rncaao["AOI保存地址"]);
            }
            else
            {
                if (rncaao["中文名称"].Contains("CS300"))
                {
                    myAO = wordApp.Documents.Open(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "wordModel\\AOI\\AOI_CS300.docx");
                }
                else
                {
                    myAO = wordApp.Documents.Open(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "wordModel\\AOI\\AOI.docx");
                }



                myAO.SaveAs2(rncaao["AOI保存地址"]);
            }



            myAO.Tables[1].Cell(3, 2).Range.Text = rncaao["AOI编号"];

            //替换所有编号
            wordMethod.SearchReplace(wordApp, myAO, "C1-CF510-010", rncaao["AOI编号"]);



            //标题


            myAO.Tables[1].Cell(3, 4).Range.Text = rncaao["中文名称"] + "壁板自动钻铆\rAUTO-RIVETING OF " + rncaao["图纸名称"];

            //装配图号
            myAO.Tables[1].Cell(4, 2).Range.Text = rncaao["装配图号"];
            //替换所有装配图号

            wordMethod.SearchReplace(wordApp, myAO, "C02311100", rncaao["装配图号"]);



            //进入零件表填写


            //第一条


            myAO.Tables[2].Cell(3, 1).Range.Text = "1";
            //     myAO.Tables[2].Cell(3, 1).Height=
            myAO.Tables[2].Cell(3, 2).Range.Text = rncaao["图号"] + "P1";
            myAO.Tables[2].Cell(3, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];
            myAO.Tables[2].Cell(3, 4).Range.Text = "A";
            myAO.Tables[2].Cell(3, 5).Range.Text = "1";
            myAO.Tables[2].Cell(3, 6).Range.Text = rncaao["装配图号"];

            // myAO.Tables[1].Cell(7, 10).Range.Text = rncaao["架次"];
            // myAO.Tables[1].Cell(7, 1).Range.Text = dataGridView1.Rows[0].

            //开始统计紧固件

            System.Data.DataTable fsttable = AutorivetDB.spfsttable(rncaao["图号"]);

            int fstcount = fsttable.Rows.Count;
            int nut5     = 0;
            int nut6     = 0;

            if (fstcount != 0)
            {
                for (int i = 0; i < fstcount; i++)
                {
                    string fstno = fsttable.Rows[i][0].ToString();
                    myAO.Tables[2].Cell(4 + i, 1).Range.Text = (i + 2).ToString();
                    myAO.Tables[2].Cell(4 + i, 2).Range.Text = fstno;
                    //string fstname = "";


                    if (fstno.Contains("B020600"))
                    {
                        myAO.Tables[2].Cell(4 + i, 3).Range.Text = "高锁\rHI-LITE";
                        int hiqty = System.Convert.ToInt16(fsttable.Rows[i][1].ToString());

                        if (fstno.Contains("AG5"))
                        {
                            nut5 = nut5 + hiqty;
                        }
                        else
                        {
                            nut6 = nut6 + hiqty;
                        }
                    }
                    else
                    {
                        myAO.Tables[2].Cell(4 + i, 3).Range.Text = "铆钉\rRIVET";
                    }
                    myAO.Tables[2].Cell(4 + i, 4).Range.Text = "U";
                    myAO.Tables[2].Cell(4 + i, 5).Range.Text = fsttable.Rows[i][1].ToString();
                    myAO.Tables[2].Cell(4 + i, 6).Range.Text = rncaao["装配图号"];
                }



                fstcount = 4 + fstcount;
                if (nut5 != 0)
                {
                    myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                    myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-08";
                    myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                    myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                    myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut5.ToString();
                    myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    if (nut6 != 0)
                    {
                        fstcount = fstcount + 1;
                        myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                else
                {
                    if (nut6 != 0)
                    {
                        //fstcount = fstcount + 1;
                        myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                //添加密封胶
                if ((nut5 + nut6) == 0)
                {
                }
                else
                {
                    fstcount = fstcount + 1;
                }

                myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                myAO.Tables[2].Cell(fstcount, 3).Range.Text = "密封剂\rSEALANT";
                myAO.Tables[2].Cell(fstcount, 2).Range.Text = "MIL-PRF-81733 Type IV";
                myAO.Tables[2].Cell(fstcount, 4).Range.Text = "M";
                myAO.Tables[2].Cell(fstcount, 5).Range.Text = "340g";
                myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];

                //添加胶嘴
                //fstcount = fstcount + 1;
                //List<string> tipls = autorivet_op.processitemlist(rncaao["装配图号"], "胶嘴Sealant_Tip");
                //for (int k=0;k<tipls.Count();k++)
                //{

                //    myAO.Tables[2].Cell(fstcount+k, 1).Range.Text = (fstcount+k - 2).ToString();
                //    myAO.Tables[2].Cell(fstcount + k, 2).Range.Text = tipls[k];
                //    myAO.Tables[2].Cell(fstcount + k, 3).Range.Text = "胶嘴\rSealant Tip";
                //    myAO.Tables[2].Cell(fstcount + k, 4).Range.Text = "M";
                //    myAO.Tables[2].Cell(fstcount + k, 5).Range.Text = "1";
                //    myAO.Tables[2].Cell(fstcount + k, 6).Range.Text = rncaao["装配图号"];

                //}

                //添加下铆头

                fstcount = fstcount + 1;


                while (!myAO.Tables[2].Cell(fstcount, 1).Range.Text.Contains("专用工具"))
                {
                    fstcount = fstcount + 1;
                }

                //定位到要输入专用工具的行
                fstcount = fstcount + 2;



                List <string> lals = AutorivetDB.processitemlist(rncaao["装配图号"], "下铆头Lower_Anvil");
                //最多只能放下三行
                //用于记录行尾,指示下一行数据的索引;
                int rear = fstcount;

                for (int k = 0; k < lals.Count(); k++)
                {
                    myAO.Tables[2].Cell(rear, 1).Range.Text = (k + 1).ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "下铆头\rLower Anvil";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = lals[k];

                    rear = rear + 1;
                }
                //高锁限力枪
                int toolindex = lals.Count();
                if (nut5 > 0)
                {
                    toolindex = toolindex + 1;
                    myAO.Tables[2].Cell(rear, 1).Range.Text = toolindex.ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "高锁限力枪\rHI-LITE Istallation Tool";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = "KTL1408A218B062";
                    toolindex += 1;
                    rear      += 1;
                }

                if (nut6 > 0)
                {
                    toolindex = toolindex + 1;
                    myAO.Tables[2].Cell(rear, 1).Range.Text = toolindex.ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "高锁限力枪\rHI-LITE Istallation Tool";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = "KTL1439A249C078";
                    rear += 1;
                }


                //寻找图纸列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("图纸列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 2;



                //添加图纸

                myAO.Tables[2].Cell(rear, 1).Range.Text = "1";
                myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["装配图号"];
                myAO.Tables[2].Cell(rear, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];



                //寻找程序列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("程序列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 2;

                myAO.Tables[2].Cell(rear, 1).Range.Text = "1";
                myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["程序编号"];

                //替换所有程序编号
                wordMethod.SearchReplace(wordApp, myAO, "MA10016A", rncaao["程序编号"]);


                rear = rear + 1;



                //寻找参考文件列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("参考文件列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 8;

                myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["状态编号"];

                //替换所有状态编号
                wordMethod.SearchReplace(wordApp, myAO, "C1-S22100-33", rncaao["状态编号"]);



                myAO.Tables[2].Cell(rear, 3).Range.Text = rncaao["中文名称"] + "壁板装配交付状态\rCOS OF " + rncaao["图纸名称"];
            }



            myAO.Save();
            //   wordApp.Quit();
            FormMethod.scanfiledoc(rncaao["AOI保存地址"], myAO);
            MessageBox.Show("生成完毕,请补全其他信息");



            return(myAO);
        }
コード例 #8
0
 private void creatProductTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.product_table();
 }
コード例 #9
0
 private void createArrayTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.task_table();
 }
コード例 #10
0
 private void importPeopleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.updatePeopleTable();
 }
コード例 #11
0
 private void createMBOMTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.EBOM_table();
 }
コード例 #12
0
 private void toolsTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.updateToolsTable();
 }
コード例 #13
0
 private void createTroubleshootTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.trouble_table();
 }
コード例 #14
0
 private void createToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     AutorivetDB.tool_table();
 }
コード例 #15
0
 private void createMaterialTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.material_table();
 }
コード例 #16
0
 private void createMessageTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.pushinfo_table();
 }
コード例 #17
0
 private void createLogTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.log_table();
 }
コード例 #18
0
 private void createToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.rnc_table();
 }
コード例 #19
0
        private void loadtable(string productname)
        {
            if (productname != "")
            {
                string prodnametrim = productname.Replace("process", "");
                this.Text = AutorivetDB.queryno(prodnametrim, "程序编号");

                dbinfo.DBfastlist  = AutorivetDB.TVA_fstlist(prodnametrim, "INSTALLED BY").AsEnumerable().ToDictionary(k => k[0].ToString(), v => System.Convert.ToInt32(v[1].ToString()));
                dbinfo.DBdrilllist = AutorivetDB.TVA_fstlist(prodnametrim, "DRILL ONLY BY").AsEnumerable().ToDictionary(k => k[0].ToString(), v => System.Convert.ToInt32(v[1].ToString()));



                //  DbHelperSQL.Query("select FastenerName,count(*) as qty from " + productname.Replace("process", "") + " WHERE ProcessType like '%DRILL ONLY BY%' group by FastenerName order by FastenerName").Tables[0];
                string fstdisplay = "TVA紧固件安装数量:\r\n";
                foreach (var pp in dbinfo.DBfastlist)
                {
                    int tempqty = System.Convert.ToInt16(pp.Value.ToString());
                    fstdisplay = fstdisplay + pp.Key + "  : " + pp.Value.ToString() + "\r\n";
                    //  allfastlist.Add(pp.Key.ToString(),tempqty);
                }
                fstdisplay = fstdisplay + "钻孔的(drill):\r\n";

                foreach (var pp in dbinfo.DBdrilllist)
                {
                    int tempqty = System.Convert.ToInt16(pp.Value.ToString());
                    fstdisplay = fstdisplay + pp.Key + "  : " + pp.Value + "\r\n";
                    //  alldrilllist.Add(pp.Key.ToString(), tempqty);

                    // tvadrillqty = tvadrillqty + tempqty;
                    // tvaqty=
                }



                label7.Text = fstdisplay;

                try
                {
                    productnametrim = productname;
                    prodchnname     = AutorivetDB.queryno(productnametrim, "名称");

                    MySqlConnection MySqlConn = new MySqlConnection(PubConstant.ConnectionString);
                    MySqlConn.Open();
                    String sql = "SELECT uuid FROM  " + productnametrim + " order by ID";
                    program_part = DbHelperSQL.getlist(sql);


                    comboBox1.DataSource = program_part;


                    //   this.dataGridView1.DataSource = dt;
                }
                catch
                {
                    MessageBox.Show("当前数据库不可用,请更换数据库");
                }
            }

            else
            {
                DataTable fsttemp = DbHelperSQL.Query("select Fasteners from 紧固件列表").Tables[0];
                foreach (DataRow pp in fsttemp.Rows)
                {
                    // allfastlist.Add(pp[0].ToString(), 0);
                    // alldrilllist.Add(pp[0].ToString(), 0);
                }
            }
        }
コード例 #20
0
 private void creatPaperworkTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.paperwork_table();
 }
コード例 #21
0
        public DataTable get_datatable()
        {
            unidt = AutorivetDB.paperwork_view();

            return(unidt);
        }
コード例 #22
0
 private void creatCouponTableToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     AutorivetDB.coupon_table();
 }
コード例 #23
0
        public static Document creatAOI(Dictionary <string, string> rncaao, bool overcover = false, bool closeword = true)
        {
            BackupOperation.backupfile(rncaao["AOI保存地址"]);
            if (!rncaao.Keys.Contains("图纸名称"))
            {
                rncaao.Add("图纸名称", AutorivetDB.queryno(rncaao["图号"], "图纸名称"));
            }



            var wordApp = new Microsoft.Office.Interop.Word.Application();



            wordApp.Visible = !closeword;

            Document myAO;


            if (File.Exists(rncaao["AOI保存地址"]) && (!overcover))
            {
                myAO = wordApp.Documents.Open(rncaao["AOI保存地址"]);
            }
            else
            {
                try
                {
                    File.Copy(Program.InfoPath + "SAMPLE\\AOI\\AOI.docx", rncaao["AOI保存地址"], true);
                }
                catch
                {
                    MessageBox.Show("生成文件" + rncaao["图号"] + "AOI未成功,请关闭所有打开的word,运行kill word!");
                    return(null);
                }


                myAO = wordApp.Documents.Open(rncaao["AOI保存地址"]);
                Thread.Sleep(100);
                // myAO.SaveAs2(rncaao["AOI保存地址"]);
            }



            //替换所有编号
            wordMethod.SearchReplace(wordApp, myAO, "[2]", rncaao["AOI编号"]);


            //上下工序

            //     myAO.Tables[1].Cell(4, 4).Range.Text =

            string prezhanwei = AutorivetDB.queryno(rncaao["图号"], "预铆编号");

            myAO.Tables[1].Cell(4, 4).Range.Text = "C1-" + prezhanwei + "-020";

            myAO.Tables[1].Cell(4, 6).Range.Text = "C1-" + prezhanwei + "-030";
            //标题



            myAO.Tables[1].Cell(3, 4).Range.Text = "自动钻铆\rAUTO-RIVETING";
            //替换所有装配图号

            wordMethod.SearchReplace(wordApp, myAO, "[1]", rncaao["装配图号"]);



            //进入零件表填写


            //第一条


            myAO.Tables[2].Cell(3, 1).Range.Text = "1";
            //     myAO.Tables[2].Cell(3, 1).Height=
            myAO.Tables[2].Cell(3, 2).Range.Text = rncaao["图号"] + "P1";
            myAO.Tables[2].Cell(3, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];
            myAO.Tables[2].Cell(3, 4).Range.Text = "A";
            myAO.Tables[2].Cell(3, 5).Range.Text = "1";
            myAO.Tables[2].Cell(3, 6).Range.Text = rncaao["装配图号"];
            if (rncaao["图号"].Contains("C017"))
            {
                myAO.Tables[1].Cell(3, 6).Range.Text = "☒CS100☑CS300";
            }


            // myAO.Tables[1].Cell(7, 10).Range.Text = rncaao["架次"];
            // myAO.Tables[1].Cell(7, 1).Range.Text = dataGridView1.Rows[0].

            //开始统计紧固件

            // System.Data.DataTable fsttable = autorivet_op.spfsttable(rncaao["图号"]);
            //2015.7.28改为统计加入试片耗损后的紧固件数量
            System.Data.DataTable fsttable = AutorivetDB.allqtytable(rncaao["图号"]);

            int fstcount = fsttable.Rows.Count;
            int nut5     = 0;
            int nut6     = 0;

            if (fstcount != 0)
            {
                for (int i = 0; i < fstcount; i++)
                {
                    string fstno = fsttable.Rows[i][0].ToString();
                    myAO.Tables[2].Cell(4 + i, 1).Range.Text = (i + 2).ToString();
                    myAO.Tables[2].Cell(4 + i, 2).Range.Text = fstno;
                    //string fstname = "";


                    if (fstno.Contains("B020600"))
                    {
                        myAO.Tables[2].Cell(4 + i, 3).Range.Text = "高锁\rHI-LITE";
                        int hiqty = System.Convert.ToInt16(fsttable.Rows[i][1].ToString());

                        if (fstno.Contains("AG5"))
                        {
                            nut5 = nut5 + hiqty;
                        }
                        else
                        {
                            nut6 = nut6 + hiqty;
                        }
                    }
                    else
                    {
                        myAO.Tables[2].Cell(4 + i, 3).Range.Text = "铆钉\rRIVET";
                    }
                    myAO.Tables[2].Cell(4 + i, 4).Range.Text = "U";
                    myAO.Tables[2].Cell(4 + i, 5).Range.Text = fsttable.Rows[i][1].ToString();
                    myAO.Tables[2].Cell(4 + i, 6).Range.Text = rncaao["装配图号"];
                }



                fstcount = 4 + fstcount;
                if (nut5 != 0)
                {
                    myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                    myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-08";
                    myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                    myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                    myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut5.ToString();
                    myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    if (nut6 != 0)
                    {
                        fstcount = fstcount + 1;
                        myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                else
                {
                    if (nut6 != 0)
                    {
                        //fstcount = fstcount + 1;
                        myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                        myAO.Tables[2].Cell(fstcount, 2).Range.Text = "B0203013-3";
                        myAO.Tables[2].Cell(fstcount, 3).Range.Text = "高锁帽\rNUT";
                        myAO.Tables[2].Cell(fstcount, 4).Range.Text = "U";
                        myAO.Tables[2].Cell(fstcount, 5).Range.Text = nut6.ToString();
                        myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];
                    }
                }
                //添加密封胶
                if ((nut5 + nut6) == 0)
                {
                }
                else
                {
                    fstcount = fstcount + 1;
                }

                myAO.Tables[2].Cell(fstcount, 1).Range.Text = (fstcount - 2).ToString();
                myAO.Tables[2].Cell(fstcount, 3).Range.Text = "密封剂\rSEALANT";
                myAO.Tables[2].Cell(fstcount, 2).Range.Text = "MIL-PRF-81733 Type IV";
                myAO.Tables[2].Cell(fstcount, 4).Range.Text = "M";
                myAO.Tables[2].Cell(fstcount, 5).Range.Text = "340g";
                myAO.Tables[2].Cell(fstcount, 6).Range.Text = rncaao["装配图号"];

                //添加胶嘴
                //fstcount = fstcount + 1;
                //List<string> tipls = autorivet_op.processitemlist(rncaao["装配图号"], "胶嘴Sealant_Tip");
                //for (int k=0;k<tipls.Count();k++)
                //{

                //    myAO.Tables[2].Cell(fstcount+k, 1).Range.Text = (fstcount+k - 2).ToString();
                //    myAO.Tables[2].Cell(fstcount + k, 2).Range.Text = tipls[k];
                //    myAO.Tables[2].Cell(fstcount + k, 3).Range.Text = "胶嘴\rSealant Tip";
                //    myAO.Tables[2].Cell(fstcount + k, 4).Range.Text = "M";
                //    myAO.Tables[2].Cell(fstcount + k, 5).Range.Text = "1";
                //    myAO.Tables[2].Cell(fstcount + k, 6).Range.Text = rncaao["装配图号"];

                //}

                //添加下铆头

                fstcount = fstcount + 1;


                while (!myAO.Tables[2].Cell(fstcount, 1).Range.Text.Contains("专用工具"))
                {
                    fstcount = fstcount + 1;
                }

                //定位到要输入专用工具的行
                fstcount = fstcount + 2;



                List <string> lals = AutorivetDB.processitemlist(rncaao["装配图号"], "下铆头Lower_Anvil");
                //最多只能放下三行
                //用于记录行尾,指示下一行数据的索引;
                int rear = fstcount;

                for (int k = 0; k < lals.Count(); k++)
                {
                    myAO.Tables[2].Cell(rear, 1).Range.Text = (k + 1).ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "下铆头\rLower Anvil";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = lals[k];

                    rear = rear + 1;
                }
                //高锁限力枪
                int toolindex = lals.Count();
                if (nut5 > 0)
                {
                    toolindex = toolindex + 1;
                    myAO.Tables[2].Cell(rear, 1).Range.Text = toolindex.ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "高锁限力枪\rHI-LITE Istallation Tool";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = "KTL1408A218B062";
                    toolindex += 1;
                    rear      += 1;
                }

                if (nut6 > 0)
                {
                    toolindex = toolindex + 1;
                    myAO.Tables[2].Cell(rear, 1).Range.Text = toolindex.ToString();
                    myAO.Tables[2].Cell(rear, 2).Range.Text = "高锁限力枪\rHI-LITE Istallation Tool";
                    myAO.Tables[2].Cell(rear, 3).Range.Text = "1";
                    myAO.Tables[2].Cell(rear, 4).Range.Text = "KTL1439A249C078";
                    rear += 1;
                }


                //寻找图纸列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("图纸列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 2;



                //添加图纸

                myAO.Tables[2].Cell(rear, 1).Range.Text = "1";
                myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["装配图号"];
                myAO.Tables[2].Cell(rear, 3).Range.Text = rncaao["中文名称"] + "壁板组件\r" + rncaao["图纸名称"];



                //寻找程序列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("程序列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 2;

                //myAO.Tables[2].Cell(rear, 1).Range.Text = "1";
                //myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["程序编号"];

                //替换所有程序编号
                wordMethod.SearchReplace(wordApp, myAO, "[3]", rncaao["程序编号"]);


                rear = rear + 1;



                //寻找参考文件列表
                while (!myAO.Tables[2].Cell(rear, 1).Range.Text.Contains("参考文件列表"))
                {
                    rear = rear + 1;
                }

                rear = rear + 8;

                //判断并修改工装编号

                if (rncaao["中文名称"].Contains("下"))
                {
                    wordMethod.SearchReplace(wordApp, myAO, "C1-RIT-C01329000-001", "C1-RIT-C01333400-001");

                    wordMethod.SearchReplace(wordApp, myAO, "中中机身上半壳卡板", "中后机身下半壳卡板");

                    wordMethod.SearchReplace(wordApp, myAO, "Auto riveting framework of upper lobe MID fuselage CTR", "Auto riveting framework of lower lobe MID fuselage AFT");


                    wordMethod.SearchReplace(wordApp, myAO, "C1-RIT-C01322000-001", "C1-RIT-C01332300-001");
                    wordMethod.SearchReplace(wordApp, myAO, "中前机身上半壳卡板", "中前机身下半壳卡板");

                    wordMethod.SearchReplace(wordApp, myAO, "Auto riveting framework of upper lobe MID fuselage FWD", "Auto riveting framework of lower lobe MID fuselage FWD");
                }



                //2015.8.13不再需要状态编号
                //  myAO.Tables[2].Cell(rear, 2).Range.Text = rncaao["状态编号"];

                //替换所有状态编号
                //   wordMethod.SearchReplace(wordApp, myAO, "C1-S22100-33", rncaao["状态编号"]);



                //     myAO.Tables[2].Cell(rear, 3).Range.Text = rncaao["中文名称"] + "壁板装配交付状态\rCOS OF " + rncaao["图纸名称"];
            }



            myAO.Save();
            //   wordApp.Quit();
            FormMethod.scanfiledoc(rncaao["AOI保存地址"], myAO, closeword);
            //  MessageBox.Show("生成完毕,请补全其他信息");



            return(myAO);
        }
コード例 #24
0
 private void createCATIAMODELTableToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AutorivetDB.catiaModel_table();
 }
コード例 #25
0
 public DataTable get_datatable()
 {
     return(AutorivetDB.production_view());
 }
コード例 #26
0
 public ProductionCur()
 {
     AllInfo = AutorivetDB.production_view();
 }