static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //向客户机添加凭据
     FormMethod.creatCredential();
     Program.prodTable = AutorivetDB.fullname_table("图号,名称,站位号,程序编号");
     Program.userID    = FormMethod.GetMachineName();
     Application.Run(new MainTeamForm());
     //Application.Run(new AO());
 }
Beispiel #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int k = e.ColumnIndex;
            int l = e.RowIndex;

            if (l >= 0)
            {
                currentrow = l;
                // dataGridView1.Rows[currentrow].Selected = true;
                currentpos = dataGridView1.FirstDisplayedScrollingRowIndex;

                DataRowView temprow = (DataRowView)dataGridView1.Rows[l].DataBoundItem;
                //  string liushui = temprow[5].ToString();



                var bb = from kk in Program.prodTable.AsEnumerable()
                         where kk["名称"].ToString() == temprow["关联产品"].ToString()
                         select kk["名称"].ToString() + "_" + kk["图号"].ToString();



                //直接获取目录

                string path = Program.InfoPath + bb.First() + "\\" + temprow["产品架次"].ToString() + "\\RNC\\" + temprow["外部拒收号"].ToString();


                localMethod.creatDir(path);



                switch (k)
                {
                case 0:
                    //产品-汉字
                    listBox2.SelectedItem = temprow[6].ToString() + "_" + temprow[7].ToString();

                    //架次
                    //  listBox1.SelectedItem = temprow[7].ToString();

                    //6个文本框
                    //外部拒收号
                    textBox1.Text = temprow["外部拒收号"].ToString();

                    //内部拒收号
                    textBox2.Text = temprow[1].ToString();
                    //拒收原因
                    textBox3.Text = temprow[2].ToString();
                    textBox4.Text = temprow[3].ToString();
                    textBox5.Text = temprow[4].ToString();

                    //AAO
                    filetrackstr = temprow["文件"].ToString();

                    string startdatestr = temprow[8].ToString();
                    string closedatestr = temprow[9].ToString();
                    //string transferdatestr = temprow[6].ToString();

                    if (startdatestr != "" && !startdatestr.Contains("0000"))
                    {
                        dateTimePicker1.Value = DateTime.Parse(startdatestr);
                    }
                    if (closedatestr != "" && !closedatestr.Contains("0000"))
                    {
                        dateTimePicker2.Value = DateTime.Parse(closedatestr);
                        checkBox2.Checked     = false;
                    }
                    else
                    {
                        checkBox2.Checked = true;
                    }


                    label1.Text    = temprow[10].ToString();
                    comboBox1.Text = temprow[11].ToString();
                    comboBox2.Text = temprow["责任人"].ToString();
                    break;

                case 1:

                    Dictionary <string, string> tmp = new Dictionary <string, string>();
                    //名称
                    string prodname = temprow[6].ToString();

                    tmp.Add("中文名称", prodname + "壁板");
                    tmp.Add("名称", prodname);
                    //架次
                    string jiaci = temprow[7].ToString();
                    tmp.Add("架次", jiaci);
                    //填充标题
                    string neibujushou = temprow[0].ToString();
                    //现改为填充外部拒收号
                    tmp.Add("内部拒收号", neibujushou);
                    string folderpath = path;
                    tmp.Add("保存地址", folderpath + "\\" + temprow[0].ToString() + "_AAO.doc");
                    tmp.Add("类型", "AO");

                    AO f = new AO();
                    f.rncaao = tmp;
                    f.Show();
                    //现已改为AAO

                    paperWork f2 = new paperWork();
                    f2.Show();
                    f2.filter_filename = temprow["外部拒收号"].ToString();
                    f2.rf_filter();
                    break;

                case 2:
                    //获取目录名称


                    try
                    {
                        System.Diagnostics.Process.Start("explorer.exe", path);
                    }

                    catch
                    {
                        FormMethod.creatCredential();
                    }
                    break;
                }
            }
        }