public void ZMonitor() { int CoZ = Convert.ToInt32(textBox11.Text); ConnectStr conStrM = new ConnectStr(); conStrM.ConStr(1); cstr = conStrM.StP; connection = new MySqlConnection(cstr); Zapros zapros1 = new Zapros(); COs = KolOs; D1 = dateTimePicker9.Value.ToString("yyyy.MM.dd HH:mm:ss"); D2 = dateTimePicker10.Value.ToString("yyyy.MM.dd HH:mm:ss"); zapros1.ZaprLevKontr(0, D1, D2, CoZ); z = zapros1.commandStringTest; mySqlDataAdapter = new MySqlDataAdapter(z, connection); mySqlDataAdapter.Fill(DS); dataGridView9.DataSource = DS.Tables[0]; dataGridView9.Columns[9].Visible = false; dataGridView9.Columns[10].Visible = false; dataGridView9.Columns[11].Visible = false; dataGridView9.Columns[12].Visible = false; dataGridView9.Columns[13].Visible = false; dataGridView9.Columns[14].Visible = false; dataGridView9.Columns[15].Visible = false; dataGridView9.Columns[16].Visible = false; dataGridView9.Columns[17].Visible = false; dataGridView9.Columns[18].Visible = false; dataGridView9.Columns[19].Visible = false; dataGridView9.Columns[20].Visible = false; dataGridView9.Columns[21].Visible = false; connection.Close(); }
public void butAdd(string[] Us)///////////// Кнопка сохранить (добавить) ////////////////////// { ConnectStr conStrU = new ConnectStr(); Zapros zaprosU = new Zapros(); //int IDU = 0; conStrU.ConStr(1); //zaprosU.KartUser(0); cstrU = conStrU.StP; MySql.Data.MySqlClient.MySqlConnection sqlConnectionT = new MySql.Data.MySqlClient.MySqlConnection(cstrU); MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(); cmd.CommandText = "INSERT INTO raptuser (user," + " passuser," + " d2," + " d3," + " r1," + " r2," + " r3," + " r4," + " r5," + " r6," + " r7," + " r8," + " r9," + " r10," + " famu," + " nameu," + " otchu," + " doljnostu," + " telu," + " E_mail) " + "VALUES(" + "'" + Us[1] + "'," + "'" + Us[2] + "'," + " DEFAULT," + " DEFAULT," + "'" + Convert.ToInt32(Us[9]) + "'," + "'" + Convert.ToInt32(Us[10]) + "'," + "'" + Convert.ToInt32(Us[11]) + "'," + "'" + Convert.ToInt32(Us[12]) + "'," + "'" + Convert.ToInt32(Us[13]) + "'," + "'" + Convert.ToInt32(Us[14]) + "'," + "'" + Convert.ToInt32(Us[15]) + "'," + "'" + Convert.ToInt32(Us[16]) + "'," + "'" + Convert.ToInt32(Us[17]) + "'," + "'" + Convert.ToInt32(Us[18]) + "'," + "'" + Us[3] + "'," + "'" + Us[4] + "'," + "'" + Us[5] + "'," + "'" + Us[6] + "'," + "'" + Us[7] + "'," + "'" + Us[8] + "')"; cmd.Connection = sqlConnectionT; sqlConnectionT.Open(); cmd.ExecuteNonQuery(); sqlConnectionT.Close(); //Close(); }
internal void FormAD_LoadRNV(int IDRN) { button1.Visible = false; button2.Visible = false; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); zapros.AD(IDRN); string z = zapros.commandStringTest; command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader reader; try { command.Connection.Open(); reader = command.ExecuteReader(); while (reader.Read()) { alphaBlendTextBox26.Text = reader["IDAD"].ToString(); alphaBlendTextBox1.Text = reader["UchNomer"].ToString(); alphaBlendTextBox31.Text = reader["Name Dor"].ToString(); alphaBlendTextBox16.Text = reader["KatergryAD"].ToString(); comboBox1.Text = reader["ZnachenAD"].ToString(); alphaBlendTextBox15.Text = reader["ChisloPolos"].ToString(); alphaBlendTextBox2.Text = reader["ChisloNapravlen"].ToString(); alphaBlendTextBox3.Text = reader["ObshProtyajAD"].ToString(); alphaBlendTextBox4.Text = reader["widthAD"].ToString(); alphaBlendTextBox6.Text = reader["widthObochin"].ToString(); alphaBlendTextBox5.Text = reader["widthRazdPolos"].ToString(); alphaBlendTextBox22.Text = reader["VladeletsAD"].ToString(); alphaBlendTextBox21.Text = reader["AdrVladel"].ToString(); alphaBlendTextBox20.Text = reader["KontaktVladel"].ToString(); alphaBlendTextBox7.Text = reader["OtvLVladel"].ToString(); IDRub = IDRN; reader.Close(); } } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } }
internal void FormPDKObM_LoadRNV(int IDTS) { button1.Visible = false; button2.Visible = false; string z = "SELECT " + "rapdopmassts.iddmts, " + "rapdopmassts.typets, " + "rapdopmassts.kolos, " + "rapdopmassts.pdmassts " + "FROM rapdopmassts " + "WHERE rapdopmassts.iddmts = " + IDTS; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader readerT; try { command.Connection.Open(); readerT = command.ExecuteReader(); while (readerT.Read()) { if (readerT["typets"].ToString() == "1") { comboBox1.Text = "Одиночное ТС"; } else { comboBox1.Text = "Автопоезд"; } alphaBlendTextBox6.Text = readerT["kolos"].ToString(); alphaBlendTextBox4.Text = readerT["pdmassts"].ToString(); } IDPDKOb = IDTS; readerT.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } }
internal void FormNastrPuti_Load(int ID) { button1.Visible = false; button2.Visible = true; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); zapros.NastrPuti(ID, ""); string z = zapros.commandStringTest; command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader reader; try { command.Connection.Open(); reader = command.ExecuteReader(); while (reader.Read()) { label2.Text = reader["CompName"].ToString(); textBox1.Text = reader["Rab_mesto"].ToString(); textBox2.Text = reader["Photo"].ToString() + "\\"; textBox3.Text = reader["XML_Ang"].ToString() + "\\"; textBox4.Text = reader["Akt_Arch"].ToString() + "\\"; //alphaBlendTextBox2.Text = reader["ChisloNapravlen"].ToString(); //alphaBlendTextBox3.Text = reader["ObshProtyajAD"].ToString(); //alphaBlendTextBox4.Text = reader["widthAD"].ToString(); //alphaBlendTextBox6.Text = reader["widthObochin"].ToString(); //alphaBlendTextBox5.Text = reader["widthRazdPolos"].ToString(); //alphaBlendTextBox22.Text = reader["VladeletsAD"].ToString(); //alphaBlendTextBox21.Text = reader["AdrVladel"].ToString(); //alphaBlendTextBox20.Text = reader["KontaktVladel"].ToString(); //alphaBlendTextBox7.Text = reader["OtvLVladel"].ToString(); IDRM = ID; reader.Close(); } } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } }
private void button1_Click(object sender, EventArgs e)//////////////////////////// Добавление AD { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); //zapros.AD(IDRN); string z = " INSERT INTO rapdoroga " + "(IDAD, " + "UchNomer, " + "`Name Dor`, " + "KatergryAD, " + "ZnachenAD, " + "ChisloPolos, " + "ChisloNapravlen, " + "ObshProtyajAD, " + "widthAD, " + "widthObochin, " + "widthRazdPolos, " + "VladeletsAD, " + "AdrVladel, " + "KontaktVladel, " + "OtvLVladel) " + "VALUES(" + Convert.ToInt32(alphaBlendTextBox26.Text) + ", " + "'" + alphaBlendTextBox1.Text + "', " + "'" + alphaBlendTextBox31.Text + "', " + "" + Convert.ToInt32(alphaBlendTextBox16.Text) + ", " + "'" + comboBox1.Text + "', " + "" + Convert.ToInt32(alphaBlendTextBox15.Text) + ", " + "" + Convert.ToInt32(alphaBlendTextBox2.Text) + ", " + "'" + alphaBlendTextBox3.Text + "', " + "" + Convert.ToDouble(alphaBlendTextBox4.Text) + ", " + "" + Convert.ToDouble(alphaBlendTextBox6.Text) + ", " + "" + Convert.ToDouble(alphaBlendTextBox5.Text) + ", " + "'" + alphaBlendTextBox22.Text + "', " + "'" + alphaBlendTextBox21.Text + "', " + "'" + alphaBlendTextBox20.Text + "', " + "'" + alphaBlendTextBox7.Text + "' )"; command.CommandText = z;// commandString; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
//////internal void FormKlass_LoadP(int IDTS) //////{ ////// button1.Visible = false; ////// button2.Visible = true; ////// MySql.Data.MySqlClient.MySqlConnection sqlConnectionT = new MySql.Data.MySqlClient.MySqlConnection("Data source = localhost; UserId = root; Password = 1q2w3e$R; database = test; "); ////// MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(); ////// cmd.CommandText = "SELECT " + ////// "raptklassts.Klass," + ////// " raptklassts.naimklassts," + ////// " raptklassts.tipschema," + ////// " raptklassts.ColOsey," + ////// " raptklassts.Distanc1_2Min," + ////// " raptklassts.Distanc1_2Max," + ////// " raptklassts.Distanc2_3Min," + ////// " raptklassts.Distanc2_3Max," + ////// " raptklassts.Distanc3_4Min," + ////// " raptklassts.Distanc3_4Max," + ////// " raptklassts.Distanc4_5Min," + ////// " raptklassts.Distanc4_5Max," + ////// " raptklassts.Distanc5_6Min," + ////// " raptklassts.Distanc5_6Max," + ////// " raptklassts.Distanc6_7Min," + ////// " raptklassts.Distanc6_7Max," + ////// " raptklassts.Distanc7_8Min," + ////// " raptklassts.Distanc7_8Max," + ////// " raptklassts.MaxOsNagrm161," + ////// " raptklassts.MaxOsNagrm162," + ////// " raptklassts.MaxOsNagrm111," + ////// " raptklassts.MaxOsNagrm112," + ////// " raptklassts.MaxOsNagrm121," + ////// " raptklassts.MaxOsNagrm122," + ////// " raptklassts.MaxOsNagrm261," + ////// " raptklassts.MaxOsNagrm262," + ////// " raptklassts.MaxOsNagrm211," + ////// " raptklassts.MaxOsNagrm212," + ////// " raptklassts.MaxOsNagrm221," + ////// " raptklassts.MaxOsNagrm222," + ////// " raptklassts.MaxOsNagrm361," + ////// " raptklassts.MaxOsNagrm362," + ////// " raptklassts.MaxOsNagrm311," + ////// " raptklassts.MaxOsNagrm312," + ////// " raptklassts.MaxOsNagrm321," + ////// " raptklassts.MaxOsNagrm322," + ////// " raptklassts.MaxOsNagrm461," + ////// " raptklassts.MaxOsNagrm462," + ////// " raptklassts.MaxOsNagrm411," + ////// " raptklassts.MaxOsNagrm412," + ////// " raptklassts.MaxOsNagrm421," + ////// " raptklassts.MaxOsNagrm422," + ////// " raptklassts.MaxOsNagrm561," + ////// " raptklassts.MaxOsNagrm562," + ////// " raptklassts.MaxOsNagrm511," + ////// " raptklassts.MaxOsNagrm512," + ////// " raptklassts.MaxOsNagrm521," + ////// " raptklassts.MaxOsNagrm522," + ////// " raptklassts.MaxOsNagrm661," + ////// " raptklassts.MaxOsNagrm662," + ////// " raptklassts.MaxOsNagrm611," + ////// " raptklassts.MaxOsNagrm612," + ////// " raptklassts.MaxOsNagrm621," + ////// " raptklassts.MaxOsNagrm622," + ////// " raptklassts.MaxOsNagrm761," + ////// " raptklassts.MaxOsNagrm762," + ////// " raptklassts.MaxOsNagrm711," + ////// " raptklassts.MaxOsNagrm712," + ////// " raptklassts.MaxOsNagrm721," + ////// " raptklassts.MaxOsNagrm722," + ////// "raptklassts.MaxOsNagrm861," + ////// "raptklassts.MaxOsNagrm862," + ////// "raptklassts.MaxOsNagrm811," + ////// "raptklassts.MaxOsNagrm812," + ////// "raptklassts.MaxOsNagrm821," + ////// "raptklassts.MaxOsNagrm822," + ////// " raptklassts.Kategory," + ////// " raptklassts.PolnMassb," + ////// " raptklassts.SubCategory," + ////// " raptklassts.PolnMassm," + ////// " raptklassts.prim " + ////// "FROM raptklassts " + ////// "WHERE raptklassts.idklassts = " + IDTS; ////// cmd.Connection = sqlConnectionT; ////// MySqlDataReader readerT; ////// try ////// { ////// sqlConnectionT.Open(); ////// readerT = cmd.ExecuteReader(); ////// while (readerT.Read()) ////// { ////// alphaBlendTextBox26.Text = readerT["Klass"].ToString(); ////// alphaBlendTextBox1.Text = readerT["naimklassts"].ToString(); ////// alphaBlendTextBox2.Text = readerT["tipschema"].ToString(); ////// alphaBlendTextBox3.Text = readerT["ColOsey"].ToString(); ////// alphaBlendTextBox4.Text = readerT["Distanc1_2Min"].ToString(); ////// alphaBlendTextBox5.Text = readerT["Distanc1_2Max"].ToString(); ////// alphaBlendTextBox6.Text = readerT["Distanc2_3Min"].ToString(); ////// alphaBlendTextBox7.Text = readerT["Distanc2_3Max"].ToString(); ////// alphaBlendTextBox8.Text = readerT["Distanc3_4Min"].ToString(); ////// alphaBlendTextBox9.Text = readerT["Distanc3_4Max"].ToString(); ////// alphaBlendTextBox10.Text = readerT["Distanc4_5Min"].ToString(); ////// alphaBlendTextBox11.Text = readerT["Distanc4_5Max"].ToString(); ////// alphaBlendTextBox12.Text = readerT["Distanc5_6Min"].ToString(); ////// alphaBlendTextBox13.Text = readerT["Distanc5_6Max"].ToString(); ////// alphaBlendTextBox14.Text = readerT["Distanc6_7Min"].ToString(); ////// alphaBlendTextBox15.Text = readerT["Distanc6_7Max"].ToString(); ////// alphaBlendTextBox16.Text = readerT["Distanc7_8Min"].ToString(); ////// alphaBlendTextBox17.Text = readerT["Distanc7_8Max"].ToString(); ////// alphaBlendTextBox32.Text = readerT["MaxOsNagrm161"].ToString(); ////// alphaBlendTextBox39.Text = readerT["MaxOsNagrm162"].ToString(); ////// alphaBlendTextBox46.Text = readerT["MaxOsNagrm111"].ToString(); ////// alphaBlendTextBox53.Text = readerT["MaxOsNagrm112"].ToString(); ////// alphaBlendTextBox60.Text = readerT["MaxOsNagrm121"].ToString(); ////// alphaBlendTextBox67.Text = readerT["MaxOsNagrm122"].ToString(); ////// alphaBlendTextBox31.Text = readerT["MaxOsNagrm261"].ToString(); ////// alphaBlendTextBox38.Text = readerT["MaxOsNagrm262"].ToString(); ////// alphaBlendTextBox45.Text = readerT["MaxOsNagrm211"].ToString(); ////// alphaBlendTextBox52.Text = readerT["MaxOsNagrm212"].ToString(); ////// alphaBlendTextBox59.Text = readerT["MaxOsNagrm221"].ToString(); ////// alphaBlendTextBox66.Text = readerT["MaxOsNagrm222"].ToString(); ////// alphaBlendTextBox30.Text = readerT["MaxOsNagrm361"].ToString(); ////// alphaBlendTextBox37.Text = readerT["MaxOsNagrm362"].ToString(); ////// alphaBlendTextBox44.Text = readerT["MaxOsNagrm311"].ToString(); ////// alphaBlendTextBox51.Text = readerT["MaxOsNagrm312"].ToString(); ////// alphaBlendTextBox58.Text = readerT["MaxOsNagrm321"].ToString(); ////// alphaBlendTextBox65.Text = readerT["MaxOsNagrm322"].ToString(); ////// alphaBlendTextBox29.Text = readerT["MaxOsNagrm461"].ToString(); ////// alphaBlendTextBox36.Text = readerT["MaxOsNagrm462"].ToString(); ////// alphaBlendTextBox43.Text = readerT["MaxOsNagrm411"].ToString(); ////// alphaBlendTextBox50.Text = readerT["MaxOsNagrm412"].ToString(); ////// alphaBlendTextBox57.Text = readerT["MaxOsNagrm421"].ToString(); ////// alphaBlendTextBox64.Text = readerT["MaxOsNagrm422"].ToString(); ////// alphaBlendTextBox28.Text = readerT["MaxOsNagrm561"].ToString(); ////// alphaBlendTextBox35.Text = readerT["MaxOsNagrm562"].ToString(); ////// alphaBlendTextBox42.Text = readerT["MaxOsNagrm511"].ToString(); ////// alphaBlendTextBox49.Text = readerT["MaxOsNagrm512"].ToString(); ////// alphaBlendTextBox56.Text = readerT["MaxOsNagrm521"].ToString(); ////// alphaBlendTextBox63.Text = readerT["MaxOsNagrm522"].ToString(); ////// alphaBlendTextBox27.Text = readerT["MaxOsNagrm661"].ToString(); ////// alphaBlendTextBox34.Text = readerT["MaxOsNagrm662"].ToString(); ////// alphaBlendTextBox41.Text = readerT["MaxOsNagrm611"].ToString(); ////// alphaBlendTextBox48.Text = readerT["MaxOsNagrm612"].ToString(); ////// alphaBlendTextBox55.Text = readerT["MaxOsNagrm621"].ToString(); ////// alphaBlendTextBox62.Text = readerT["MaxOsNagrm622"].ToString(); ////// alphaBlendTextBox25.Text = readerT["MaxOsNagrm761"].ToString(); ////// alphaBlendTextBox33.Text = readerT["MaxOsNagrm762"].ToString(); ////// alphaBlendTextBox40.Text = readerT["MaxOsNagrm711"].ToString(); ////// alphaBlendTextBox47.Text = readerT["MaxOsNagrm712"].ToString(); ////// alphaBlendTextBox54.Text = readerT["MaxOsNagrm721"].ToString(); ////// alphaBlendTextBox61.Text = readerT["MaxOsNagrm722"].ToString(); ////// alphaBlendTextBox73.Text = readerT["MaxOsNagrm861"].ToString(); ////// alphaBlendTextBox72.Text = readerT["MaxOsNagrm862"].ToString(); ////// alphaBlendTextBox71.Text = readerT["MaxOsNagrm811"].ToString(); ////// alphaBlendTextBox70.Text = readerT["MaxOsNagrm812"].ToString(); ////// alphaBlendTextBox69.Text = readerT["MaxOsNagrm821"].ToString(); ////// alphaBlendTextBox68.Text = readerT["MaxOsNagrm822"].ToString(); ////// alphaBlendTextBox22.Text = readerT["Kategory"].ToString(); ////// alphaBlendTextBox21.Text = readerT["PolnMassb"].ToString(); ////// alphaBlendTextBox23.Text = readerT["SubCategory"].ToString(); ////// alphaBlendTextBox20.Text = readerT["PolnMassm"].ToString(); ////// alphaBlendTextBox24.Text = readerT["prim"].ToString(); ////// } ////// IDKL = IDTS; ////// readerT.Close(); ////// } ////// catch (MySqlException ex) ////// { ////// Console.WriteLine("Error: \r\n{0}", ex.ToString()); ////// } ////// finally ////// { ////// cmd.Connection.Close(); ////// } //////} #endregion public void butUP(string[] Us)///////////// Кнопка ОБНОВИТЬ ////////////////////// { ConnectStr conStrU = new ConnectStr(); Zapros zaprosU = new Zapros(); //int IDU = 0; conStrU.ConStr(1); //zaprosU.KartUser(0); cstrU = conStrU.StP; MySql.Data.MySqlClient.MySqlConnection sqlConnectionT = new MySql.Data.MySqlClient.MySqlConnection(cstrU); MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(); cmd.CommandText = "UPDATE raptuser " + "SET user = '******', " + "passuser = '******' , " + " r1 = " + Convert.ToInt32(Us[9]) + " , " + " r2 = " + Convert.ToInt32(Us[10]) + " , " + " r3 = " + Convert.ToInt32(Us[11]) + " , " + " r4 = " + Convert.ToInt32(Us[12]) + " , " + " r5 = " + Convert.ToInt32(Us[13]) + " , " + " r6 = " + Convert.ToInt32(Us[14]) + " , " + " r7 = " + Convert.ToInt32(Us[15]) + " , " + " r8 = " + Convert.ToInt32(Us[16]) + " , " + " r9 = " + Convert.ToInt32(Us[17]) + " , " + " r10 = " + Convert.ToInt32(Us[18]) + " , " + " r11 = " + Convert.ToInt32(Us[19]) + " , " + " r12 = " + Convert.ToInt32(Us[20]) + " , " + " r13 = " + Convert.ToInt32(Us[21]) + " , " + " famu = '" + Us[3] + "' , " + " nameu = '" + Us[4] + "' , " + " otchu = '" + Us[5] + "' , " + " doljnostu = '" + Us[6] + "' , " + " telu = '" + Us[7] + "' , " + " E_mail = '" + Us[8] + "' WHERE iduser = " + Convert.ToInt32(Us[0]); cmd.Connection = sqlConnectionT; sqlConnectionT.Open(); cmd.ExecuteNonQuery(); sqlConnectionT.Close(); //Close(); }
private void button1_Click(object sender, EventArgs e)///кнопка сохранить новое рабочее место { //Rab_mesto, Photo, XML_Ang, Akt_Arch, BD_log, BD_pass, BD_Name, BD_adr, Mail_in, Mail_in_pass, Mail_out, Mail_out_pass, Adr_SR, Adr_Avtodor, CompName Param[0] = textBox1.Text.ToString(); Param[1] = textBox2.Text.ToString(); Param[2] = textBox3.Text.ToString(); Param[3] = textBox4.Text.ToString(); Param[4] = ""; //textBox4.Text.ToString(); Param[5] = ""; //textBox4.Text.ToString(); Param[6] = ""; //textBox4.Text.ToString(); Param[7] = ""; //textBox4.Text.ToString(); Param[8] = ""; //textBox4.Text.ToString(); Param[9] = ""; //textBox4.Text.ToString(); Param[10] = ""; //textBox4.Text.ToString(); Param[11] = ""; //textBox4.Text.ToString(); Param[12] = ""; //textBox4.Text.ToString(); Param[13] = ""; //textBox4.Text.ToString(); Param[14] = label2.Text.ToString(); MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); Zapros zapros = new Zapros(); zapros.DobNastrPuti(Param); string z = zapros.commandStringTest; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button2_Click(object sender, EventArgs e)//////////////////////////// Сохранение изменений в Рабочих местах { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); //zapros.AD(IDRN); string z = "UPDATE rap_nastr_puti " + "SET CompName = '" + label2.Text + "', " + "Rab_mesto = '" + textBox1.Text + "', " + "Photo = '" + textBox2.Text + "', " + "XML_Ang = '" + textBox3.Text + "', " + "Akt_Arch = '" + textBox4.Text + "' " + //"ChisloPolos = " + Convert.ToInt32(alphaBlendTextBox15.Text) + ", " + //"ChisloNapravlen = " + Convert.ToInt32(alphaBlendTextBox2.Text) + ", " + //"ObshProtyajAD = '" + alphaBlendTextBox3.Text + "', " + //"widthAD = " + Convert.ToDouble(alphaBlendTextBox4.Text) + ", " + //"widthObochin = " + Convert.ToDouble(alphaBlendTextBox6.Text) + ", " + //"widthRazdPolos = " + Convert.ToDouble(alphaBlendTextBox5.Text) + ", " + //"VladeletsAD = '" + alphaBlendTextBox22.Text + "', " + //"AdrVladel = '" + alphaBlendTextBox21.Text + "', " + //"KontaktVladel = '" + alphaBlendTextBox20.Text + "', " + //"OtvLVladel = '" + alphaBlendTextBox7.Text + "' " + " WHERE IDPut = " + IDRM; command.CommandText = z;// commandString; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button2_Click(object sender, EventArgs e)//////////////////////////// Сохранение изменений в AD { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); //zapros.AD(IDRN); string z = "UPDATE rapdoroga " + "SET IDAD = " + Convert.ToInt32(alphaBlendTextBox26.Text) + ", " + "UchNomer = '" + alphaBlendTextBox1.Text + "', " + "`Name Dor` = '" + alphaBlendTextBox31.Text + "', " + "KatergryAD = " + Convert.ToInt32(alphaBlendTextBox16.Text) + ", " + "ZnachenAD = '" + comboBox1.Text + "', " + "ChisloPolos = " + Convert.ToInt32(alphaBlendTextBox15.Text) + ", " + "ChisloNapravlen = " + Convert.ToInt32(alphaBlendTextBox2.Text) + ", " + "ObshProtyajAD = '" + alphaBlendTextBox3.Text + "', " + "widthAD = " + Convert.ToDouble(alphaBlendTextBox4.Text) + ", " + "widthObochin = " + Convert.ToDouble(alphaBlendTextBox6.Text) + ", " + "widthRazdPolos = " + Convert.ToDouble(alphaBlendTextBox5.Text) + ", " + "VladeletsAD = '" + alphaBlendTextBox22.Text + "', " + "AdrVladel = '" + alphaBlendTextBox21.Text + "', " + "KontaktVladel = '" + alphaBlendTextBox20.Text + "', " + "OtvLVladel = '" + alphaBlendTextBox7.Text + "' " + " WHERE id = " + IDRub; command.CommandText = z;// commandString; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button1_Click(object sender, EventArgs e) { int TO; if (comboBox1.Text == "Одиночное ТС") { TO = 1; } else { TO = 2; } string z = "INSERT INTO rapdopmassts (" + "typets, " + "kolos, " + "pdmassts) " + "VALUES ( " + "" + TO + ", " + "" + Convert.ToInt32(alphaBlendTextBox6.Text.ToString()) + ", " + "" + Convert.ToInt32(alphaBlendTextBox4.Text.ToString()) + "); "; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void comboBox1_MouseClick(object sender, MouseEventArgs e) { ConnectStr conStrComCOMBO = new ConnectStr(); Zapros zaprosCom = new Zapros(); conStrComCOMBO.ConStr(1); zaprosCom.COMBOKOMPL(); cstr = conStrComCOMBO.StP; z = "SELECT " + "raptsprnar.tipnar AS TN, tipnarN " + "FROM raptsprnar " + "GROUP BY raptsprnar.tipnar"; MySqlConnection connectionCOMBO = new MySqlConnection(cstr); mySqlDataAdapter = new MySqlDataAdapter(z, connectionCOMBO); DataSet DSCOMBO = new DataSet(); mySqlDataAdapter.Fill(DSCOMBO); comboBox1.DataSource = DSCOMBO.Tables[0]; comboBox1.DisplayMember = "tipnarN"; comboBox1.ValueMember = "TN"; connectionCOMBO.Close(); }
private void button2_Click(object sender, EventArgs e) { int TO; if (comboBox1.Text == "Одиночное ТС") { TO = 1; } else { TO = 2; } string z = "UPDATE rapdopmassts " + "SET typets = " + TO + ", " + "kolos = " + Convert.ToInt32(alphaBlendTextBox6.Text.ToString()) + ", " + "pdmassts = " + Convert.ToInt32(alphaBlendTextBox4.Text.ToString()) + " " + "WHERE iddmts = " + IDPDKOb + ";"; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button2_Click(object sender, EventArgs e)//////////////////////////// Сохранение изменений в рубеже и направлении { if (alphaBlendTextBox14.Text == "") { alphaBlendTextBox14.Text = "0"; } MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); string z = "UPDATE rapraspolojenrubeja" + " SET nameapvk ='" + alphaBlendTextBox26.Text.ToString() + "', " + "kodapvk = '" + alphaBlendTextBox1.Text.ToString() + "', " + "sernum = '" + alphaBlendTextBox2.Text.ToString() + "', " + "dislocationapvk = '" + alphaBlendTextBox3.Text.ToString() + "', " + "shir = " + Convert.ToDecimal(alphaBlendTextBox4.Text.Replace(",", ".").ToString()) + ", " + "dolg = " + Convert.ToDecimal(alphaBlendTextBox5.Text.Replace(",", ".").ToString()) + ", " + "ad_znachen = '" + alphaBlendTextBox7.Text.ToString() + "', " + "maxosnagr = " + Convert.ToDouble(alphaBlendTextBox9.Text.ToString()) + ", " + "namead = '" + alphaBlendTextBox6.Text.ToString() + "', " + "partad = '" + alphaBlendTextBox8.Text.ToString() + "', " + "ogranich = '" + alphaBlendTextBox10.Text.ToString() + "', " + "Speed = " + Convert.ToDouble(alphaBlendTextBox14.Text.ToString()) + ", " + "primechanie = '" + alphaBlendTextBox11.Text.ToString() + "', " + "IDWim = '" + alphaBlendTextBox31.Text.ToString() + "', " + //"IDDir = '" + alphaBlendTextBox26.Text.ToString() + "', " + //"Vladel = '" + alphaBlendTextBox26.Text.ToString() + "', " + "TipSI = '" + comboBox1.Text.ToString() + "', " + "Model = '" + alphaBlendTextBox16.Text.ToString() + "', " + "NomSvidTipaSI = '" + alphaBlendTextBox19.Text.ToString() + "', " + "DateVidSTSI = '" + alphaBlendTextBox18.Text.ToString() + "', " + "RegNomSTSI = '" + alphaBlendTextBox17.Text.ToString() + "', " + "NomSPSI = '" + alphaBlendTextBox22.Text.ToString() + "', " + "DateVidSPSI = '" + alphaBlendTextBox21.Text.ToString() + "', " + "SrokSPSI = '" + alphaBlendTextBox20.Text.ToString() + "', " + "NormPravAktAD = '" + alphaBlendTextBox23.Text.ToString() + "' " + //"CheckPointCode = '" + alphaBlendTextBox26.Text.ToString() + "' " + "WHERE idrub = " + IDRub; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); //Close(); for (int i = 1; i < 3; i++) { if (i == 1) { KODNapr = "1";// alphaBlendTextBox25.Text; //MySqlCommand command = new MySqlCommand(); //ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); //string connectionString; connectionString = conStr.StP; //MySqlConnection connection = new MySqlConnection(connectionString); z = "UPDATE raptnapr " + "SET namenapr = '" + alphaBlendTextBox27.Text.ToString() + "', " + "npolos = " + Convert.ToInt32(alphaBlendTextBox24.Text.ToString()) + " , " + "PlatfID = '" + alphaBlendTextBox31.Text.ToString() + "' , " + "KodNapr = '1'" + //alphaBlendTextBox25.Text.ToString() + "'" + " WHERE KodNapr = '" + KODNapr + "' AND raptnapr.IDKOMPL = '" + IDRub.ToString() + "'"; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } else { KODNapr = "1";// alphaBlendTextBox25.Text; //MySqlCommand command = new MySqlCommand(); //ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); //string connectionString; connectionString = conStr.StP; //MySqlConnection connection = new MySqlConnection(connectionString); z = "UPDATE raptnapr " + "SET namenapr = '" + alphaBlendTextBox30.Text.ToString() + "', " + "npolos = " + Convert.ToInt32(alphaBlendTextBox28.Text.ToString()) + " , " + "PlatfID = '" + alphaBlendTextBox31.Text.ToString() + "' , " + "KodNapr = '1'" + " WHERE KodNapr = '" + KODNapr + "' AND raptnapr.IDKOMPL = '" + IDRub.ToString() + "'"; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } } Close(); }
private void btnLogin_Click(object sender, EventArgs e) { str = new string[5]; N1 = tbName.Text; N2 = tbPassword.Text; tbName.Validating += new CancelEventHandler(ValidateTextBox); tbPassword.Validating += new CancelEventHandler(ValidateTextBox); try { MySqlCommand commandLB = new MySqlCommand(); ConnectStr conStrLB = new ConnectStr(); conStrLB.ConStr(1); Zapros zaprosLB = new Zapros(); string connectionStringLB; connectionStringLB = conStrLB.StP;; MySqlConnection connectionLB = new MySqlConnection(connectionStringLB); zaprosLB.ZaprUs(N1, N2); zUs = zaprosLB.commandStringTest; commandLB.CommandText = zUs; commandLB.Connection = connectionLB; MySqlDataReader readerLB; flag = false; try { commandLB.Connection.Open(); readerLB = commandLB.ExecuteReader(); if (readerLB.Read()) { flag = true; Us = Convert.ToInt32(readerLB["iduser"].ToString()); } readerLB.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { commandLB.Connection.Close(); } if (flag == true) { this.Cursor = Cursors.WaitCursor; #region ОТКРЫТИЕ ОСНОВНОЙ ФОРМЫ Program.Context.MainForm = new Form2(Us); this.Close(); //покажет вторую форму и оставит приложение живым до ее закрытия Program.Context.MainForm.Show(); #endregion } else { _countLogFailed++; if (_countLogFailed > _logins - 1) { //You can do to close login form or do waiting user for instance 1 minute MessageBox.Show("Вы ввели неправильные логин/пароль 3 раза. \n Новая попытка ввода возможна лишь через 1 минуту"); Thread.Sleep(60000); _logins = 3; _countLogFailed = 0; tbPassword.Text = ""; tbName.Text = ""; MessageBox.Show("Попробуйте еще раз..."); return; } MessageBox.Show("Введен ошибочный логин или пароль. \n Пожалуйста попробуйте еще раз. \n Осталось попыток входа: " + (_logins - _countLogFailed).ToString(), "Не удалось войти", MessageBoxButtons.OK); } } catch (Exception ex) { // Вывод сообщения об ошибке MessageBox.Show(ex.Message); } finally { } }
public void FormPDFN(Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string GAng, int[,] KNRA) //Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string N1, string N2, string N3)//public void FormPDF(System.IO.Stream i1, System.IO.Stream i2, System.IO.Stream i3, string[] args) { Puti[19] = System.Windows.Forms.SystemInformation.ComputerName.ToString(); MySqlCommand command2 = new MySqlCommand(); ConnectStr conStr2 = new ConnectStr(); conStr2.ConStr(1); Zapros zapros2 = new Zapros(); string connectionString2; //, commandString; connectionString2 = conStr2.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connection2 = new MySqlConnection(connectionString2); zapros2.NastrPuti(0, Puti[19]); string z2 = zapros2.commandStringTest; command2.CommandText = z2; command2.Connection = connection2; MySqlDataReader reader2; try { command2.Connection.Open(); reader2 = command2.ExecuteReader(); while (reader2.Read()) { Puti[0] = reader2["IDPut"].ToString(); Puti[1] = reader2["Rab_mesto"].ToString(); Puti[2] = reader2["Photo"].ToString(); Puti[3] = reader2["XML_Ang"].ToString(); Puti[4] = reader2["Akt_Arch"].ToString(); Puti[5] = reader2["CompName"].ToString(); } reader2.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command2.Connection.Close(); } String dir = Environment.CurrentDirectory; //получаем текущую рабочую папку приложения String dir1 = Application.StartupPath; //получаем папку из которой произошел запуск приложения var pdfTemplate = @"" + dir1 + "\\AKT.pdf"; if (Puti[5] == "WIN-D3J6PR1H9QK") { pdfFile = @"F:\\archiv\\AKT\\" + GAng + ".pdf"; } //args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; else { pdfFile = @"" + Puti[3] + GAng + ".pdf"; }; pf = GAng;//args[259] + "_" + DateTime.Now.ToString("ddMMyyyy"); using (var templateReader = new PdfReader(pdfTemplate)) { if (i1 != null) { System.Drawing.Bitmap imgg = new System.Drawing.Bitmap(i1); imag = iTextSharp.text.Image.GetInstance(imgg, System.Drawing.Imaging.ImageFormat.Jpeg);// @"C:\Users\cherednikov\Pictures\original22.jpg"); if (Puti[5] == "WIN-D3J6PR1H9QK") { imgg.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpg"); } else { imgg.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpg"); //File.Copy(@"" + N1, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.png"); }; } if (i2 != null) { System.Drawing.Bitmap imgg2 = new System.Drawing.Bitmap(i2); imag2 = iTextSharp.text.Image.GetInstance(imgg2, System.Drawing.Imaging.ImageFormat.Jpeg); if (Puti[5] == "WIN-D3J6PR1H9QK") { imgg2.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); } else { imgg2.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); //File.Copy(@"" + N2, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.png"); }; } if (i3 != null) { System.Drawing.Bitmap imgg3 = new System.Drawing.Bitmap(i3); imag3 = iTextSharp.text.Image.GetInstance(imgg3, System.Drawing.Imaging.ImageFormat.Jpeg); if (Puti[5] == "WIN-D3J6PR1H9QK") { imgg3.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpg"); } else { imgg3.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpg"); //File.Copy(@"" + N3, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.png"); }; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////var doc = new Document(); ////////////PdfWriter.GetInstance(doc, new FileStream(Application.StartupPath + @"\Document.pdf", FileMode.Create)); ////////////doc.Open(); ////////////iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/images.jpg"); ////////////jpg.Alignment = Element.ALIGN_CENTER; ////////////doc.Add(jpg); ////////////PdfPTable table = new PdfPTable(3); ////////////PdfPCell cell = new PdfPCell(new Phrase("Simple table", //////////// new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 16, //////////// iTextSharp.text.Font.NORMAL, new BaseColor(Color.Orange)))); ////////////cell.BackgroundColor = new BaseColor(Color.Wheat); ////////////cell.Padding = 5; ////////////cell.Colspan = 3; ////////////cell.HorizontalAlignment = Element.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////table.AddCell("Col 1 Row 1"); ////////////table.AddCell("Col 2 Row 1"); ////////////table.AddCell("Col 3 Row 1"); ////////////table.AddCell("Col 1 Row 2"); ////////////table.AddCell("Col 2 Row 2"); ////////////table.AddCell("Col 3 Row 2"); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/left.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT; ////////////table.AddCell(cell); ////////////cell = new PdfPCell(new Phrase("Col 2 Row 3")); ////////////cell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/right.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_RIGHT; ////////////table.AddCell(cell); ////////////doc.Add(table); ////////////doc.Close(); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// using (var resultStamper = new PdfStamper(templateReader, new FileStream(pdfFile, FileMode.Create))) { var pdfcontentbyte = resultStamper.GetOverContent(1); if (i1 != null) { imag.SetAbsolutePosition(55, 369); //695 imag.ScaleAbsoluteWidth(127); imag.ScaleAbsoluteHeight(90); imag.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag); } if (i2 != null) { imag2.SetAbsolutePosition(230, 417); //745 imag2.ScaleAbsoluteWidth(137); imag2.ScaleAbsoluteHeight(40); imag2.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag2); } if (i3 != null) { imag3.SetAbsolutePosition(404, 369); //696 imag3.ScaleAbsoluteWidth(146); imag3.ScaleAbsoluteHeight(89); imag3.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag3); } PdfPTable table = new PdfPTable(14); table.AddCell("Cell 1"); table.AddCell("Cell 2"); table.AddCell("Cell 3"); table.AddCell("Cell 4"); table.AddCell("Cell 5"); table.AddCell("Cell 6"); table.AddCell("Cell 7"); table.AddCell("Cell 8"); // Получаем ссылку на форму с полями. var form = resultStamper.AcroFields; // Получаем все шрифты формы. //BaseFont baseFont = BaseFont.CreateFont(@"C:\Users\cherednikov\Desktop\WFPDF\WFPDF\calibri.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //iTextSharp.text.Font font = new iTextSharp.text.Font(baseFont, iTextSharp.text.Font.DEFAULTSIZE, iTextSharp.text.Font.NORMAL); var font = templateReader.GetFormFonts(); // Установка значений полей формы. // Установка значений полей формы. form.SetFieldWithFont(templateReader, font, "A1", args[0]); form.SetFieldWithFont(templateReader, font, "A3", args[1]); form.SetFieldWithFont(templateReader, font, "A4", args[2]); form.SetFieldWithFont(templateReader, font, "A5", args[3]); form.SetFieldWithFont(templateReader, font, "A6", args[4]); form.SetField("A2", args[250]); form.SetField("A9", args[5] + ", " + args[6]); form.SetField("A7", args[7]); form.SetField("A8", args[8]); form.SetField("A10", args[9]); form.SetField("A11", args[21]); form.SetField("A12", args[10]); form.SetField("A13", "ДТ и РДТИ г. Севастополя");// args[11]); form.SetField("A14", args[25]); form.SetField("A15", args[26]); form.SetField("A16", args[28]); form.SetField("A17", args[27]); form.SetField("A19", args[29]); form.SetField("A20", args[41]); form.SetField("A21", args[42]); form.SetField("A22", args[43]); form.SetField("A18", "-"); /*ОБЩ_МАССА*/ form.SetField("A23", args[65]); form.SetField("A24", args[66]); form.SetField("A25", args[67]); form.SetField("A26", args[68]); form.SetField("A27", args[69]); form.SetField("A28", args[70]); /*ДЛИНА*/ form.SetField("A29", args[44]); form.SetField("A30", args[47]); form.SetField("A31", args[50]); form.SetField("A32", args[53]); form.SetField("A33", args[56]); /*form.SetField("A55", args[59])*/; form.SetField("A34", args[62]); /*ШИРИНА*/ form.SetField("A35", args[45]); form.SetField("A36", args[48]); form.SetField("A37", args[51]); form.SetField("A38", args[54]); form.SetField("A39", args[57]); /*form.SetField("A56", args[60])*/; form.SetField("A40", args[63]); /*ВЫСОТА*/ form.SetField("A41", args[46]); form.SetField("A42", args[49]); form.SetField("A43", args[52]); form.SetField("A44", args[55]); form.SetField("A45", args[58]); /*form.SetField("A57", args[61]);*/ form.SetField("A46", args[64]); /*СКАТНОСТЬ_КОЛ_КОЛЕС*/ form.SetField("A47", args[73]); form.SetField("A48", args[84]); form.SetField("A49", args[95]); form.SetField("A50", args[106]); form.SetField("A51", args[117]); form.SetField("A52", args[128]); form.SetField("A53", args[139]); form.SetField("A54", args[150]); form.SetField("A55", args[161]); /*СКАТНОСТ_КОЛ_КОЛЕС_ПО_СПЕЦ_РАЗР*/ if (args[73] != null) { form.SetField("A56", "-"); } if (args[84] != null) { form.SetField("A57", "-"); } if (args[95] != null) { form.SetField("A58", "-"); } if (args[106] != null) { form.SetField("A59", "-"); } if (args[117] != null) { form.SetField("A60", "-"); } if (args[128] != null) { form.SetField("A61", "-"); } if (args[139] != null) { form.SetField("A62", "-"); } if (args[150] != null) { form.SetField("A63", "-"); } if (args[161] != null) { form.SetField("A64", "-"); } //МЕЖОСЕВЫЕ if (args[86] != null) { form.SetField("A65", "+ 0.03"); } if (args[97] != null) { form.SetField("A66", "+ 0.03"); } if (args[108] != null) { form.SetField("A67", "+ 0.03"); } if (args[119] != null) { form.SetField("A68", "+ 0.03"); } if (args[130] != null) { form.SetField("A69", "+ 0.03"); } if (args[141] != null) { form.SetField("A70", "+ 0.03"); } if (args[152] != null) { form.SetField("A71", "+ 0.03"); } if (args[163] != null) { form.SetField("A72", "+ 0.03"); } form.SetField("A73", args[86]); form.SetField("A74", args[97]); form.SetField("A75", args[108]); form.SetField("A76", args[119]); form.SetField("A77", args[130]); form.SetField("A78", args[141]); form.SetField("A79", args[152]); form.SetField("A80", args[163]); form.SetField("A81", args[87]); form.SetField("A82", args[98]); form.SetField("A83", args[109]); form.SetField("A84", args[120]); form.SetField("A85", args[131]); form.SetField("A86", args[142]); form.SetField("A87", args[153]); form.SetField("A88", args[164]); /*Факт_нагрузка_на_оси */ form.SetField("A141", args[77]); form.SetField("A142", args[88]); form.SetField("A143", args[99]); form.SetField("A144", args[110]); form.SetField("A145", args[121]); form.SetField("A146", args[132]); form.SetField("A147", args[143]); form.SetField("A148", args[154]); form.SetField("A149", args[165]); /*Погрешность_нагрузки_на_оси */ form.SetField("A132", Convert.ToString(Convert.ToDouble(args[77]) * 0.1)); form.SetField("A133", Convert.ToString(Convert.ToDouble(args[88]) * 0.1)); form.SetField("A134", Convert.ToString(Convert.ToDouble(args[99]) * 0.1)); form.SetField("A135", Convert.ToString(Convert.ToDouble(args[110]) * 0.1)); form.SetField("A136", Convert.ToString(Convert.ToDouble(args[121]) * 0.1)); form.SetField("A137", Convert.ToString(Convert.ToDouble(args[132]) * 0.1)); form.SetField("A138", Convert.ToString(Convert.ToDouble(args[143]) * 0.1)); form.SetField("A139", Convert.ToString(Convert.ToDouble(args[154]) * 0.1)); form.SetField("A140", Convert.ToString(Convert.ToDouble(args[165]) * 0.1)); /*вычисленные_нагрузки_на_оси */ form.SetField("A150", args[78]); form.SetField("A151", args[89]); form.SetField("A152", args[100]); form.SetField("A153", args[111]); form.SetField("A154", args[122]); form.SetField("A155", args[133]); form.SetField("A156", args[144]); form.SetField("A157", args[155]); form.SetField("A158", args[167]); /*ПДК_нагрузки_на_оси */ form.SetField("A159", args[79]); form.SetField("A160", args[90]); form.SetField("A161", args[101]); form.SetField("A162", args[112]); form.SetField("A163", args[123]); form.SetField("A164", args[134]); form.SetField("A165", args[145]); form.SetField("A166", args[156]); form.SetField("A167", args[167]); /*ПДК_по_спец.разрешению_нагрузки_на_оси */ form.SetField("A168", args[80]); form.SetField("A169", args[91]); form.SetField("A170", args[102]); form.SetField("A171", args[113]); form.SetField("A172", args[124]); form.SetField("A173", args[135]); form.SetField("A174", args[146]); form.SetField("A175", args[157]); form.SetField("A176", args[168]); /*_%_превышения_нагрузки_на_оси */ form.SetField("A177", args[81]); form.SetField("A178", args[92]); form.SetField("A179", args[103]); form.SetField("A180", args[114]); form.SetField("A181", args[125]); form.SetField("A182", args[136]); form.SetField("A183", args[147]); form.SetField("A184", args[158]); form.SetField("A185", args[169]); /*_Скорость_ТС_превышения_скорости */ form.SetField("A186", args[251]); form.SetField("A187", args[252]); form.SetField("A188", args[253]); form.SetField("A189", args[254]); form.SetField("A190", args[255]); form.SetField("A191", args[256]); form.SetField("A192", args[257]); /*ИНФОРМАЦИЯ ПО СПЕЦ.РАЗРЕШЕНИЮ */ form.SetField("A193", args[30]); form.SetField("A194", args[32]); form.SetField("A195", args[33]); form.SetField("A196", args[34]); form.SetField("A197", args[35]); form.SetField("A198", args[36]); form.SetField("A199", args[37]); form.SetField("A200", args[39]); form.SetField("A201", args[38]); form.SetField("A202", "-" /*args[169]*/); form.SetField("A203", args[218]); form.SetField("A204", args[229]); /*_Информация о поверке */ form.SetField("A205", args[12]); form.SetField("A206", args[15]); form.SetField("A207", args[14]); form.SetField("A208", args[16]); form.SetField("A209", args[13]); form.SetField("A210", args[17]); /*Информация о контолируемом участке */ if (args[18] == "Региональная") { form.SetField("A211", "Автомобильная дорога регионального значения общего пользования города Севастополь"); } else if (args[18] == "Муниципальная") { form.SetField("A211", "Автомобильная дорога муниципального значения общего пользования города Севастополь"); } else if (args[18] == "Федеральная") { form.SetField("A211", "Автомобильная дорога федерального значения общего пользования города Севастополь"); } //form.SetField("A211", args[18]); form.SetField("A212", args[9]); form.SetField("A213", args[19]); form.SetField("A214", args[10]); form.SetField("A215", "Автомобильная дорога рассчитана под нормативную осевую нагрузку 10 тонн на ось" /*args[125]*/); form.SetField("A216", "Приказ ДТиРДТИ г. Севастополя № ____________от ______________ " /*args[136]*/); form.SetField("A217", args[245]); form.SetField("A218", args[246]); form.SetField("A219", "-" /*args[169]*/); string CheckField = ""; int k = 1; int j = 0; int width = 0; int i = 1; int c = 0; int count = 0; while (KNRA[1, c] > 0) { count = count + KNRA[1, c]; c++; } string Name_field = ""; while (i <= 8) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 1) { width = KNRA[1, j]; } else { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j] - 1; //int c = j + 1; //while (KNRA[0,c] > 0) //{ // KNRA[0, c] = KNRA[0, c] - 1; // c++; //} } Name_field = "A" + '5' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 8) { CheckField = "A" + "5" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[164 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '6' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "6" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[166 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '7' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "7" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[167 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '8' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "8" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[168 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '9' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "9" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[169 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } // Установка запрета на редактирование полей. resultStamper.FormFlattening = true; resultStamper.Writer.Add(table); resultStamper.Close(); } templateReader.Close(); } //File.Copy(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + pf + ".pdf", @"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\123777\\" + pf + ".pdf"); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); } //else { File.Copy(@"" + Puti[3] + pf + ".pdf", @"" + Puti[4] + pf + ".pdf"); }; // File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); }
private void button1_Click(object sender, EventArgs e)/////////////Кнопка Сохранить (для нового проезда) { if (checkBox1.Checked == true) { TabNar[1, 0] = textBox1.Text.ToString(); TabNar[1, 1] = comboBox1.Text.ToString(); TabNar[1, 2] = textBox14.Text.ToString(); TabNar[1, 3] = textBox20.Text.ToString(); TabNar[1, 4] = textBox26.Text.ToString(); TabNar[1, 5] = textBox32.Text.ToString(); TabNar[1, 6] = textBox33.Text.ToString(); TabNar[1, 7] = textBox34.Text.ToString(); TabNar[1, 8] = textBox35.Text.ToString(); TabNar[1, 9] = textBox3.Text.ToString(); TabNar[2, 0] = textBox1.Text.ToString(); TabNar[2, 1] = comboBox1.Text.ToString(); TabNar[2, 2] = textBox13.Text.ToString(); TabNar[2, 3] = textBox19.Text.ToString(); TabNar[2, 4] = textBox25.Text.ToString(); TabNar[2, 5] = textBox31.Text.ToString(); TabNar[2, 6] = textBox33.Text.ToString(); TabNar[2, 7] = textBox34.Text.ToString(); TabNar[2, 8] = textBox35.Text.ToString(); TabNar[2, 9] = textBox4.Text.ToString(); TabNar[3, 0] = textBox1.Text.ToString(); TabNar[3, 1] = comboBox1.Text.ToString(); TabNar[3, 2] = textBox12.Text.ToString(); TabNar[3, 3] = textBox18.Text.ToString(); TabNar[3, 4] = textBox24.Text.ToString(); TabNar[3, 5] = textBox30.Text.ToString(); TabNar[3, 6] = textBox33.Text.ToString(); TabNar[3, 7] = textBox34.Text.ToString(); TabNar[3, 8] = textBox35.Text.ToString(); TabNar[3, 9] = textBox5.Text.ToString(); TabNar[4, 0] = textBox1.Text.ToString(); TabNar[4, 1] = comboBox1.Text.ToString(); TabNar[4, 2] = textBox11.Text.ToString(); TabNar[4, 3] = textBox17.Text.ToString(); TabNar[4, 4] = textBox23.Text.ToString(); TabNar[4, 5] = textBox29.Text.ToString(); TabNar[4, 6] = textBox33.Text.ToString(); TabNar[4, 7] = textBox34.Text.ToString(); TabNar[4, 8] = textBox35.Text.ToString(); TabNar[4, 9] = textBox6.Text.ToString(); TabNar[5, 0] = textBox1.Text.ToString(); TabNar[5, 1] = comboBox1.Text.ToString(); TabNar[5, 2] = textBox10.Text.ToString(); TabNar[5, 3] = textBox16.Text.ToString(); TabNar[5, 4] = textBox22.Text.ToString(); TabNar[5, 5] = textBox28.Text.ToString(); TabNar[5, 6] = textBox33.Text.ToString(); TabNar[5, 7] = textBox34.Text.ToString(); TabNar[5, 8] = textBox35.Text.ToString(); TabNar[5, 9] = textBox7.Text.ToString(); TabNar[6, 0] = textBox1.Text.ToString(); TabNar[6, 1] = comboBox1.Text.ToString(); TabNar[6, 2] = textBox9.Text.ToString(); TabNar[6, 3] = textBox15.Text.ToString(); TabNar[6, 4] = textBox21.Text.ToString(); TabNar[6, 5] = textBox27.Text.ToString(); TabNar[6, 6] = textBox33.Text.ToString(); TabNar[6, 7] = textBox34.Text.ToString(); TabNar[6, 8] = textBox35.Text.ToString(); TabNar[6, 9] = textBox8.Text.ToString(); for (int i = 1; i < 7; i++) { string stat = TabNar[i, 6] + " ч." + TabNar[i, 9]; string z = "INSERT INTO raptsprnar (" + "tipnar, " + "tipnarN, " + "ChastSt, " + "NoSRFor, " + "NoSRTo, " + "MitSRFor, " + "MitSRTo, " + "STATIA, " + "vidnar, " + "prmechannar ) " + "VALUES ( " + "" + Convert.ToInt32(TabNar[i, 0]) + ", " + "'" + TabNar[i, 1] + "', " + "" + Convert.ToInt32(TabNar[i, 9]) + ", " + "" + Convert.ToInt32(TabNar[i, 2]) + ", " + "" + Convert.ToInt32(TabNar[i, 3]) + ", " + "" + Convert.ToInt32(TabNar[i, 4]) + ", " + "" + Convert.ToInt32(TabNar[i, 5]) + ", " + "'" + stat.ToString() + "', " + "'" + TabNar[i, 7] + "', " + "'" + TabNar[i, 8] + "'); "; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } Close(); } }
private void button1_Click(object sender, EventArgs e)//////////////////////////// Добавление AD { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); //zapros.AD(IDRN); string z = " INSERT INTO rapmestodislokatsii ( " + "IDSYS, " + "UchNomer, " + "IDAD, " + "NameAD, " + "ZnachenAD, " + "KMPiketMD, " + "GPSDolg, " + "GPSShir, " + "GLONASDolg, " + "GLONASShir, " + "GMap, " + "YMap, " + "PrivyazkaNP, " + "NaznachenMD, " + "ObshChisloPolos, " + "ChisloNapravl, " + "ShirinaPD, " + "ShirinaOboch, " + "ShirinaRazdPol, " + "ShirinaSpeedPol, " + "ShirinaSpetsPlosh, " + "DlinaSpetsPlosh, " + "NomAktAccredpolos, " + "DataAccredPolos, " + "NomAccredSpetsPlosh, " + "DataAccredSpPlosh, " + "IDNaprR, IDNaprL, " + "CantryMD, " + "OKATOCantryMD, " + "SubjektMD, " + "OKATOSubjektMD, " + "MRajonMD, " + "OKATOMRajonMD, " + "ObjektMZMD, " + "OKATOObjektMZMD, " + "NPMD, OKATONPMD, " + "OrgobslADName, " + "OrgobslADAdr, " + "OrgobslADKontakt, " + "OrgobslADOL, " + "OrgobslESName, " + "OrgobslESAdr, " + "OrgobslESKontakt, " + "OrgobslESOL, " + "OrgobslSvyazName, " + "OrgobslSvyazAdr, " + "OrgobslSvyazKontakt, " + "OrgobslSvyazOL) " + "VALUES( '" + alphaBlendTextBox48.Text.ToString() + "', " + "'" + alphaBlendTextBox31.Text.ToString() + "', " + "'" + alphaBlendTextBox32.Text.ToString() + "', " + "'" + alphaBlendTextBox26.Text.ToString() + "', " + "'" + alphaBlendTextBox1.Text.ToString() + "', " + "'" + alphaBlendTextBox8.Text.ToString() + "', " + "'" + alphaBlendTextBox4.Text.ToString() + "', " + "'" + alphaBlendTextBox5.Text.ToString() + "', " + "'" + alphaBlendTextBox33.Text.ToString() + "', " + "'" + alphaBlendTextBox34.Text.ToString() + "', " + "'" + alphaBlendTextBox37.Text.ToString() + "', " + "'" + alphaBlendTextBox35.Text.ToString() + "', " + "'" + alphaBlendTextBox10.Text.ToString() + "', " + "'" + alphaBlendTextBox13.Text.ToString() + "', " + "" + Convert.ToInt32(alphaBlendTextBox22.Text.ToString()) + ", " + "'" + alphaBlendTextBox36.Text.ToString() + "', " + "'" + alphaBlendTextBox39.Text.ToString() + "', " + "'" + alphaBlendTextBox38.Text.ToString() + "', " + "'" + alphaBlendTextBox41.Text.ToString() + "', " + "'" + alphaBlendTextBox40.Text.ToString() + "', " + "'" + alphaBlendTextBox43.Text.ToString() + "', " + "'" + alphaBlendTextBox42.Text.ToString() + "', " + "'" + alphaBlendTextBox46.Text.ToString() + "', " + "'" + alphaBlendTextBox47.Text.ToString() + "', " + "'" + alphaBlendTextBox44.Text.ToString() + "', " + "'" + alphaBlendTextBox45.Text.ToString() + "', " + "" + Convert.ToInt32(alphaBlendTextBox50.Text.ToString()) + ", " + "" + Convert.ToInt32(alphaBlendTextBox51.Text.ToString()) + ", " + "'" + alphaBlendTextBox19.Text.ToString() + "', " + "'" + alphaBlendTextBox18.Text.ToString() + "', " + "'" + alphaBlendTextBox6.Text.ToString() + "', " + "'" + alphaBlendTextBox7.Text.ToString() + "', " + "'" + alphaBlendTextBox9.Text.ToString() + "', " + "'" + alphaBlendTextBox12.Text.ToString() + "', " + "'" + alphaBlendTextBox14.Text.ToString() + "', " + "'" + alphaBlendTextBox16.Text.ToString() + "', " + "'" + alphaBlendTextBox17.Text.ToString() + "', " + "'" + alphaBlendTextBox20.Text.ToString() + "', " + "'" + alphaBlendTextBox27.Text.ToString() + "', " + "'" + alphaBlendTextBox25.Text.ToString() + "', " + "'" + alphaBlendTextBox24.Text.ToString() + "', " + "'" + alphaBlendTextBox21.Text.ToString() + "', " + "'" + alphaBlendTextBox15.Text.ToString() + "', " + "'" + alphaBlendTextBox11.Text.ToString() + "', " + "'" + alphaBlendTextBox3.Text.ToString() + "', " + "'" + alphaBlendTextBox2.Text.ToString() + "', " + "'" + alphaBlendTextBox30.Text.ToString() + "', " + "'" + alphaBlendTextBox29.Text.ToString() + "', " + "'" + alphaBlendTextBox28.Text.ToString() + "', " + "'" + alphaBlendTextBox23.Text.ToString() + "');"; command.CommandText = z;// commandString; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button2_Click(object sender, EventArgs e)//////////////////////////// Сохранение изменений в AD { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); string z = "UPDATE rapmestodislokatsii " + "SET IDSYS = '" + alphaBlendTextBox48.Text.ToString() + "', " + "UchNomer = '" + alphaBlendTextBox31.Text.ToString() + "', " + "IDAD = '" + alphaBlendTextBox32.Text.ToString() + "', " + "NameAD = '" + alphaBlendTextBox26.Text.ToString() + "', " + "ZnachenAD = '" + alphaBlendTextBox1.Text.ToString() + "', " + "KMPiketMD = '" + alphaBlendTextBox8.Text.ToString() + "', " + "GPSDolg = '" + alphaBlendTextBox4.Text.ToString() + "', " + "GPSShir = '" + alphaBlendTextBox5.Text.ToString() + "', " + "GLONASDolg = '" + alphaBlendTextBox33.Text.ToString() + "', " + "GLONASShir = '" + alphaBlendTextBox34.Text.ToString() + "', " + "GMap = '" + alphaBlendTextBox37.Text.ToString() + "', " + "YMap = '" + alphaBlendTextBox35.Text.ToString() + "', " + "PrivyazkaNP = '" + alphaBlendTextBox10.Text.ToString() + "', " + "NaznachenMD = '" + alphaBlendTextBox13.Text.ToString() + "', " + "ObshChisloPolos = " + Convert.ToInt32(alphaBlendTextBox22.Text.ToString()) + ", " + "ChisloNapravl = '" + alphaBlendTextBox36.Text.ToString() + "', " + "ShirinaPD = '" + alphaBlendTextBox39.Text.ToString() + "', " + "ShirinaOboch = '" + alphaBlendTextBox38.Text.ToString() + "', " + "ShirinaRazdPol = '" + alphaBlendTextBox41.Text.ToString() + "', " + "ShirinaSpeedPol = '" + alphaBlendTextBox40.Text.ToString() + "', " + "ShirinaSpetsPlosh = '" + alphaBlendTextBox43.Text.ToString() + "', " + "DlinaSpetsPlosh = '" + alphaBlendTextBox42.Text.ToString() + "', " + "NomAktAccredpolos = '" + alphaBlendTextBox46.Text.ToString() + "', " + "DataAccredPolos = '" + alphaBlendTextBox47.Text.ToString() + "', " + "NomAccredSpetsPlosh = '" + alphaBlendTextBox44.Text.ToString() + "', " + "DataAccredSpPlosh = '" + alphaBlendTextBox45.Text.ToString() + "', " + "IDNaprR = " + Convert.ToInt32(alphaBlendTextBox50.Text.ToString()) + ", " + "IDNaprL = " + Convert.ToInt32(alphaBlendTextBox51.Text.ToString()) + ", " + "CantryMD = '" + alphaBlendTextBox19.Text.ToString() + "', " + "OKATOCantryMD = '" + alphaBlendTextBox18.Text.ToString() + "', " + "SubjektMD = '" + alphaBlendTextBox6.Text.ToString() + "', " + "OKATOSubjektMD = '" + alphaBlendTextBox7.Text.ToString() + "', " + "MRajonMD = '" + alphaBlendTextBox9.Text.ToString() + "', " + "OKATOMRajonMD = '" + alphaBlendTextBox12.Text.ToString() + "', " + "ObjektMZMD = '" + alphaBlendTextBox14.Text.ToString() + "', " + "OKATOObjektMZMD = '" + alphaBlendTextBox16.Text.ToString() + "', " + "NPMD = '" + alphaBlendTextBox17.Text.ToString() + "', " + "OKATONPMD = '" + alphaBlendTextBox20.Text.ToString() + "', " + "OrgobslADName = '" + alphaBlendTextBox27.Text.ToString() + "', " + "OrgobslADAdr = '" + alphaBlendTextBox25.Text.ToString() + "', " + "OrgobslADKontakt = '" + alphaBlendTextBox24.Text.ToString() + "', " + "OrgobslADOL = '" + alphaBlendTextBox21.Text.ToString() + "', " + "OrgobslESName = '" + alphaBlendTextBox15.Text.ToString() + "', " + "OrgobslESAdr = '" + alphaBlendTextBox11.Text.ToString() + "', " + "OrgobslESKontakt = '" + alphaBlendTextBox3.Text.ToString() + "', " + "OrgobslESOL = '" + alphaBlendTextBox2.Text.ToString() + "', " + "OrgobslSvyazName = '" + alphaBlendTextBox30.Text.ToString() + "', " + "OrgobslSvyazAdr = '" + alphaBlendTextBox29.Text.ToString() + "', " + "OrgobslSvyazKontakt = '" + alphaBlendTextBox28.Text.ToString() + "', " + "OrgobslSvyazOL = '" + alphaBlendTextBox23.Text.ToString() + "' " + "WHERE ID = " + IDRub; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
private void button2_Click(object sender, EventArgs e) { checkBox1.Checked = true; TabNar[1, 0] = textBox1.Text.ToString(); TabNar[1, 1] = comboBox1.Text.ToString(); TabNar[1, 2] = textBox14.Text.ToString(); TabNar[1, 3] = textBox20.Text.ToString(); TabNar[1, 4] = textBox26.Text.ToString(); TabNar[1, 5] = textBox32.Text.ToString(); TabNar[1, 6] = textBox33.Text.ToString(); TabNar[1, 7] = textBox34.Text.ToString(); TabNar[1, 8] = textBox35.Text.ToString(); TabNar[1, 9] = textBox3.Text.ToString(); TabNar[2, 0] = textBox1.Text.ToString(); TabNar[2, 1] = comboBox1.Text.ToString(); TabNar[2, 2] = textBox13.Text.ToString(); TabNar[2, 3] = textBox19.Text.ToString(); TabNar[2, 4] = textBox25.Text.ToString(); TabNar[2, 5] = textBox31.Text.ToString(); TabNar[2, 6] = textBox33.Text.ToString(); TabNar[2, 7] = textBox34.Text.ToString(); TabNar[2, 8] = textBox35.Text.ToString(); TabNar[2, 9] = textBox4.Text.ToString(); TabNar[3, 0] = textBox1.Text.ToString(); TabNar[3, 1] = comboBox1.Text.ToString(); TabNar[3, 2] = textBox12.Text.ToString(); TabNar[3, 3] = textBox18.Text.ToString(); TabNar[3, 4] = textBox24.Text.ToString(); TabNar[3, 5] = textBox30.Text.ToString(); TabNar[3, 6] = textBox33.Text.ToString(); TabNar[3, 7] = textBox34.Text.ToString(); TabNar[3, 8] = textBox35.Text.ToString(); TabNar[3, 9] = textBox5.Text.ToString(); TabNar[4, 0] = textBox1.Text.ToString(); TabNar[4, 1] = comboBox1.Text.ToString(); TabNar[4, 2] = textBox11.Text.ToString(); TabNar[4, 3] = textBox17.Text.ToString(); TabNar[4, 4] = textBox23.Text.ToString(); TabNar[4, 5] = textBox29.Text.ToString(); TabNar[4, 6] = textBox33.Text.ToString(); TabNar[4, 7] = textBox34.Text.ToString(); TabNar[4, 8] = textBox35.Text.ToString(); TabNar[4, 9] = textBox6.Text.ToString(); TabNar[5, 0] = textBox1.Text.ToString(); TabNar[5, 1] = comboBox1.Text.ToString(); TabNar[5, 2] = textBox10.Text.ToString(); TabNar[5, 3] = textBox16.Text.ToString(); TabNar[5, 4] = textBox22.Text.ToString(); TabNar[5, 5] = textBox28.Text.ToString(); TabNar[5, 6] = textBox33.Text.ToString(); TabNar[5, 7] = textBox34.Text.ToString(); TabNar[5, 8] = textBox35.Text.ToString(); TabNar[5, 9] = textBox7.Text.ToString(); TabNar[6, 0] = textBox1.Text.ToString(); TabNar[6, 1] = comboBox1.Text.ToString(); TabNar[6, 2] = textBox9.Text.ToString(); TabNar[6, 3] = textBox15.Text.ToString(); TabNar[6, 4] = textBox21.Text.ToString(); TabNar[6, 5] = textBox27.Text.ToString(); TabNar[6, 6] = textBox33.Text.ToString(); TabNar[6, 7] = textBox34.Text.ToString(); TabNar[6, 8] = textBox35.Text.ToString(); TabNar[6, 9] = textBox8.Text.ToString(); for (int i = 1; i < 7; i++) { string stat = TabNar[i, 6] + " ч." + TabNar[i, 9]; string z = "UPDATE raptsprnar SET " + "tipnar = " + Convert.ToInt32(TabNar[i, 0]) + ", " + "tipnarN = '" + TabNar[i, 1] + "', " + "ChastSt = " + Convert.ToInt32(TabNar[i, 9]) + ", " + "NoSRFor = " + Convert.ToInt32(TabNar[i, 2]) + ", " + "NoSRTo = " + Convert.ToInt32(TabNar[i, 3]) + ", " + "MitSRFor = " + Convert.ToInt32(TabNar[i, 4]) + ", " + "MitSRTo = " + Convert.ToInt32(TabNar[i, 5]) + ", " + "STATIA = '" + stat + "', " + "vidnar = '" + TabNar[i, 7] + "', " + "prmechannar = '" + TabNar[i, 8] + "'" + "WHERE tipnar = " + IDNAR + " and ChastSt = " + Convert.ToInt32(TabNar[i, 9]) + ";"; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } Close(); }
internal void FormNARUSH_LoadV(int IDTS) { int i = 0; button1.Visible = false; button2.Visible = false; MySqlCommand commandR = new MySqlCommand(); ConnectStr conStrR = new ConnectStr(); conStrR.ConStr(1); Zapros zaprosR = new Zapros(); string connectionStringR; //, commandString; connectionStringR = conStrR.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connectionR = new MySqlConnection(connectionStringR); zaprosR.Narush(IDTS); zR = zaprosR.commandStringTest; commandR.CommandText = zR;// commandString; commandR.Connection = connectionR; MySqlDataReader readerR; try { commandR.Connection.Open(); readerR = commandR.ExecuteReader(); while (readerR.Read()) { textBox1.Text = Convert.ToString(readerR["tipnar"]); //textBox2.Text = Convert.ToString(readerR["tipnarN"]); comboBox1.Text = Convert.ToString(readerR["tipnarN"]); if (Convert.ToInt32(readerR["ChastSt"]) > 0 && Convert.ToInt32(readerR["ChastSt"]) < 7) { switch (Convert.ToInt32(readerR["ChastSt"])) { case 1: TabNar[1, 0] = Convert.ToString(readerR["tipnar"]); TabNar[1, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[1, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[1, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[1, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[1, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[1, 6] = Convert.ToString(readerR["STATIA"]); TabNar[1, 7] = Convert.ToString(readerR["vidnar"]); TabNar[1, 8] = Convert.ToString(readerR["prmechannar"]); textBox14.Text = Convert.ToString(readerR["NoSRFor"]); textBox20.Text = Convert.ToString(readerR["NoSRTo"]); textBox26.Text = Convert.ToString(readerR["MitSRFor"]); textBox32.Text = Convert.ToString(readerR["MitSRTo"]); break; case 2: TabNar[2, 0] = Convert.ToString(readerR["tipnar"]); TabNar[2, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[2, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[2, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[2, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[2, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[2, 6] = Convert.ToString(readerR["STATIA"]); TabNar[2, 7] = Convert.ToString(readerR["vidnar"]); TabNar[2, 8] = Convert.ToString(readerR["prmechannar"]); textBox13.Text = Convert.ToString(readerR["NoSRFor"]); textBox19.Text = Convert.ToString(readerR["NoSRTo"]); textBox25.Text = Convert.ToString(readerR["MitSRFor"]); textBox31.Text = Convert.ToString(readerR["MitSRTo"]); break; case 3: TabNar[3, 0] = Convert.ToString(readerR["tipnar"]); TabNar[3, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[3, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[3, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[3, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[3, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[3, 6] = Convert.ToString(readerR["STATIA"]); TabNar[3, 7] = Convert.ToString(readerR["vidnar"]); TabNar[3, 8] = Convert.ToString(readerR["prmechannar"]); textBox12.Text = Convert.ToString(readerR["NoSRFor"]); textBox18.Text = Convert.ToString(readerR["NoSRTo"]); textBox24.Text = Convert.ToString(readerR["MitSRFor"]); textBox30.Text = Convert.ToString(readerR["MitSRTo"]); break; case 4: TabNar[4, 0] = Convert.ToString(readerR["tipnar"]); TabNar[4, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[4, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[4, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[4, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[4, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[4, 6] = Convert.ToString(readerR["STATIA"]); TabNar[4, 7] = Convert.ToString(readerR["vidnar"]); TabNar[4, 8] = Convert.ToString(readerR["prmechannar"]); textBox11.Text = Convert.ToString(readerR["NoSRFor"]); textBox17.Text = Convert.ToString(readerR["NoSRTo"]); textBox23.Text = Convert.ToString(readerR["MitSRFor"]); textBox29.Text = Convert.ToString(readerR["MitSRTo"]); break; case 5: TabNar[5, 0] = Convert.ToString(readerR["tipnar"]); TabNar[5, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[5, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[5, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[5, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[5, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[5, 6] = Convert.ToString(readerR["STATIA"]); TabNar[5, 7] = Convert.ToString(readerR["vidnar"]); TabNar[5, 8] = Convert.ToString(readerR["prmechannar"]); textBox10.Text = Convert.ToString(readerR["NoSRFor"]); textBox16.Text = Convert.ToString(readerR["NoSRTo"]); textBox22.Text = Convert.ToString(readerR["MitSRFor"]); textBox28.Text = Convert.ToString(readerR["MitSRTo"]); break; case 6: TabNar[6, 0] = Convert.ToString(readerR["tipnar"]); TabNar[6, 1] = Convert.ToString(readerR["tipnarN"]); TabNar[6, 2] = Convert.ToString(readerR["NoSRFor"]); TabNar[6, 3] = Convert.ToString(readerR["NoSRTo"]); TabNar[6, 4] = Convert.ToString(readerR["MitSRFor"]); TabNar[6, 5] = Convert.ToString(readerR["MitSRTo"]); TabNar[6, 6] = Convert.ToString(readerR["STATIA"]); TabNar[6, 7] = Convert.ToString(readerR["vidnar"]); TabNar[6, 8] = Convert.ToString(readerR["prmechannar"]); textBox9.Text = Convert.ToString(readerR["NoSRFor"]); textBox15.Text = Convert.ToString(readerR["NoSRTo"]); textBox21.Text = Convert.ToString(readerR["MitSRFor"]); textBox27.Text = Convert.ToString(readerR["MitSRTo"]); break; } } } readerR.Close(); checkBox2.Enabled = false; checkBox3.Enabled = false; checkBox4.Enabled = false; checkBox5.Enabled = false; checkBox6.Enabled = false; checkBox7.Enabled = false; checkBox1.Checked = true; IDNAR = IDTS; //checkBox1.Enabled = false; } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { commandR.Connection.Close(); } }
internal void FormRaspolRub_LoadRN(int IDRN) { button1.Visible = false; button2.Visible = true; MySqlCommand commandL = new MySqlCommand(); ConnectStr conStrL = new ConnectStr(); conStrL.ConStr(1); //Zapros zaprosL = new Zapros(); string connectionStringL; //, commandString; connectionStringL = conStrL.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connectionL = new MySqlConnection(connectionStringL); //zaprosL.ZaprAllCamNaprLO(IDRN); zL = "SELECT " + "rapraspolojenrubeja.* " + "FROM rapraspolojenrubeja " + "WHERE idrub = " + IDRN; commandL.CommandText = zL;// commandString; commandL.Connection = connectionL; MySqlDataReader readerT; try { commandL.Connection.Open(); readerT = commandL.ExecuteReader(); while (readerT.Read()) { // //ConnectStr conStrAD = new ConnectStr(); // //conStrAD.ConStr(1); // //cstrRub = conStrAD.StP; // ////connectionRub = new MySqlConnection(cstrRub); // //MySql.Data.MySqlClient.MySqlConnection sqlConnectionT = new MySqlConnection(cstrRub);//new MySql.Data.MySqlClient.MySqlConnection("Data source = localhost; UserId = root; Password = 1q2w3e$R; database = test; "); // //MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(); // //cmd.CommandText = "SELECT " + // // "rapraspolojenrubeja.* " + // // "FROM rapraspolojenrubeja " + // // "WHERE idrub = " + IDRN; // //cmd.Connection = sqlConnectionT; // MySqlDataReader readerT; //try //{ // sqlConnectionT.Open(); // readerT = cmd.ExecuteReader(); // while (readerT.Read()) // { alphaBlendTextBox26.Text = readerT["nameapvk"].ToString(); alphaBlendTextBox1.Text = readerT["kodapvk"].ToString(); alphaBlendTextBox2.Text = readerT["sernum"].ToString(); alphaBlendTextBox3.Text = readerT["dislocationapvk"].ToString(); alphaBlendTextBox4.Text = readerT["shir"].ToString(); alphaBlendTextBox5.Text = readerT["dolg"].ToString(); alphaBlendTextBox6.Text = readerT["namead"].ToString(); alphaBlendTextBox7.Text = readerT["ad_znachen"].ToString(); alphaBlendTextBox8.Text = readerT["partad"].ToString(); alphaBlendTextBox9.Text = readerT["maxosnagr"].ToString(); alphaBlendTextBox10.Text = readerT["ogranich"].ToString(); alphaBlendTextBox11.Text = readerT["primechanie"].ToString(); alphaBlendTextBox14.Text = readerT["Speed"].ToString(); alphaBlendTextBox15.Text = readerT["Vladel"].ToString(); comboBox1.Text = readerT["TipSI"].ToString(); alphaBlendTextBox16.Text = readerT["Model"].ToString(); alphaBlendTextBox19.Text = readerT["NomSvidTipaSI"].ToString(); alphaBlendTextBox18.Text = readerT["DateVidSTSI"].ToString(); alphaBlendTextBox17.Text = readerT["RegNomSTSI"].ToString(); alphaBlendTextBox22.Text = readerT["NomSPSI"].ToString(); alphaBlendTextBox21.Text = readerT["DateVidSPSI"].ToString(); alphaBlendTextBox20.Text = readerT["SrokSPSI"].ToString(); alphaBlendTextBox23.Text = readerT["NormPravAktAD"].ToString(); KODNapr = readerT["kodapvk"].ToString(); alphaBlendTextBox31.Text = readerT["IDWim"].ToString(); } IDRub = IDRN; readerT.Close(); //cmdr.CommandText = "SELECT " + zN = "SELECT " + "raptnapr.* " + "FROM raptnapr " + "WHERE raptnapr.IDKOMPL = '" + IDRN.ToString() + "'"; commandL.CommandText = zN;// commandString; commandL.Connection = connectionL; MySqlDataReader readerr; if (connectionL.State == System.Data.ConnectionState.Closed) { connectionL.Open(); } //commandL.Connection.Open(); readerr = commandL.ExecuteReader(); int NN = 0; while (readerr.Read()) { NN = NN + 1; if (NN > 1) { alphaBlendTextBox30.Text = readerr["namenapr"].ToString(); //alphaBlendTextBox29.Text = readerr["KodNapr"].ToString(); alphaBlendTextBox28.Text = readerr["npolos"].ToString(); } else { alphaBlendTextBox27.Text = readerr["namenapr"].ToString(); //alphaBlendTextBox25.Text = readerr["KodNapr"].ToString(); alphaBlendTextBox24.Text = readerr["npolos"].ToString(); } } readerr.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { commandL.Connection.Close(); } //catch (MySqlException ex) //{ // Console.WriteLine("Error: \r\n{0}", ex.ToString()); //} //finally //{ // cmdr.Connection.Close(); //} }
private void button1_Click(object sender, EventArgs e)//////////////////////////// Добавление рубежа и направления { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); string z = "INSERT INTO rapraspolojenrubeja" + "(nameapvk, " + "kodapvk, " + "sernum, " + "dislocationapvk, " + "shir, " + "dolg, " + "ad_znachen, " + "maxosnagr, " + "namead, " + "partad, " + "ogranich, " + "Speed, " + "primechanie, " + "TipSI, " + "Model, " + "NomSvidTipaSI, " + "DateVidSTSI, " + "RegNomSTSI, " + "NomSPSI, " + "DateVidSPSI, " + "SrokSPSI, " + "IDWim, " + "NormPravAktAD) " + " VALUES(" + "'" + alphaBlendTextBox26.Text.ToString() + "', " + "'" + alphaBlendTextBox1.Text.ToString() + "', " + "'" + alphaBlendTextBox2.Text.ToString() + "', " + "'" + alphaBlendTextBox3.Text.ToString() + "', " + "" + Convert.ToDecimal(alphaBlendTextBox4.Text.Replace(",", ".").ToString()) + ", " + "" + Convert.ToDecimal(alphaBlendTextBox5.Text.Replace(",", ".").ToString()) + ", " + "'" + alphaBlendTextBox7.Text.ToString() + "', " + "" + Convert.ToDouble(alphaBlendTextBox9.Text.ToString()) + ", " + "'" + alphaBlendTextBox6.Text.ToString() + "', " + "'" + alphaBlendTextBox8.Text.ToString() + "', " + "'" + alphaBlendTextBox10.Text.ToString() + "', " + "" + Convert.ToDouble(alphaBlendTextBox14.Text.ToString()) + ", " + "'" + alphaBlendTextBox11.Text.ToString() + "', " + "'" + comboBox1.Text.ToString() + "', " + "'" + alphaBlendTextBox16.Text.ToString() + "', " + "'" + alphaBlendTextBox19.Text.ToString() + "', " + "'" + alphaBlendTextBox18.Text.ToString() + "', " + "'" + alphaBlendTextBox17.Text.ToString() + "', " + "'" + alphaBlendTextBox22.Text.ToString() + "', " + "'" + alphaBlendTextBox21.Text.ToString() + "', " + "'" + alphaBlendTextBox20.Text.ToString() + "', " + "'" + alphaBlendTextBox31.Text.ToString() + "', " + "'" + alphaBlendTextBox23.Text.ToString() + "' )"; //"nameapvk, " + // "kodapvk, " + // "sernum, " + // "dislocationapvk, " + // "shir, " + // "dolg, " + // "namead, " + // "ad_znachen, " + // "partad, " + // "maxosnagr, " + // "ogranich, " + // "primechanie, " + // " Vladel, " + // " TipSI, " + // " Model, " + // " NomSvidTipaSI, " + // " DateVidSTSI, " + // " RegNomSTSI, " + // " NomSPSI, " + // " DateVidSPSI, " + // " SrokSPSI, " + // " NormPravAktAD, " + // " Speed, " + // "IDWim, " + // "IDDir)" + // " VALUES('" + alphaBlendTextBox26.Text.ToString() + "', " + // "'" + alphaBlendTextBox1.Text.ToString() + "' , " + // "'" + alphaBlendTextBox2.Text.ToString() + "' , " + // "'" + alphaBlendTextBox3.Text.ToString() + "' , " + // "'" + Convert.ToDecimal(alphaBlendTextBox4.Text.Replace(",", ".").ToString()) + "' , " + // "'" + Convert.ToDecimal(alphaBlendTextBox5.Text.Replace(",", ".").ToString()) + "' , " + // "'" + alphaBlendTextBox6.Text.ToString() + "' , " + // "'" + alphaBlendTextBox7.Text.ToString() + "' , " + // "'" + alphaBlendTextBox8.Text.ToString() + "' , " + // "'" + Convert.ToDouble(alphaBlendTextBox9.Text.ToString()) + "' , " + // "'" + alphaBlendTextBox10.Text.ToString() + "' , " + // "'" + alphaBlendTextBox11.Text.ToString() + "' , " + // "'" + alphaBlendTextBox15.Text.ToString() + "', " + // "'" + comboBox1.Text.ToString() + "', " + // "'" + alphaBlendTextBox16.Text.ToString() + "', " + // "'" + alphaBlendTextBox19.Text.ToString() + "', " + // "'" + alphaBlendTextBox18.Text.ToString() + "', " + // "'" + alphaBlendTextBox17.Text.ToString() + "', " + // "'" + alphaBlendTextBox22.Text.ToString() + "', " + // "'" + alphaBlendTextBox21.Text.ToString() + "', " + // "'" + alphaBlendTextBox20.Text.ToString() + "', " + // "'" + alphaBlendTextBox23.Text.ToString() + "', " + // "'" + Convert.ToInt32(alphaBlendTextBox14.Text.ToString()) + "', " + // "'" + alphaBlendTextBox1.Text.ToString() + "' , " + // "" + Convert.ToInt32(alphaBlendTextBox1.Text.Substring(alphaBlendTextBox1.Text.Length - 1, 1).ToString()) + " )"; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); ////////////////////////////////////////////////////////// запрашиваем idr -последний добавленный рубеж MySqlCommand commandL = new MySqlCommand(); ConnectStr conStrL = new ConnectStr(); conStrL.ConStr(1); //Zapros zaprosL = new Zapros(); string connectionStringL; //, commandString; connectionStringL = conStrL.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connectionL = new MySqlConnection(connectionStringL); //zaprosL.ZaprAllCamNaprLO(IDRN); zL = " SELECT " + "MAX(rapraspolojenrubeja.idrub) AS MR " + "FROM rapraspolojenrubeja"; commandL.CommandText = zL;// commandString; commandL.Connection = connectionL; MySqlDataReader readerT; try { commandL.Connection.Open(); readerT = commandL.ExecuteReader(); while (readerT.Read()) { idr = Convert.ToInt32(readerT["MR"].ToString()); } readerT.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } //finally //{ // cmd1.Connection.Close(); //} ////////////////////////////////////////////////////////// создаем правое направление полосы for (int i = 1; i < 3; i++) { if (i == 1) { KODNapr = "1";// alphaBlendTextBox25.Text; //MySqlCommand command = new MySqlCommand(); //ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); //string connectionString; connectionString = conStr.StP; //MySqlConnection connection = new MySqlConnection(connectionString); z = "INSERT INTO raptnapr (namenapr, " + "npolos, " + "KodNapr, " + "IDKOMPL, " + "PlatfID, " + "Napr) " + "VALUES " + "('" + alphaBlendTextBox27.Text.ToString() + "', " + "" + Convert.ToInt32(alphaBlendTextBox24.Text.ToString()) + ", " + "'1', " + //alphaBlendTextBox25.Text.ToString() + "', " + "" + idr + ", " + "'" + alphaBlendTextBox31.Text.ToString() + "' , " + "'правое')"; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } else { KODNapr = "1";// alphaBlendTextBox25.Text; //MySqlCommand command = new MySqlCommand(); //ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); //string connectionString; connectionString = conStr.StP; //MySqlConnection connection = new MySqlConnection(connectionString); z = "INSERT INTO raptnapr (namenapr, " + "npolos, " + "KodNapr, " + "IDKOMPL, " + "PlatfID, " + "Napr) " + "VALUES " + "('" + alphaBlendTextBox30.Text.ToString() + "', " + "" + Convert.ToInt32(alphaBlendTextBox28.Text.ToString()) + ", " + "'1', " + //alphaBlendTextBox29.Text.ToString() + "', " + "" + idr + ", " + "'" + alphaBlendTextBox31.Text.ToString() + "' , " + "'левое')"; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } } Close(); }
private void button1_Click(object sender, EventArgs e) { //IDPDK[0] = Convert.ToInt32(alphaBlendTextBox23.Text.ToString()); //IDPDK[1] = Convert.ToInt32(alphaBlendTextBox22.Text.ToString()); //IDPDK[2] = Convert.ToInt32(alphaBlendTextBox21.Text.ToString()); //IDPDK[3] = Convert.ToInt32(alphaBlendTextBox27.Text.ToString()); //IDPDK[4] = Convert.ToInt32(alphaBlendTextBox25.Text.ToString()); //IDPDK[5] = Convert.ToInt32(alphaBlendTextBox24.Text.ToString()); PDKZN[0, 14] = Convert.ToString(alphaBlendTextBox28.Text.ToString()); PDKZN[0, 0] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox6.Text.ToString()) / 2); PDKZN[1, 0] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox6.Text.ToString()) / 2); PDKZN[2, 0] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox6.Text.ToString()) / 2); if (alphaBlendTextBox3.Text.ToString() == alphaBlendTextBox4.Text.ToString()) { PDKZN[0, 1] = alphaBlendTextBox3.Text.ToString(); //PDKZN[0, 2] = NameTyp[Convert.ToInt32(alphaBlendTextBox3.Text) - 1]; PDKZN[1, 1] = alphaBlendTextBox3.Text.ToString(); //PDKZN[1, 2] = NameTyp[Convert.ToInt32(alphaBlendTextBox3.Text) - 1]; PDKZN[2, 1] = alphaBlendTextBox3.Text.ToString(); //PDKZN[2, 2] = NameTyp[Convert.ToInt32(alphaBlendTextBox3.Text) - 1]; } else if (Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) < Convert.ToInt32(alphaBlendTextBox4.Text.ToString()) && Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) == 4) { PDKZN[0, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[0, 2] = NameTyp[3];*/ PDKZN[1, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[1, 2] = NameTyp[3];*/ PDKZN[2, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[2, 2] = NameTyp[3];*/ } else if (Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) < Convert.ToInt32(alphaBlendTextBox4.Text.ToString())) { PDKZN[0, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[0, 2] = NameTyp[3];*/ PDKZN[1, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[1, 2] = NameTyp[3];*/ PDKZN[2, 1] = alphaBlendTextBox3.Text.ToString(); /*PDKZN[2, 2] = NameTyp[3];*/ } else { PDKZN[0, 1] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) - 2); /*PDKZN[0, 2] = NameTyp[4];*/ PDKZN[1, 1] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) - 2); /*PDKZN[1, 2] = NameTyp[4];*/ PDKZN[2, 1] = Convert.ToString(Convert.ToInt32(alphaBlendTextBox3.Text.ToString()) - 2); /*PDKZN[2, 2] = NameTyp[4];*/ } PDKZN[0, 3] = alphaBlendTextBox8.Text.ToString(); PDKZN[1, 3] = alphaBlendTextBox8.Text.ToString(); PDKZN[2, 3] = alphaBlendTextBox8.Text.ToString(); PDKZN[0, 4] = alphaBlendTextBox7.Text.ToString(); PDKZN[1, 4] = alphaBlendTextBox7.Text.ToString(); PDKZN[2, 4] = alphaBlendTextBox7.Text.ToString(); PDKZN[0, 5] = alphaBlendTextBox11.Text.ToString(); PDKZN[0, 6] = alphaBlendTextBox20.Text.ToString(); PDKZN[0, 7] = alphaBlendTextBox14.Text.ToString(); PDKZN[0, 8] = alphaBlendTextBox17.Text.ToString(); PDKZN[0, 9] = alphaBlendTextBox26.Text.ToString(); PDKZN[0, 10] = alphaBlendTextBox3.Text.ToString(); PDKZN[0, 11] = alphaBlendTextBox4.Text.ToString(); PDKZN[0, 12] = alphaBlendTextBox6.Text.ToString(); PDKZN[0, 13] = alphaBlendTextBox5.Text.ToString(); PDKZN[1, 5] = alphaBlendTextBox10.Text.ToString(); PDKZN[1, 6] = alphaBlendTextBox19.Text.ToString(); PDKZN[1, 7] = alphaBlendTextBox13.Text.ToString(); PDKZN[1, 8] = alphaBlendTextBox16.Text.ToString(); PDKZN[1, 9] = alphaBlendTextBox1.Text.ToString(); PDKZN[1, 10] = alphaBlendTextBox3.Text.ToString(); PDKZN[1, 11] = alphaBlendTextBox4.Text.ToString(); PDKZN[1, 12] = alphaBlendTextBox6.Text.ToString(); PDKZN[1, 13] = alphaBlendTextBox5.Text.ToString(); PDKZN[2, 5] = alphaBlendTextBox9.Text.ToString(); PDKZN[2, 6] = alphaBlendTextBox18.Text.ToString(); PDKZN[2, 7] = alphaBlendTextBox12.Text.ToString(); PDKZN[2, 8] = alphaBlendTextBox15.Text.ToString(); PDKZN[2, 9] = alphaBlendTextBox2.Text.ToString(); PDKZN[2, 10] = alphaBlendTextBox3.Text.ToString(); PDKZN[2, 11] = alphaBlendTextBox4.Text.ToString(); PDKZN[2, 12] = alphaBlendTextBox6.Text.ToString(); PDKZN[2, 13] = alphaBlendTextBox5.Text.ToString(); for (int i = 0; i < 3; i++) { string z = "INSERT INTO raposnagrts (" + "duble_os, " + "tupeos, " + "nametupeos, " + "rasstjsey_min, " + "rasstjsey_max, " + "pdo, " + "pdt, " + "nagrad, " + "NosFor, " + "NosTo, " + "NcircleFor, " + "NcircleTo, " + //"TypeOsTo, " + "pdodoub, " + "pdtdoub) " + "VALUES ( " + "" + Convert.ToInt32(PDKZN[i, 0]) + ", " + "" + Convert.ToInt32(PDKZN[i, 1]) + ", " + "'" + PDKZN[0, 14].ToString() + "', " + "" + Convert.ToDouble(PDKZN[i, 3]) + ", " + "" + Convert.ToDouble(PDKZN[i, 4]) + ", " + "" + Convert.ToDouble(PDKZN[i, 5]) + ", " + "" + Convert.ToDouble(PDKZN[i, 6]) + ", " + "" + Convert.ToDouble(PDKZN[i, 9]) + ", " + "" + Convert.ToDouble(PDKZN[i, 10]) + ", " + "" + Convert.ToDouble(PDKZN[i, 11]) + ", " + "" + Convert.ToInt32(PDKZN[i, 12]) + ", " + "" + Convert.ToInt32(PDKZN[i, 13]) + ", " + //"" + Convert.ToInt32(PDKZN[i, __]) + ", " + "" + Convert.ToInt32(PDKZN[i, 7]) + ", " + "" + Convert.ToInt32(PDKZN[i, 8]) + "); "; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } Close(); }
internal void FormMDisl_LoadRN(int IDMD) { button1.Visible = false; button2.Visible = true; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); zapros.ZaprMDisl(IDMD); string z = zapros.commandStringTest; command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader reader; try { command.Connection.Open(); reader = command.ExecuteReader(); while (reader.Read()) { //alphaBlendTextBox48.Text = reader["IDSYS"].ToString(); alphaBlendTextBox48.Text = reader["IDSYS"].ToString(); alphaBlendTextBox31.Text = reader["UchNomer"].ToString(); alphaBlendTextBox32.Text = reader["IDAD"].ToString(); alphaBlendTextBox26.Text = reader["NameAD"].ToString(); alphaBlendTextBox1.Text = reader["ZnachenAD"].ToString(); alphaBlendTextBox8.Text = reader["KMPiketMD"].ToString(); alphaBlendTextBox4.Text = reader["GLONASShir"].ToString(); alphaBlendTextBox5.Text = reader["GLONASDolg"].ToString(); alphaBlendTextBox33.Text = reader["GPSShir"].ToString(); alphaBlendTextBox34.Text = reader["GPSDolg"].ToString(); alphaBlendTextBox37.Text = reader["GMap"].ToString(); alphaBlendTextBox35.Text = reader["YMap"].ToString(); alphaBlendTextBox10.Text = reader["PrivyazkaNP"].ToString(); alphaBlendTextBox13.Text = reader["NaznachenMD"].ToString(); alphaBlendTextBox22.Text = reader["ObshChisloPolos"].ToString(); alphaBlendTextBox36.Text = reader["ChisloNapravl"].ToString(); alphaBlendTextBox39.Text = reader["ShirinaPD"].ToString(); alphaBlendTextBox38.Text = reader["ShirinaOboch"].ToString(); alphaBlendTextBox41.Text = reader["ShirinaRazdPol"].ToString(); alphaBlendTextBox40.Text = reader["ShirinaSpeedPol"].ToString(); alphaBlendTextBox43.Text = reader["ShirinaSpetsPlosh"].ToString(); alphaBlendTextBox42.Text = reader["DlinaSpetsPlosh"].ToString(); alphaBlendTextBox46.Text = reader["NomAktAccredpolos"].ToString(); alphaBlendTextBox47.Text = reader["DataAccredPolos"].ToString(); alphaBlendTextBox44.Text = reader["NomAccredSpetsPlosh"].ToString(); alphaBlendTextBox45.Text = reader["DataAccredSpPlosh"].ToString(); alphaBlendTextBox50.Text = reader["IDNaprR"].ToString(); alphaBlendTextBox51.Text = reader["IDNaprL"].ToString(); alphaBlendTextBox19.Text = reader["CantryMD"].ToString(); alphaBlendTextBox18.Text = reader["OKATOCantryMD"].ToString(); alphaBlendTextBox6.Text = reader["SubjektMD"].ToString(); alphaBlendTextBox7.Text = reader["OKATOSubjektMD"].ToString(); alphaBlendTextBox9.Text = reader["MRajonMD"].ToString(); alphaBlendTextBox12.Text = reader["OKATOMRajonMD"].ToString(); alphaBlendTextBox14.Text = reader["ObjektMZMD"].ToString(); alphaBlendTextBox16.Text = reader["OKATOObjektMZMD"].ToString(); alphaBlendTextBox17.Text = reader["NPMD"].ToString(); alphaBlendTextBox20.Text = reader["OKATONPMD"].ToString(); alphaBlendTextBox27.Text = reader["OrgobslADName"].ToString(); alphaBlendTextBox25.Text = reader["OrgobslADAdr"].ToString(); alphaBlendTextBox24.Text = reader["OrgobslADKontakt"].ToString(); alphaBlendTextBox21.Text = reader["OrgobslADOL"].ToString(); alphaBlendTextBox15.Text = reader["OrgobslESName"].ToString(); alphaBlendTextBox11.Text = reader["OrgobslESAdr"].ToString(); alphaBlendTextBox3.Text = reader["OrgobslESKontakt"].ToString(); alphaBlendTextBox2.Text = reader["OrgobslESOL"].ToString(); alphaBlendTextBox30.Text = reader["OrgobslSvyazName"].ToString(); alphaBlendTextBox29.Text = reader["OrgobslSvyazAdr"].ToString(); alphaBlendTextBox28.Text = reader["OrgobslSvyazKontakt"].ToString(); alphaBlendTextBox23.Text = reader["OrgobslSvyazOL"].ToString(); IDRub = IDMD; reader.Close(); } } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } }
public void FormPDFN(Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string GAng, int[,] KNRA) //Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string N1, string N2, string N3)//public void FormPDF(System.IO.Stream i1, System.IO.Stream i2, System.IO.Stream i3, string[] args) { Puti[19] = System.Windows.Forms.SystemInformation.ComputerName.ToString(); MySqlCommand command2 = new MySqlCommand(); ConnectStr conStr2 = new ConnectStr(); conStr2.ConStr(1); Zapros zapros2 = new Zapros(); string connectionString2; //, commandString; connectionString2 = conStr2.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connection2 = new MySqlConnection(connectionString2); zapros2.NastrPuti(0, Puti[19]); string z2 = zapros2.commandStringTest; command2.CommandText = z2; command2.Connection = connection2; MySqlDataReader reader2; try { command2.Connection.Open(); reader2 = command2.ExecuteReader(); while (reader2.Read()) { Puti[0] = reader2["IDPut"].ToString(); Puti[1] = reader2["Rab_mesto"].ToString(); Puti[2] = reader2["Photo"].ToString(); Puti[3] = reader2["XML_Ang"].ToString(); Puti[4] = reader2["Akt_Arch"].ToString(); Puti[5] = reader2["CompName"].ToString(); } reader2.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command2.Connection.Close(); } String dir = Environment.CurrentDirectory; //получаем текущую рабочую папку приложения String dir1 = Application.StartupPath; //получаем папку из которой произошел запуск приложения ////dir1=dir1.ToString().Replace('`\`' , `\\` ); var pdfTemplate = @"C:\Users\cherednikov\Desktop\АКТ.pdf"; // + dir1 + "\\AKT.pdf";//'"+dir1+"\\ //var pdfFile = @"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + args[0] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; if (Puti[5] == "WIN-D3J6PR1H9QK") { pdfFile = @"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; } else { pdfFile = @"C:\Users\cherednikov\Desktop\A\АКТ.pdf"; } //@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; }; //var pdfFile = @"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; //var pdfFile = @"F:\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; //var pdfFile = @"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; pf = args[259] + "_" + DateTime.Now.ToString("ddMMyyyy"); using (var templateReader = new PdfReader(pdfTemplate)) { if (i1 != null) { System.Drawing.Bitmap imgg = new System.Drawing.Bitmap(i1); imag = iTextSharp.text.Image.GetInstance(imgg, System.Drawing.Imaging.ImageFormat.Jpeg); // @"C:\Users\cherednikov\Pictures\original22.jpg"); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ imgg.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpeg"); } //else //{ // imgg.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpeg"); // //File.Copy(@"" + N1, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.png"); //}; //// imgg.Save(@""+ Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpeg"); ////imgg.Save(@"F:\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpeg"); ////imgg.Save(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpeg"); } if (i2 != null) { System.Drawing.Bitmap imgg2 = new System.Drawing.Bitmap(i2); imag2 = iTextSharp.text.Image.GetInstance(imgg2, System.Drawing.Imaging.ImageFormat.Jpeg); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ imgg2.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpeg"); } //else //{ // imgg2.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpeg"); // //File.Copy(@"" + N2, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.png"); //}; ////imgg2.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpeg"); ////imgg2.Save(@"F:\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpeg"); ////imgg2.Save(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpeg"); } if (i3 != null) { System.Drawing.Bitmap imgg3 = new System.Drawing.Bitmap(i3); imag3 = iTextSharp.text.Image.GetInstance(imgg3, System.Drawing.Imaging.ImageFormat.Jpeg); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ imgg3.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpeg"); } //else //{ // imgg3.Save(@"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpeg"); // //File.Copy(@"" + N3, @"" + Puti[3] + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.png"); //}; //// imgg3.Save(@"F:\\archiv\\AKT\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpeg"); ////imgg3.Save(@"F:\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpeg"); ////imgg3.Save(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_3.Jpeg"); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////var doc = new Document(); ////////////PdfWriter.GetInstance(doc, new FileStream(Application.StartupPath + @"\Document.pdf", FileMode.Create)); ////////////doc.Open(); ////////////iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/images.jpg"); ////////////jpg.Alignment = Element.ALIGN_CENTER; ////////////doc.Add(jpg); ////////////PdfPTable table = new PdfPTable(3); ////////////PdfPCell cell = new PdfPCell(new Phrase("Simple table", //////////// new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 16, //////////// iTextSharp.text.Font.NORMAL, new BaseColor(Color.Orange)))); ////////////cell.BackgroundColor = new BaseColor(Color.Wheat); ////////////cell.Padding = 5; ////////////cell.Colspan = 3; ////////////cell.HorizontalAlignment = Element.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////table.AddCell("Col 1 Row 1"); ////////////table.AddCell("Col 2 Row 1"); ////////////table.AddCell("Col 3 Row 1"); ////////////table.AddCell("Col 1 Row 2"); ////////////table.AddCell("Col 2 Row 2"); ////////////table.AddCell("Col 3 Row 2"); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/left.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT; ////////////table.AddCell(cell); ////////////cell = new PdfPCell(new Phrase("Col 2 Row 3")); ////////////cell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/right.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_RIGHT; ////////////table.AddCell(cell); ////////////doc.Add(table); ////////////doc.Close(); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// using (var resultStamper = new PdfStamper(templateReader, new FileStream(pdfFile, FileMode.Create))) { var pdfcontentbyte = resultStamper.GetOverContent(1); if (i1 != null) { imag.SetAbsolutePosition(55, 369); //695 imag.ScaleAbsoluteWidth(127); imag.ScaleAbsoluteHeight(90); imag.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag); } if (i2 != null) { imag2.SetAbsolutePosition(230, 417); //745 imag2.ScaleAbsoluteWidth(137); imag2.ScaleAbsoluteHeight(40); imag2.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag2); } if (i3 != null) { imag3.SetAbsolutePosition(404, 369); //696 imag3.ScaleAbsoluteWidth(146); imag3.ScaleAbsoluteHeight(89); imag3.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag3); } PdfPTable table = new PdfPTable(14); table.AddCell("Cell 1"); table.AddCell("Cell 2"); table.AddCell("Cell 3"); table.AddCell("Cell 4"); table.AddCell("Cell 5"); table.AddCell("Cell 6"); table.AddCell("Cell 7"); table.AddCell("Cell 8"); // Получаем ссылку на форму с полями. var form = resultStamper.AcroFields; // Получаем все шрифты формы. //BaseFont baseFont = BaseFont.CreateFont(@"C:\Users\cherednikov\Desktop\WFPDF\WFPDF\calibri.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //iTextSharp.text.Font font = new iTextSharp.text.Font(baseFont, iTextSharp.text.Font.DEFAULTSIZE, iTextSharp.text.Font.NORMAL); var font = templateReader.GetFormFonts(); // Установка значений полей формы. // Установка значений полей формы. form.SetFieldWithFont(templateReader, font, "A1", args[0]); form.SetFieldWithFont(templateReader, font, "A3", args[1]); form.SetFieldWithFont(templateReader, font, "A4", args[2]); form.SetFieldWithFont(templateReader, font, "A5", args[3]); form.SetFieldWithFont(templateReader, font, "A6", args[4]); form.SetField("A2", args[250]); form.SetField("A9", args[5] + ", " + args[6]); form.SetField("A7", args[7]); form.SetField("A8", args[8]); form.SetField("A10", args[9]); form.SetField("A11", args[21]); form.SetField("A12", args[10]); form.SetField("A13", "ДТ и РДТИ г. Севастополя");// args[11]); form.SetField("A14", args[25]); form.SetField("A15", args[26]); form.SetField("A16", args[28]); form.SetField("A17", args[27]); form.SetField("A19", args[29]); form.SetField("A20", args[41]); form.SetField("A21", args[42]); form.SetField("A22", args[43]); form.SetField("A18", "-"); /*ОБЩ_МАССА*/ form.SetField("A23", args[65]); form.SetField("A24", args[66]); form.SetField("A25", args[67]); form.SetField("A26", args[68]); form.SetField("A27", args[69]); form.SetField("A28", args[70]); /*ДЛИНА*/ form.SetField("A29", args[44]); form.SetField("A30", args[47]); form.SetField("A31", args[50]); form.SetField("A32", args[53]); form.SetField("A33", args[56]); /*form.SetField("A55", args[59])*/; form.SetField("A34", args[62]); /*ШИРИНА*/ form.SetField("A35", args[45]); form.SetField("A36", args[48]); form.SetField("A37", args[51]); form.SetField("A38", args[54]); form.SetField("A39", args[57]); /*form.SetField("A56", args[60])*/; form.SetField("A40", args[63]); /*ВЫСОТА*/ form.SetField("A41", args[46]); form.SetField("A42", args[49]); form.SetField("A43", args[52]); form.SetField("A44", args[55]); form.SetField("A45", args[58]); /*form.SetField("A57", args[61]);*/ form.SetField("A46", args[64]); /*СКАТНОСТ_КОЛ_КОЛЕС*/ form.SetField("A47", args[73]); form.SetField("A48", args[84]); form.SetField("A49", args[95]); form.SetField("A50", args[106]); form.SetField("A51", args[117]); form.SetField("A52", args[128]); form.SetField("A53", args[139]); form.SetField("A54", args[150]); form.SetField("A55", args[161]); /*СКАТНОСТ_КОЛ_КОЛЕС_ПО_СПЕЦ_РАЗР*/ if (args[73] != null) { form.SetField("A56", "-"); } if (args[84] != null) { form.SetField("A57", "-"); } if (args[95] != null) { form.SetField("A58", "-"); } if (args[106] != null) { form.SetField("A59", "-"); } if (args[117] != null) { form.SetField("A60", "-"); } if (args[128] != null) { form.SetField("A61", "-"); } if (args[139] != null) { form.SetField("A62", "-"); } if (args[150] != null) { form.SetField("A63", "-"); } if (args[161] != null) { form.SetField("A64", "-"); } //МЕЖОСЕВЫЕ if (args[86] != null) { form.SetField("A65", "+ 0.03"); } if (args[97] != null) { form.SetField("A66", "+ 0.03"); } if (args[108] != null) { form.SetField("A67", "+ 0.03"); } if (args[119] != null) { form.SetField("A68", "+ 0.03"); } if (args[130] != null) { form.SetField("A69", "+ 0.03"); } if (args[141] != null) { form.SetField("A70", "+ 0.03"); } if (args[152] != null) { form.SetField("A71", "+ 0.03"); } if (args[163] != null) { form.SetField("A72", "+ 0.03"); } form.SetField("A73", args[86]); form.SetField("A74", args[97]); form.SetField("A75", args[108]); form.SetField("A76", args[119]); form.SetField("A77", args[130]); form.SetField("A78", args[141]); form.SetField("A79", args[152]); form.SetField("A80", args[163]); form.SetField("A81", args[87]); form.SetField("A82", args[98]); form.SetField("A83", args[109]); form.SetField("A84", args[120]); form.SetField("A85", args[131]); form.SetField("A86", args[142]); form.SetField("A87", args[153]); form.SetField("A88", args[164]); //(args[173] //for (int i = 1; i < 10; i++ ) //{ //delete_fields(KNRA, args, 5, 8); string CheckField = ""; int k = 1; int j = 0; int width = 0; int i = 1; int c = 0; int count = 0; while (KNRA[1, c] > 0) { count = count + KNRA[1, c]; c++; } string Name_field = ""; while (i <= 8) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 1) { width = KNRA[1, j]; } else { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j] - 1; //int c = j + 1; //while (KNRA[0,c] > 0) //{ // KNRA[0, c] = KNRA[0, c] - 1; // c++; //} } Name_field = "A" + '5' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 8) { CheckField = "A" + "5" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[164 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } //} ////// form.RemoveField("A97_1"); form.RemoveField("A91_1"); form.RemoveField("A92_1"); form.RemoveField("A93_1"); form.RemoveField("A94_1"); form.RemoveField("A95_1"); form.RemoveField("A96_1"); //////form.RemoveField("A98_2"); form.RemoveField("A99_2"); form.RemoveField("A100_2"); form.RemoveField("A101_2"); form.RemoveField("A102_2"); form.RemoveField("A103_2"); form.RemoveField("A104_2"); //если первая группа из 1 оси //////form.RemoveField("A105_3"); form.RemoveField("A106_3"); form.RemoveField("A107_3"); form.RemoveField("A108_3"); form.RemoveField("A109_3"); //////form.RemoveField("A110_4"); form.RemoveField("A111_4"); form.RemoveField("A112_4"); form.RemoveField("A113_4"); //////form.RemoveField("A115_5"); form.RemoveField("A117_5"); form.RemoveField("A118_5"); form.RemoveField("A116_5"); //////form.RemoveField("A119_6"); form.RemoveField("A120_6"); form.RemoveField("A121_6"); //////form.RemoveField("A122_7"); form.RemoveField("A123_7"); //////form.RemoveField("A89_8"); //////if (args[173] == "1") { ////// form.SetField("A90_1", args[65]); ////// form.SetField("A99_2", args[65]); ////// ////////////form.RemoveField("A89_8"); form.RemoveField("A91_1"); form.RemoveField("A92_1"); form.RemoveField("A93_1"); form.RemoveField("A94_1"); form.RemoveField("A95_1"); form.RemoveField("A96_1"); form.RemoveField("A97_1"); form.RemoveField("A100_2"); form.RemoveField("A101_2"); form.RemoveField("A102_2"); form.RemoveField("A103_2"); form.RemoveField("A104_2"); //если первая группа из 1 оси ////// ////////////form.RemoveField("A105_3"); form.RemoveField("A106_3"); form.RemoveField("A107_3"); ////// ////////////form.RemoveField("A108_3"); form.RemoveField("A109_3"); form.RemoveField("A110_4"); form.RemoveField("A111_4"); form.RemoveField("A112_4"); ////// ////////////form.RemoveField("A113_4"); form.RemoveField("A115_5"); form.RemoveField("A117_5"); form.RemoveField("A118_5"); ////// ////////////form.RemoveField("A116_5"); form.RemoveField("A119_6"); form.RemoveField("A120_6"); form.RemoveField("A121_6"); ////// ////////////form.RemoveField("A122_7"); form.RemoveField("A123_7"); ////// //if (args[184] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); //если вторая группа из 1 оси ////// // if (args[195] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); //если третья группа из 1 оси ////// // if (args[206] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); //если 4 группа из 1 оси ////// // if (args[217] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2");//если 5 группа из 1 оси ////// // if (args[228] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); }//если 6 группа из 1 оси ////// // else if (args[228] == "2") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A95_1"); } ////// // else { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A95_1"); form.RemoveField("A103_2"); } ////// // } ////// // else if (args[217] == "2") { form.RemoveField("A89_8"); form.RemoveField("A98_2");//если 5 группа из 1 оси ////// // if (args[228] == "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A103_2"); form.RemoveField("A96_1"); form.RemoveField("A97_1"); }//если 6 группа из 1 оси ////// // else if (args[228] == "2") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A95_1"); form.RemoveField("A96_1"); form.RemoveField("A97_1"); } ////// // else { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A95_1"); form.RemoveField("A103_2"); form.RemoveField("A96_1"); form.RemoveField("A97_1"); } ////// // } ////// // } ////// //} ////// //else if (args[184] == "2") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A91_1"); } ////// //else if (args[184] == "3") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); } ////// //else if (args[184] == "4") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); } ////// //else if (args[184] == "5") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); } ////// //else if (args[184] == "6") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); } ////// //else if (args[184] == "7") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); } ////// //else { form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); form.RemoveField("A122_7"); } //////} //////else if (args[173] == "2") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); } //////else if (args[173] == "3") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); } //////else if (args[173] == "4") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); } //////else if (args[173] == "5") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); } //////else if (args[173] == "6") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); } //////else if (args[173] == "7") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); } //////else {form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); form.RemoveField("A122_7"); } //////if (args[184]== "1") { form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A99_2"); } //////else if (args[184] == "2") {form.RemoveField("A89_8"); form.RemoveField("A98_2"); form.RemoveField("A91_1"); } //////else if (args[184] == "3") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); } //////else if (args[184] == "4") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); } //////else if (args[184] == "5") {form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); } //////else if (args[184] == "6") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); } //////else if (args[184] == "7") { form.RemoveField("A89_8"); form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); } //////else { form.RemoveField("A90_1"); form.RemoveField("A98_2"); form.RemoveField("A105_3"); form.RemoveField("A110_4"); form.RemoveField("A115_5"); form.RemoveField("A119_6"); form.RemoveField("A122_7"); } //////form.RegenerateField("A89_8"); //////////////////////////////////////if (args[195] == "1") { /*form.SetField("A92");*/ form.RemoveField("A92"); form.RemoveField("A93"); } //////////////////////////////////////if (args[206] == "1") { /*form.SetField("A92");*/ form.RemoveField("A92"); form.RemoveField("A93"); } //////////////////////////////////////if (args[217] == "1") { /*form.SetField("A92");*/ form.RemoveField("A92"); form.RemoveField("A93"); } //////////////////////////////////////if (args[228] == "1") { /*form.SetField("A92");*/ form.RemoveField("A92"); form.RemoveField("A93"); } //form.SetField("A2", args[6]); //////form.SetField("A8", args[12]); form.SetField("A9", args[13]); form.SetField("A10", args[14]); //////form.SetField("A11", args[15]); form.SetField("A12", args[16]); form.SetField("A13", args[17]); form.SetField("A14", args[18]); form.SetField("A15", args[19]); //////form.SetField("A16", args[20]); form.SetField("A18", args[22]); form.SetField("A19", args[23]); form.SetField("A20", args[24]); //////form.SetField("A26", args[30]); form.SetField("A27", args[31]); form.SetField("A28", args[32]); form.SetField("A29", args[33]); form.SetField("A30", args[34]); //////form.SetField("A31", args[35]); form.SetField("A32", args[36]); form.SetField("A33", args[37]); form.SetField("A34", args[38]); form.SetField("A35", args[39]); //////form.SetField("A36", args[40]); //////form.SetField("A67", args[71]); form.SetField("A68", args[72]); form.SetField("A70", args[74]); //////form.SetField("A71", args[75]); form.SetField("A72", args[76]); form.SetField("A73", args[77]); form.SetField("A74", args[78]); form.SetField("A75", args[79]); //////form.SetField("A76", args[80]); form.SetField("A77", args[81]); form.SetField("A78", args[82]); form.SetField("A79", args[83]); //////form.SetField("A81", args[85]); form.SetField("A84", args[88]); form.SetField("A85", args[89]); //////form.SetField("A89", args[90]); //////form.SetField("A87", args[91]); form.SetField("A88", args[92]); form.SetField("A89", args[93]); form.SetField("A90", args[94]); //////form.SetField("A92", args[96]); form.SetField("A95", args[99]); //////form.SetField("A96", args[100]); form.SetField("A97", args[101]); form.SetField("A98", args[102]); form.SetField("A99", args[103]); form.SetField("A100", args[104]); //////form.SetField("A101", args[105]); form.SetField("A103", args[107]); //////form.SetField("A106", args[110]); form.SetField("A107", args[111]); form.SetField("A108", args[112]); form.SetField("A109", args[113]); form.SetField("A110", args[114]); ////// form.SetField("A112", args[116]); form.SetField("A114", args[118]); /*form.SetField("A115", args[119]);*/ ////// form.SetField("A117", args[121]); form.SetField("A118", args[122]); form.SetField("A119", args[123]); form.SetField("A120", args[124]); //////form.SetField("A121", args[125]); form.SetField("A122", args[126]); form.SetField("A123", args[127]); form.SetField("A125", args[129]); ////// form.SetField("A128", args[132]); form.SetField("A129", args[133]); form.SetField("A130", args[134]); //////form.SetField("A131", args[135]); form.SetField("A132", args[136]); form.SetField("A133", args[137]); form.SetField("A134", args[138]); //////form.SetField("A136", args[140]); form.SetField("A139", args[143]); form.SetField("A140", args[144]); //////form.SetField("A141", args[145]); form.SetField("A142", args[146]); form.SetField("A143", args[147]); form.SetField("A144", args[148]); form.SetField("A145", args[149]); ////// form.SetField("A147", args[151]); form.SetField("A150", args[154]); //////form.SetField("A151", args[155]); form.SetField("A152", args[156]); form.SetField("A153", args[157]); form.SetField("A154", args[158]); form.SetField("A155", args[159]); //////form.SetField("A156", args[160]); form.SetField("A158", args[162]); //////form.SetField("A161", args[165]); form.SetField("A162", args[166]); form.SetField("A163", args[167]); form.SetField("A164", args[168]); form.SetField("A165", args[169]); //////form.SetField("A166", args[170]); form.SetField("A167", args[171]); form.SetField("A168", args[172]); form.SetField("A169", args[173]); form.SetField("A170", args[174]); //////form.SetField("A171", args[175]); form.SetField("A172", args[176]); form.SetField("A173", args[177]); form.SetField("A174", args[178]); form.SetField("A175", args[179]); //////form.SetField("A176", args[180]); form.SetField("A177", args[181]); form.SetField("A178", args[182]); form.SetField("A179", args[183]); form.SetField("A180", args[184]); //////form.SetField("A181", args[185]); form.SetField("A183", args[187]); form.SetField("A184", args[188]); form.SetField("A185", args[189]); //////form.SetField("A186", args[190]); form.SetField("A187", args[191]); form.SetField("A188", args[192]); form.SetField("A189", args[193]); form.SetField("A190", args[194]); //////form.SetField("A191", args[195]); form.SetField("A192", args[196]); form.SetField("A193", args[197]); form.SetField("A194", args[198]); form.SetField("A195", args[199]); //////form.SetField("A196", args[200]); form.SetField("A197", args[201]); form.SetField("A198", args[202]); form.SetField("A199", args[203]); form.SetField("A200", args[204]); //////form.SetField("A201", args[205]); form.SetField("A202", args[206]); form.SetField("A203", args[207]); form.SetField("A204", args[208]); form.SetField("A205", args[209]); //////form.SetField("A206", args[210]); form.SetField("A207", args[211]); form.SetField("A208", args[212]); form.SetField("A209", args[213]); form.SetField("A210", args[214]); //////form.SetField("A211", args[215]); form.SetField("A212", args[216]); form.SetField("A213", args[217]); form.SetField("A214", args[218]); form.SetField("A215", args[219]); //////form.SetField("A216", args[220]); form.SetField("A217", args[221]); form.SetField("A218", args[222]); form.SetField("A219", args[223]); form.SetField("A220", args[224]); //////form.SetField("A221", args[225]); form.SetField("A222", args[226]); form.SetField("A223", args[227]); form.SetField("A224", args[228]); form.SetField("A225", args[229]); //////form.SetField("A226", args[230]); form.SetField("A227", args[231]); form.SetField("A228", args[232]); form.SetField("A229", args[233]); form.SetField("A230", args[234]); //////form.SetField("A231", args[235]); form.SetField("A232", args[236]); form.SetField("A233", args[237]); form.SetField("A234", args[238]); form.SetField("A235", args[239]); //////form.SetField("A236", args[240]); form.SetField("A237", args[241]); form.SetField("A238", args[242]); form.SetField("A239", args[243]); form.SetField("A240", args[244]); //////form.SetField("A241", args[245]); form.SetField("A242", args[246]); form.SetField("A243", args[247]); form.SetField("A244", args[248]); form.SetField("A245", args[249]); //////form.SetField("A246", args[250]); /*form.SetField("NComp1", args[251]); form.SetField("NComp2", args[252]); form.SetField("NComp3", args[253]);*/ //Image image = Image.GetInstance(@"C:\Users\cherednikov\Pictures\original22.jpg"); //doc.("im1", image); //////////var jpg = iTextSharp.text.Image.GetInstance(@"C:\Users\cherednikov\Pictures\original22.jpg"); //////////jpg.SetAbsolutePosition(430, 750); //////////jpg.Annotation = new Annotation("Title", "Text"); //////////templateReader.Add(jpg); //iTextSharp.Layout.Element.Image dogImage = new iTextSharp.Layout.Element.Image(ImageDataFactory.Create(DOG)); //iTextSharp.text.Image im1 = iTextSharp.text.Image.GetInstance(@"C:\Users\cherednikov\Pictures\original22.jpg"); //PdfImage image = im1; //////im1.ScalePercent(70); ////////////////////var jpg = iTextSharp.text.Image.GetInstance(@"C:\Users\cherednikov\Pictures\original22.jpg"); ////////////////////jpg.SetAbsolutePosition(430, 750); ////////////////////jpg.Annotation = new Annotation("Title", "Text"); // Image image = Image.GetInstance(@"C:\Users\cherednikov\Pictures\original22.jpg"); ////////jpg.ScaleToFit(250f, 250f); ////////jpg.Border = Rectangle.BOX; //////////jpg.BorderColor = Color.YELLOW; ////////jpg.BorderWidth = 5f; ////////Add(jpg); //////////document.Add(jpg); ////////PdfPCell cell = new PdfPCell(image); ////////cell.PaddingTop = 0; ////////cell.PaddingRight = 0; ////////cell.PaddingBottom = 0; ////////cell.PaddingLeft = 0; ////////cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; ////////cell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE; ////////cell.Border = 0; ////////cell.BackgroundColor = new BaseColor(37, 168, 81); ; ////////table.AddCell(cell); //////////XImage img = XImage.FromFile(@"C:\Users\cherednikov\Pictures\original22.jpg"); //form.SetField("im1", @"C:\Users\cherednikov\Pictures\original22.jpg"); // Установка запрета на редактирование полей. resultStamper.FormFlattening = true; resultStamper.Writer.Add(table); resultStamper.Close(); } templateReader.Close(); } //File.Copy(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + pf + ".pdf", @"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\123777\\" + pf + ".pdf"); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); } //else { File.Copy(@"" + Puti[3] + pf + ".pdf", @"" + Puti[4] + pf + ".pdf"); }; // File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); }
internal void FormKlass_LoadPV(int IDTS) { button1.Visible = false; button2.Visible = false; string z = "SELECT " + "raptklassts.Klass," + " raptklassts.naimklassts," + " raptklassts.tipschema," + " raptklassts.ColOsey," + " raptklassts.Distanc1_2Min," + " raptklassts.Distanc1_2Max," + " raptklassts.Distanc2_3Min," + " raptklassts.Distanc2_3Max," + " raptklassts.Distanc3_4Min," + " raptklassts.Distanc3_4Max," + " raptklassts.Distanc4_5Min," + " raptklassts.Distanc4_5Max," + " raptklassts.Distanc5_6Min," + " raptklassts.Distanc5_6Max," + " raptklassts.Distanc6_7Min," + " raptklassts.Distanc6_7Max," + " raptklassts.Distanc7_8Min," + " raptklassts.Distanc7_8Max," + " raptklassts.MaxOsNagrm161," + " raptklassts.MaxOsNagrm162," + " raptklassts.MaxOsNagrm111," + " raptklassts.MaxOsNagrm112," + " raptklassts.MaxOsNagrm121," + " raptklassts.MaxOsNagrm122," + " raptklassts.MaxOsNagrm261," + " raptklassts.MaxOsNagrm262," + " raptklassts.MaxOsNagrm211," + " raptklassts.MaxOsNagrm212," + " raptklassts.MaxOsNagrm221," + " raptklassts.MaxOsNagrm222," + " raptklassts.MaxOsNagrm361," + " raptklassts.MaxOsNagrm362," + " raptklassts.MaxOsNagrm311," + " raptklassts.MaxOsNagrm312," + " raptklassts.MaxOsNagrm321," + " raptklassts.MaxOsNagrm322," + " raptklassts.MaxOsNagrm461," + " raptklassts.MaxOsNagrm462," + " raptklassts.MaxOsNagrm411," + " raptklassts.MaxOsNagrm412," + " raptklassts.MaxOsNagrm421," + " raptklassts.MaxOsNagrm422," + " raptklassts.MaxOsNagrm561," + " raptklassts.MaxOsNagrm562," + " raptklassts.MaxOsNagrm511," + " raptklassts.MaxOsNagrm512," + " raptklassts.MaxOsNagrm521," + " raptklassts.MaxOsNagrm522," + " raptklassts.MaxOsNagrm661," + " raptklassts.MaxOsNagrm662," + " raptklassts.MaxOsNagrm611," + " raptklassts.MaxOsNagrm612," + " raptklassts.MaxOsNagrm621," + " raptklassts.MaxOsNagrm622," + " raptklassts.MaxOsNagrm761," + " raptklassts.MaxOsNagrm762," + " raptklassts.MaxOsNagrm711," + " raptklassts.MaxOsNagrm712," + " raptklassts.MaxOsNagrm721," + " raptklassts.MaxOsNagrm722," + "raptklassts.MaxOsNagrm861," + "raptklassts.MaxOsNagrm862," + "raptklassts.MaxOsNagrm811," + "raptklassts.MaxOsNagrm812," + "raptklassts.MaxOsNagrm821," + "raptklassts.MaxOsNagrm822," + " raptklassts.Kategory," + " raptklassts.PolnMassb," + " raptklassts.SubCategory," + " raptklassts.PolnMassm," + " raptklassts.prim " + "FROM raptklassts " + "WHERE raptklassts.idklassts = " + IDTS; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader readerT; try { command.Connection.Open(); readerT = command.ExecuteReader(); while (readerT.Read()) { alphaBlendTextBox26.Text = readerT["Klass"].ToString(); alphaBlendTextBox1.Text = readerT["naimklassts"].ToString(); alphaBlendTextBox2.Text = readerT["tipschema"].ToString(); alphaBlendTextBox3.Text = readerT["ColOsey"].ToString(); alphaBlendTextBox4.Text = readerT["Distanc1_2Min"].ToString(); alphaBlendTextBox5.Text = readerT["Distanc1_2Max"].ToString(); alphaBlendTextBox6.Text = readerT["Distanc2_3Min"].ToString(); alphaBlendTextBox7.Text = readerT["Distanc2_3Max"].ToString(); alphaBlendTextBox8.Text = readerT["Distanc3_4Min"].ToString(); alphaBlendTextBox9.Text = readerT["Distanc3_4Max"].ToString(); alphaBlendTextBox10.Text = readerT["Distanc4_5Min"].ToString(); alphaBlendTextBox11.Text = readerT["Distanc4_5Max"].ToString(); alphaBlendTextBox12.Text = readerT["Distanc5_6Min"].ToString(); alphaBlendTextBox13.Text = readerT["Distanc5_6Max"].ToString(); alphaBlendTextBox14.Text = readerT["Distanc6_7Min"].ToString(); alphaBlendTextBox15.Text = readerT["Distanc6_7Max"].ToString(); alphaBlendTextBox16.Text = readerT["Distanc7_8Min"].ToString(); alphaBlendTextBox17.Text = readerT["Distanc7_8Max"].ToString(); alphaBlendTextBox32.Text = readerT["MaxOsNagrm161"].ToString(); alphaBlendTextBox39.Text = readerT["MaxOsNagrm162"].ToString(); alphaBlendTextBox46.Text = readerT["MaxOsNagrm111"].ToString(); alphaBlendTextBox53.Text = readerT["MaxOsNagrm112"].ToString(); alphaBlendTextBox60.Text = readerT["MaxOsNagrm121"].ToString(); alphaBlendTextBox67.Text = readerT["MaxOsNagrm122"].ToString(); alphaBlendTextBox31.Text = readerT["MaxOsNagrm261"].ToString(); alphaBlendTextBox38.Text = readerT["MaxOsNagrm262"].ToString(); alphaBlendTextBox45.Text = readerT["MaxOsNagrm211"].ToString(); alphaBlendTextBox52.Text = readerT["MaxOsNagrm212"].ToString(); alphaBlendTextBox59.Text = readerT["MaxOsNagrm221"].ToString(); alphaBlendTextBox66.Text = readerT["MaxOsNagrm222"].ToString(); alphaBlendTextBox30.Text = readerT["MaxOsNagrm361"].ToString(); alphaBlendTextBox37.Text = readerT["MaxOsNagrm362"].ToString(); alphaBlendTextBox44.Text = readerT["MaxOsNagrm311"].ToString(); alphaBlendTextBox51.Text = readerT["MaxOsNagrm312"].ToString(); alphaBlendTextBox58.Text = readerT["MaxOsNagrm321"].ToString(); alphaBlendTextBox65.Text = readerT["MaxOsNagrm322"].ToString(); alphaBlendTextBox29.Text = readerT["MaxOsNagrm461"].ToString(); alphaBlendTextBox36.Text = readerT["MaxOsNagrm462"].ToString(); alphaBlendTextBox43.Text = readerT["MaxOsNagrm411"].ToString(); alphaBlendTextBox50.Text = readerT["MaxOsNagrm412"].ToString(); alphaBlendTextBox57.Text = readerT["MaxOsNagrm421"].ToString(); alphaBlendTextBox64.Text = readerT["MaxOsNagrm422"].ToString(); alphaBlendTextBox28.Text = readerT["MaxOsNagrm561"].ToString(); alphaBlendTextBox35.Text = readerT["MaxOsNagrm562"].ToString(); alphaBlendTextBox42.Text = readerT["MaxOsNagrm511"].ToString(); alphaBlendTextBox49.Text = readerT["MaxOsNagrm512"].ToString(); alphaBlendTextBox56.Text = readerT["MaxOsNagrm521"].ToString(); alphaBlendTextBox63.Text = readerT["MaxOsNagrm522"].ToString(); alphaBlendTextBox27.Text = readerT["MaxOsNagrm661"].ToString(); alphaBlendTextBox34.Text = readerT["MaxOsNagrm662"].ToString(); alphaBlendTextBox41.Text = readerT["MaxOsNagrm611"].ToString(); alphaBlendTextBox48.Text = readerT["MaxOsNagrm612"].ToString(); alphaBlendTextBox55.Text = readerT["MaxOsNagrm621"].ToString(); alphaBlendTextBox62.Text = readerT["MaxOsNagrm622"].ToString(); alphaBlendTextBox25.Text = readerT["MaxOsNagrm761"].ToString(); alphaBlendTextBox33.Text = readerT["MaxOsNagrm762"].ToString(); alphaBlendTextBox40.Text = readerT["MaxOsNagrm711"].ToString(); alphaBlendTextBox47.Text = readerT["MaxOsNagrm712"].ToString(); alphaBlendTextBox54.Text = readerT["MaxOsNagrm721"].ToString(); alphaBlendTextBox61.Text = readerT["MaxOsNagrm722"].ToString(); alphaBlendTextBox73.Text = readerT["MaxOsNagrm861"].ToString(); alphaBlendTextBox72.Text = readerT["MaxOsNagrm862"].ToString(); alphaBlendTextBox71.Text = readerT["MaxOsNagrm811"].ToString(); alphaBlendTextBox70.Text = readerT["MaxOsNagrm812"].ToString(); alphaBlendTextBox69.Text = readerT["MaxOsNagrm821"].ToString(); alphaBlendTextBox68.Text = readerT["MaxOsNagrm822"].ToString(); alphaBlendTextBox22.Text = readerT["Kategory"].ToString(); alphaBlendTextBox21.Text = readerT["PolnMassb"].ToString(); alphaBlendTextBox23.Text = readerT["SubCategory"].ToString(); alphaBlendTextBox20.Text = readerT["PolnMassm"].ToString(); alphaBlendTextBox24.Text = readerT["prim"].ToString(); } IDKL = IDTS; readerT.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } }
private void button2_Click(object sender, EventArgs e)///////////////// Кнопка сохранить ОБНОВЛЕНИЕ ////////////////////////// { MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); //Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); string z = "UPDATE raptklassts " + "SET Klass = " + Convert.ToInt32(alphaBlendTextBox26.Text) + ", " + "naimklassts = '" + alphaBlendTextBox1.Text + "' , " + " tipschema = '" + alphaBlendTextBox2.Text + "' , " + " ColOsey = " + Convert.ToInt32(alphaBlendTextBox3.Text) + ", " + " Distanc1_2Min = " + Convert.ToInt32(alphaBlendTextBox4.Text) + ", " + " Distanc1_2Max = " + Convert.ToInt32(alphaBlendTextBox5.Text) + ", " + " Distanc2_3Min = " + Convert.ToInt32(alphaBlendTextBox6.Text) + ", " + " Distanc2_3Max = " + Convert.ToInt32(alphaBlendTextBox7.Text) + ", " + " Distanc3_4Min = " + Convert.ToInt32(alphaBlendTextBox8.Text) + ", " + " Distanc3_4Max = " + Convert.ToInt32(alphaBlendTextBox9.Text) + ", " + " Distanc4_5Min = " + Convert.ToInt32(alphaBlendTextBox10.Text) + ", " + " Distanc4_5Max = " + Convert.ToInt32(alphaBlendTextBox11.Text) + ", " + " Distanc5_6Min = " + Convert.ToInt32(alphaBlendTextBox12.Text) + ", " + " Distanc5_6Max = " + Convert.ToInt32(alphaBlendTextBox13.Text) + ", " + " Distanc6_7Min = " + Convert.ToInt32(alphaBlendTextBox14.Text) + ", " + " Distanc6_7Max = " + Convert.ToInt32(alphaBlendTextBox15.Text) + ", " + " Distanc7_8Min = " + Convert.ToInt32(alphaBlendTextBox16.Text) + ", " + " Distanc7_8Max = " + Convert.ToInt32(alphaBlendTextBox17.Text) + ", " + " MaxOsNagrm161 = " + Convert.ToInt32(alphaBlendTextBox32.Text) + ", " + " MaxOsNagrm162 = " + Convert.ToInt32(alphaBlendTextBox39.Text) + ", " + " MaxOsNagrm111 = " + Convert.ToInt32(alphaBlendTextBox46.Text) + ", " + " MaxOsNagrm112 = " + Convert.ToInt32(alphaBlendTextBox53.Text) + ", " + " MaxOsNagrm121 = " + Convert.ToInt32(alphaBlendTextBox60.Text) + ", " + " MaxOsNagrm122 = " + Convert.ToInt32(alphaBlendTextBox67.Text) + ", " + " MaxOsNagrm261 = " + Convert.ToInt32(alphaBlendTextBox31.Text) + ", " + " MaxOsNagrm262 = " + Convert.ToInt32(alphaBlendTextBox38.Text) + ", " + " MaxOsNagrm211 = " + Convert.ToInt32(alphaBlendTextBox45.Text) + ", " + " MaxOsNagrm212 = " + Convert.ToInt32(alphaBlendTextBox52.Text) + ", " + " MaxOsNagrm221 = " + Convert.ToInt32(alphaBlendTextBox59.Text) + ", " + " MaxOsNagrm222 = " + Convert.ToInt32(alphaBlendTextBox66.Text) + ", " + " MaxOsNagrm361 = " + Convert.ToInt32(alphaBlendTextBox30.Text) + ", " + " MaxOsNagrm362 = " + Convert.ToInt32(alphaBlendTextBox37.Text) + ", " + " MaxOsNagrm311 = " + Convert.ToInt32(alphaBlendTextBox44.Text) + ", " + " MaxOsNagrm312 = " + Convert.ToInt32(alphaBlendTextBox51.Text) + ", " + " MaxOsNagrm321 = " + Convert.ToInt32(alphaBlendTextBox58.Text) + ", " + " MaxOsNagrm322 = " + Convert.ToInt32(alphaBlendTextBox65.Text) + ", " + " MaxOsNagrm461 = " + Convert.ToInt32(alphaBlendTextBox29.Text) + ", " + " MaxOsNagrm462 = " + Convert.ToInt32(alphaBlendTextBox36.Text) + ", " + " MaxOsNagrm411 = " + Convert.ToInt32(alphaBlendTextBox43.Text) + ", " + " MaxOsNagrm412 = " + Convert.ToInt32(alphaBlendTextBox50.Text) + ", " + " MaxOsNagrm421 = " + Convert.ToInt32(alphaBlendTextBox57.Text) + ", " + " MaxOsNagrm422 = " + Convert.ToInt32(alphaBlendTextBox64.Text) + ", " + " MaxOsNagrm561 = " + Convert.ToInt32(alphaBlendTextBox28.Text) + ", " + " MaxOsNagrm562 = " + Convert.ToInt32(alphaBlendTextBox35.Text) + ", " + " MaxOsNagrm511 = " + Convert.ToInt32(alphaBlendTextBox42.Text) + ", " + " MaxOsNagrm512 = " + Convert.ToInt32(alphaBlendTextBox49.Text) + ", " + " MaxOsNagrm521 = " + Convert.ToInt32(alphaBlendTextBox56.Text) + ", " + " MaxOsNagrm522 = " + Convert.ToInt32(alphaBlendTextBox63.Text) + ", " + " MaxOsNagrm661 = " + Convert.ToInt32(alphaBlendTextBox27.Text) + ", " + " MaxOsNagrm662 = " + Convert.ToInt32(alphaBlendTextBox34.Text) + ", " + " MaxOsNagrm611 = " + Convert.ToInt32(alphaBlendTextBox41.Text) + ", " + " MaxOsNagrm612 = " + Convert.ToInt32(alphaBlendTextBox48.Text) + ", " + " MaxOsNagrm621 = " + Convert.ToInt32(alphaBlendTextBox55.Text) + ", " + " MaxOsNagrm622 = " + Convert.ToInt32(alphaBlendTextBox62.Text) + ", " + " MaxOsNagrm761 = " + Convert.ToInt32(alphaBlendTextBox25.Text) + ", " + " MaxOsNagrm762 = " + Convert.ToInt32(alphaBlendTextBox33.Text) + ", " + " MaxOsNagrm711 = " + Convert.ToInt32(alphaBlendTextBox40.Text) + ", " + " MaxOsNagrm712 = " + Convert.ToInt32(alphaBlendTextBox47.Text) + ", " + " MaxOsNagrm721 = " + Convert.ToInt32(alphaBlendTextBox54.Text) + ", " + " MaxOsNagrm722 = " + Convert.ToInt32(alphaBlendTextBox61.Text) + ", " + "MaxOsNagrm861= " + Convert.ToInt32(alphaBlendTextBox73.Text) + ", " + "MaxOsNagrm862= " + Convert.ToInt32(alphaBlendTextBox72.Text) + ", " + "MaxOsNagrm811= " + Convert.ToInt32(alphaBlendTextBox71.Text) + ", " + "MaxOsNagrm812= " + Convert.ToInt32(alphaBlendTextBox70.Text) + ", " + "MaxOsNagrm821= " + Convert.ToInt32(alphaBlendTextBox69.Text) + ", " + "MaxOsNagrm822= " + Convert.ToInt32(alphaBlendTextBox68.Text) + ", " + " Kategory = " + Convert.ToInt32(alphaBlendTextBox22.Text) + ", " + " PolnMassb = " + Convert.ToInt32(alphaBlendTextBox21.Text) + ", " + " SubCategory = " + Convert.ToInt32(alphaBlendTextBox23.Text) + ", " + " PolnMassm = " + Convert.ToInt32(alphaBlendTextBox20.Text) + ", " + " prim = '" + alphaBlendTextBox24.Text + "' WHERE idklassts = " + IDKL; command.CommandText = z; command.Connection = connection; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); Close(); }
internal void FormPDKO_LoadRN(int IDTS) { button1.Visible = false; button2.Visible = true; string z = "SELECT " + "raposnagrts.iddon, " + "raposnagrts.duble_os, " + "raposnagrts.tupeos, " + "raposnagrts.nametupeos, " + "raposnagrts.rasstjsey_min, " + "raposnagrts.rasstjsey_max, " + "raposnagrts.pdo, " + "raposnagrts.pdt, " + "raposnagrts.nagrad, " + "raposnagrts.NosFor, " + "raposnagrts.NosTo, " + "raposnagrts.NcircleFor, " + "raposnagrts.NcircleTo, " + "raposnagrts.TypeOsTo " + "FROM raposnagrts " + "WHERE raposnagrts.iddon = " + IDTS; MySqlCommand command = new MySqlCommand(); ConnectStr conStr = new ConnectStr(); conStr.ConStr(1); Zapros zapros = new Zapros(); string connectionString; connectionString = conStr.StP; MySqlConnection connection = new MySqlConnection(connectionString); command.CommandText = z;// commandString; command.Connection = connection; MySqlDataReader readerT; try { command.Connection.Open(); readerT = command.ExecuteReader(); while (readerT.Read()) { NF = Convert.ToInt32(readerT["NosFor"].ToString()); NT = Convert.ToInt32(readerT["NosTo"].ToString()); //alphaBlendTextBox6.Text = readerT["NcircleFor"].ToString(); //alphaBlendTextBox5.Text = readerT["NcircleTo"].ToString(); RF = Convert.ToInt32(readerT["rasstjsey_min"].ToString()); RT = Convert.ToInt32(readerT["rasstjsey_max"].ToString()); //alphaBlendTextBox26.Text = readerT["Distanc2_3Min"].ToString(); //alphaBlendTextBox1.Text = readerT["Distanc2_3Max"].ToString(); //alphaBlendTextBox2.Text = readerT["Distanc3_4Min"].ToString(); //alphaBlendTextBox11.Text = readerT["Distanc3_4Max"].ToString(); //alphaBlendTextBox10.Text = readerT["Distanc4_5Min"].ToString(); //alphaBlendTextBox9.Text = readerT["Distanc4_5Max"].ToString(); //alphaBlendTextBox14.Text = readerT["Distanc5_6Min"].ToString(); //alphaBlendTextBox13.Text = readerT["Distanc5_6Max"].ToString(); //alphaBlendTextBox12.Text = readerT["Distanc6_7Min"].ToString(); //alphaBlendTextBox20.Text = readerT["Distanc6_7Max"].ToString(); //alphaBlendTextBox19.Text = readerT["Distanc7_8Min"].ToString(); //alphaBlendTextBox18.Text = readerT["Distanc7_8Max"].ToString(); //alphaBlendTextBox17.Text = readerT["MaxOsNagrm161"].ToString(); //alphaBlendTextBox16.Text = readerT["MaxOsNagrm162"].ToString(); //alphaBlendTextBox15.Text = readerT["MaxOsNagrm111"].ToString(); } IDKL = IDTS; readerT.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command.Connection.Close(); } string z1 = "SELECT " + "raposnagrts.iddon, " + "raposnagrts.duble_os, " + "raposnagrts.tupeos, " + "raposnagrts.nametupeos, " + "raposnagrts.rasstjsey_min, " + "raposnagrts.rasstjsey_max, " + "raposnagrts.pdo, " + "raposnagrts.pdt, " + "raposnagrts.nagrad, " + "raposnagrts.NosFor, " + "raposnagrts.NosTo, " + "raposnagrts.NcircleFor, " + "raposnagrts.NcircleTo, " + "raposnagrts.TypeOsTo, " + "pdodoub , " + "pdtdoub " + "FROM raposnagrts " + "WHERE raposnagrts.NosFor = " + NF + " AND NosTo = " + NT + " AND rasstjsey_min = " + RF + " AND rasstjsey_max = " + RT; MySqlCommand command1 = new MySqlCommand(); ConnectStr conStr1 = new ConnectStr(); conStr1.ConStr(1); Zapros zapros1 = new Zapros(); string connectionString1; connectionString1 = conStr1.StP; MySqlConnection connection1 = new MySqlConnection(connectionString1); command1.CommandText = z1;// commandString; command1.Connection = connection1; MySqlDataReader reader1; try { command1.Connection.Open(); reader1 = command1.ExecuteReader(); while (reader1.Read()) { if (reader1["nagrad"].ToString() == "6") { //if (reader1["duble_os"].ToString() == "1") //{ alphaBlendTextBox3.Text = reader1["NosFor"].ToString(); alphaBlendTextBox4.Text = reader1["NosTo"].ToString(); alphaBlendTextBox6.Text = reader1["NcircleFor"].ToString(); alphaBlendTextBox5.Text = reader1["NcircleTo"].ToString(); alphaBlendTextBox8.Text = reader1["rasstjsey_min"].ToString(); alphaBlendTextBox7.Text = reader1["rasstjsey_max"].ToString(); alphaBlendTextBox26.Text = reader1["nagrad"].ToString(); alphaBlendTextBox11.Text = reader1["pdo"].ToString(); alphaBlendTextBox20.Text = reader1["pdt"].ToString(); alphaBlendTextBox23.Text = reader1["iddon"].ToString(); alphaBlendTextBox28.Text = reader1["nametupeos"].ToString(); //} //else //{ alphaBlendTextBox14.Text = reader1["pdodoub"].ToString(); alphaBlendTextBox17.Text = reader1["pdtdoub"].ToString(); alphaBlendTextBox27.Text = reader1["iddon"].ToString(); //} } else if (reader1["nagrad"].ToString() == "10") { //if (reader1["duble_os"].ToString() == "1") //{ alphaBlendTextBox1.Text = reader1["nagrad"].ToString(); alphaBlendTextBox10.Text = reader1["pdo"].ToString(); alphaBlendTextBox19.Text = reader1["pdt"].ToString(); alphaBlendTextBox22.Text = reader1["iddon"].ToString(); //} //else //{ alphaBlendTextBox13.Text = reader1["pdodoub"].ToString(); alphaBlendTextBox16.Text = reader1["pdtdoub"].ToString(); alphaBlendTextBox25.Text = reader1["iddon"].ToString(); //} } else if (reader1["nagrad"].ToString() == "11.5") { //if (reader1["duble_os"].ToString() == "1") //{ alphaBlendTextBox2.Text = reader1["nagrad"].ToString(); alphaBlendTextBox9.Text = reader1["pdo"].ToString(); alphaBlendTextBox18.Text = reader1["pdt"].ToString(); alphaBlendTextBox21.Text = reader1["iddon"].ToString(); //} //else //{ alphaBlendTextBox12.Text = reader1["pdodoub"].ToString(); alphaBlendTextBox15.Text = reader1["pdtdoub"].ToString(); alphaBlendTextBox24.Text = reader1["iddon"].ToString(); //} } } IDKL = IDTS; reader1.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { command1.Connection.Close(); } }
public void FormPDFN(Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string GAng, Bitmap i4, Bitmap i5, Bitmap i6, Bitmap i7, int[,] KNRA, Int64 IDW, string PLN)//Bitmap i1, Bitmap i2, Bitmap i3, string[] args, string NRUB, string N1, string N2, string N3)//public void FormPDF(System.IO.Stream i1, System.IO.Stream i2, System.IO.Stream i3, string[] args) { string aaa = @"F:\\archiv\\AKT\\" + DateTime.Now.ToString("dd_MM_yyyy"); DateTime YesterdayDate = DateTime.Today.Date; DirectoryInfo dirInfo = new DirectoryInfo(@"F:\\archiv\\AKT\\"); if (!Directory.Exists(aaa)) { Directory.CreateDirectory(aaa); } String dir = Environment.CurrentDirectory; //получаем текущую рабочую папку приложения String dir1 = Application.StartupPath; //получаем папку из которой произошел запуск приложения var pdfTemplate = @"" + dir1 + "\\AKT.pdf"; pdfFile = @"F:\\archiv\\AKT\\" + GAng + ".pdf"; //args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".pdf"; pf = GAng; //args[259] + "_" + DateTime.Now.ToString("ddMMyyyy"); //using (var templateReader = new PdfReader(pdfTemplate)) zLB = "SELECT " + "binarycontainer_n.*, " + "binarycontainer_n.ID_PR " + "FROM binarycontainer_n " + "WHERE binarycontainer_n.ID_PR = " + IDW + " AND platformid = " + PLN + ";"; MySqlCommand commandLB = new MySqlCommand(); ConnectStr conStrLB = new ConnectStr(); conStrLB.ConStr(1); Zapros zaprosLB = new Zapros(); string connectionStringLB; //, commandString; connectionStringLB = conStrLB.StP; //"Data source=localhost;UserId=root;Password=1q2w3e$R;database=camloc;"; MySqlConnection connectionLB = new MySqlConnection(connectionStringLB); commandLB.CommandText = zLB;// commandString; commandLB.Connection = connectionLB; MySqlDataReader readerLB; try { commandLB.Connection.Open(); readerLB = commandLB.ExecuteReader(); while (readerLB.Read()) { if (readerLB["name"].ToString() != "Video") { if (readerLB["name"].ToString() == "Image") { try { string st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// Im = new Bitmap(@"" + st9); imag = iTextSharp.text.Image.GetInstance(Im, System.Drawing.Imaging.ImageFormat.Png); //DirectoryInfo directoryP = new DirectoryInfo(@"F:\\archiv\\AKT\\" + YesterdayDate.ToString("ddMMyyyy"));//file => file.LastWriteTime.Date == YesterdayDate ); //foreach (FileInfo file in filesP) // File.Delete(Path.Combine(destFolder, file.Name)); //foreach (FileInfo file in filesP) // File.Copy(file.FullName, Path.Combine(destFolder, file.Name)); //string[] foldersP = Directory.GetDirectories(sourceFolder); //foreach (FileInfo file in filesP) // File.Delete(file.FullName); //FileInfo[] filesI = dirInfo.GetFiles("" + GAng.ToString() + "*.Jpg");//.AddDays(-1).ToString("yyyyMMdd") + "_*.xml");//sourceFolder); //DirectoryInfo directoryI = new DirectoryInfo(@"F:\\archiv\\AKT\\" + YesterdayDate.ToString("ddMMyyyy"));//file => file.LastWriteTime.Date == YesterdayDate ); //foreach (FileInfo file in filesI) // File.Delete(Path.Combine(destFolder, file.Name)); //foreach (FileInfo file in filesI) File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_1.Jpg")); //string[] foldersI = Directory.GetDirectories(sourceFolder); //foreach (FileInfo file in filesI) // File.Delete(file.FullName); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ImgPlate") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// ImPl = new Bitmap(@"" + st9); imag2 = iTextSharp.text.Image.GetInstance(ImPl, System.Drawing.Imaging.ImageFormat.Png); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_grz.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ImageAlt") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //ImAlt = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_2.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ScanS") { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //SkS = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_7.Jpg")); } //if (readerLB["name"].ToString() == "ImageAlt1") //{ // string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// // ImAlt1 = new Bitmap(@"" + st9); //} //if (readerLB["name"].ToString() == "ImageAlt2") //{ // string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// // ImAlt2 = new Bitmap(@"" + st9); //} //if (readerLB["name"].ToString() == "Image1") //{ // string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// // Im1 = new Bitmap(@"" + st9); //} //if (readerLB["name"].ToString() == "Image2") //{ // string st9 = readerLB["dataavailable"].ToString(); // Im2 = new Bitmap(@"" + st9); //} if (readerLB["name"].ToString() == "ScanF") { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //SkF = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_8.Jpg")); } if (readerLB["name"].ToString() == "ScanT") { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //SkT = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_9.Jpg")); } if (readerLB["name"].ToString() == "ImageRea") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //ImR = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_3.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ImgObj") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// ImOb = new Bitmap(@"" + st9); imag3 = iTextSharp.text.Image.GetInstance(ImOb, System.Drawing.Imaging.ImageFormat.Png); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + ".Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ReaAlt") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //ImAltR = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_4.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ReaObj") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //ImROb = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_5.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } if (readerLB["name"].ToString() == "ReaPlate") { try { string st9 = st9 = readerLB["dataavailable"].ToString();//@"X:\" + readerLB["dataavailable"].ToString().Substring(13, readerLB["dataavailable"].ToString().Length - 13);// //ImPlR = new Bitmap(@"" + st9); File.Copy(@"" + st9, Path.Combine(aaa, "" + GAng + "_6.Jpg")); } catch (MySqlException ex) { return; } finally { int w = 1; } } } } readerLB.Close(); } catch (MySqlException ex) { Console.WriteLine("Error: \r\n{0}", ex.ToString()); } finally { commandLB.Connection.Close(); } //{ //if (i1 != null) //{ // //System.Drawing.Bitmap imgg = new System.Drawing.Bitmap(i1); // imag = iTextSharp.text.Image.GetInstance(Im, System.Drawing.Imaging.ImageFormat.Png); // //imgg.Save(@"F:\\archiv\\AKT\\" + GAng + "_1.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_1.Jpg"); //} //if (i2 != null) //{ // System.Drawing.Bitmap imgg2 = new System.Drawing.Bitmap(i2); // imag2 = iTextSharp.text.Image.GetInstance(imgg2, System.Drawing.Imaging.ImageFormat.Png); // imgg2.Save(@"F:\\archiv\\AKT\\" + GAng + "_grz.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_grz.Jpg"); //} //if (i3 != null) //{ // System.Drawing.Bitmap imgg3 = new System.Drawing.Bitmap(i3); // imag3 = iTextSharp.text.Image.GetInstance(imgg3, System.Drawing.Imaging.ImageFormat.Png); // imgg3.Save(@"F:\\archiv\\AKT\\" + GAng + ".Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + ".Jpg"); //} //if (i4 != null) //{ // System.Drawing.Bitmap imgg4 = new System.Drawing.Bitmap(i4); // imag4 = iTextSharp.text.Image.GetInstance(imgg4, System.Drawing.Imaging.ImageFormat.Png); // imgg4.Save(@"F:\\archiv\\AKT\\" + GAng + "_2.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); //} //if (i5 != null) //{ // System.Drawing.Bitmap imgg5 = new System.Drawing.Bitmap(i5); // imag5 = iTextSharp.text.Image.GetInstance(imgg5, System.Drawing.Imaging.ImageFormat.Png); // imgg5.Save(@"F:\\archiv\\AKT\\" + GAng + "_3.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); //} //if (i6 != null) //{ // System.Drawing.Bitmap imgg6 = new System.Drawing.Bitmap(i6); // imag6 = iTextSharp.text.Image.GetInstance(imgg6, System.Drawing.Imaging.ImageFormat.Png); // imgg6.Save(@"F:\\archiv\\AKT\\" + GAng + "_4.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); //} //if (i7 != null) //{ // System.Drawing.Bitmap imgg7 = new System.Drawing.Bitmap(i7); // imag7 = iTextSharp.text.Image.GetInstance(imgg7, System.Drawing.Imaging.ImageFormat.Png); // imgg7.Save(@"F:\\archiv\\AKT\\" + GAng + "_5.Jpg"); //" + args[259] + "_" + DateTime.Now.ToString("ddMMyyyy") + "_2.Jpg"); //} /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////var doc = new Document(); ////////////PdfWriter.GetInstance(doc, new FileStream(Application.StartupPath + @"\Document.pdf", FileMode.Create)); ////////////doc.Open(); ////////////iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/images.jpg"); ////////////jpg.Alignment = Element.ALIGN_CENTER; ////////////doc.Add(jpg); ////////////PdfPTable table = new PdfPTable(3); ////////////PdfPCell cell = new PdfPCell(new Phrase("Simple table", //////////// new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 16, //////////// iTextSharp.text.Font.NORMAL, new BaseColor(Color.Orange)))); ////////////cell.BackgroundColor = new BaseColor(Color.Wheat); ////////////cell.Padding = 5; ////////////cell.Colspan = 3; ////////////cell.HorizontalAlignment = Element.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////table.AddCell("Col 1 Row 1"); ////////////table.AddCell("Col 2 Row 1"); ////////////table.AddCell("Col 3 Row 1"); ////////////table.AddCell("Col 1 Row 2"); ////////////table.AddCell("Col 2 Row 2"); ////////////table.AddCell("Col 3 Row 2"); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/left.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT; ////////////table.AddCell(cell); ////////////cell = new PdfPCell(new Phrase("Col 2 Row 3")); ////////////cell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; ////////////table.AddCell(cell); ////////////jpg = iTextSharp.text.Image.GetInstance(Application.StartupPath + @"/right.jpg"); ////////////cell = new PdfPCell(jpg); ////////////cell.Padding = 5; ////////////cell.HorizontalAlignment = PdfPCell.ALIGN_RIGHT; ////////////table.AddCell(cell); ////////////doc.Add(table); ////////////doc.Close(); using (var templateReader = new PdfReader(pdfTemplate)) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// using (var resultStamper = new PdfStamper(templateReader, new FileStream(pdfFile, FileMode.Create))) { var pdfcontentbyte = resultStamper.GetOverContent(1); if (Im != null) { imag.SetAbsolutePosition(55, 369); //695 imag.ScaleAbsoluteWidth(127); imag.ScaleAbsoluteHeight(90); imag.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag); } if (ImPl != null) { imag2.SetAbsolutePosition(230, 417); //745 imag2.ScaleAbsoluteWidth(137); imag2.ScaleAbsoluteHeight(40); imag2.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag2); } if (ImOb != null) { imag3.SetAbsolutePosition(404, 369); //696 imag3.ScaleAbsoluteWidth(146); imag3.ScaleAbsoluteHeight(89); imag3.Alignment = Element.ALIGN_CENTER; pdfcontentbyte.AddImage(imag3); } PdfPTable table = new PdfPTable(14); table.AddCell("Cell 1"); table.AddCell("Cell 2"); table.AddCell("Cell 3"); table.AddCell("Cell 4"); table.AddCell("Cell 5"); table.AddCell("Cell 6"); table.AddCell("Cell 7"); table.AddCell("Cell 8"); // Получаем ссылку на форму с полями. var form = resultStamper.AcroFields; // Получаем все шрифты формы. //BaseFont baseFont = BaseFont.CreateFont(@"C:\Users\cherednikov\Desktop\WFPDF\WFPDF\calibri.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //iTextSharp.text.Font font = new iTextSharp.text.Font(baseFont, iTextSharp.text.Font.DEFAULTSIZE, iTextSharp.text.Font.NORMAL); var font = templateReader.GetFormFonts(); // Установка значений полей формы. // Установка значений полей формы. form.SetFieldWithFont(templateReader, font, "A1", args[0]); form.SetFieldWithFont(templateReader, font, "A3", args[1]); form.SetFieldWithFont(templateReader, font, "A4", args[2]); form.SetFieldWithFont(templateReader, font, "A5", args[3]); form.SetFieldWithFont(templateReader, font, "A6", args[4]); form.SetField("A2", args[250]); form.SetField("A9", args[5] + ", " + args[6]); form.SetField("A7", args[7]); form.SetField("A8", args[8]); if (args[18] == "Региональная") { form.SetField("A10", "Автомобильная дорога регионального значения " + args[9]); } else if (args[18] == "Муниципальная") { form.SetField("A10", "Автомобильная дорога муниципального значения " + args[9]); } else if (args[18] == "Федеральная") { form.SetField("A10", "Автомобильная дорога федерального значения " + args[9]); } //form.SetField("A10", args[9]); form.SetField("A11", args[21]); form.SetField("A12", args[10]); form.SetField("A13", "ДТ и РДТИ г. Севастополя");// args[11]); form.SetField("A14", args[25]); form.SetField("A15", args[26]); form.SetField("A16", args[28]); form.SetField("A17", args[27]); form.SetField("A19", args[29]); form.SetField("A20", args[41]); form.SetField("A21", args[42]); form.SetField("A22", args[43]); form.SetField("A18", args[259]); form.SetField("A221", args[258]); /*ОБЩ_МАССА*/ form.SetField("A23", args[65]); form.SetField("A24", args[66]); form.SetField("A25", args[67]); form.SetField("A26", args[68]); form.SetField("A27", args[69]); form.SetField("A28", args[70]); /*ДЛИНА*/ form.SetField("A29", args[44]); form.SetField("A30", args[47]); form.SetField("A31", args[50]); form.SetField("A32", args[53]); form.SetField("A33", args[56]); /*form.SetField("A55", args[59])*/; form.SetField("A34", args[62]); /*ШИРИНА*/ form.SetField("A35", args[45]); form.SetField("A36", args[48]); form.SetField("A37", args[51]); form.SetField("A38", args[54]); form.SetField("A39", args[57]); /*form.SetField("A56", args[60])*/; form.SetField("A40", args[63]); /*ВЫСОТА*/ form.SetField("A41", args[46]); form.SetField("A42", args[49]); form.SetField("A43", args[52]); form.SetField("A44", args[55]); form.SetField("A45", args[58]); /*form.SetField("A57", args[61]);*/ form.SetField("A46", args[64]); /*СКАТНОСТЬ_КОЛ_КОЛЕС*/ form.SetField("A47", args[73]); form.SetField("A48", args[84]); form.SetField("A49", args[95]); form.SetField("A50", args[106]); form.SetField("A51", args[117]); form.SetField("A52", args[128]); form.SetField("A53", args[139]); form.SetField("A54", args[150]); form.SetField("A55", args[161]); /*СКАТНОСТ_КОЛ_КОЛЕС_ПО_СПЕЦ_РАЗР*/ if (args[73] != null) { form.SetField("A56", "-"); } if (args[84] != null) { form.SetField("A57", "-"); } if (args[95] != null) { form.SetField("A58", "-"); } if (args[106] != null) { form.SetField("A59", "-"); } if (args[117] != null) { form.SetField("A60", "-"); } if (args[128] != null) { form.SetField("A61", "-"); } if (args[139] != null) { form.SetField("A62", "-"); } if (args[150] != null) { form.SetField("A63", "-"); } if (args[161] != null) { form.SetField("A64", "-"); } //МЕЖОСЕВЫЕ if (args[86] != null) { form.SetField("A65", "+ 0.03"); } if (args[97] != null) { form.SetField("A66", "+ 0.03"); } if (args[108] != null) { form.SetField("A67", "+ 0.03"); } if (args[119] != null) { form.SetField("A68", "+ 0.03"); } if (args[130] != null) { form.SetField("A69", "+ 0.03"); } if (args[141] != null) { form.SetField("A70", "+ 0.03"); } if (args[152] != null) { form.SetField("A71", "+ 0.03"); } if (args[163] != null) { form.SetField("A72", "+ 0.03"); } form.SetField("A73", args[86]); form.SetField("A74", args[97]); form.SetField("A75", args[108]); form.SetField("A76", args[119]); form.SetField("A77", args[130]); form.SetField("A78", args[141]); form.SetField("A79", args[152]); form.SetField("A80", args[163]); form.SetField("A81", args[87]); form.SetField("A82", args[98]); form.SetField("A83", args[109]); form.SetField("A84", args[120]); form.SetField("A85", args[131]); form.SetField("A86", args[142]); form.SetField("A87", args[153]); form.SetField("A88", args[164]); /*Факт_нагрузка_на_оси */ form.SetField("A141", args[77]); form.SetField("A142", args[88]); form.SetField("A143", args[99]); form.SetField("A144", args[110]); form.SetField("A145", args[121]); form.SetField("A146", args[132]); form.SetField("A147", args[143]); form.SetField("A148", args[154]); form.SetField("A149", args[165]); /*Погрешность_нагрузки_на_оси */ form.SetField("A132", Convert.ToString(Convert.ToDouble(args[77]) * 0.1)); form.SetField("A133", Convert.ToString(Convert.ToDouble(args[88]) * 0.1)); form.SetField("A134", Convert.ToString(Convert.ToDouble(args[99]) * 0.1)); form.SetField("A135", Convert.ToString(Convert.ToDouble(args[110]) * 0.1)); form.SetField("A136", Convert.ToString(Convert.ToDouble(args[121]) * 0.1)); form.SetField("A137", Convert.ToString(Convert.ToDouble(args[132]) * 0.1)); form.SetField("A138", Convert.ToString(Convert.ToDouble(args[143]) * 0.1)); form.SetField("A139", Convert.ToString(Convert.ToDouble(args[154]) * 0.1)); form.SetField("A140", Convert.ToString(Convert.ToDouble(args[165]) * 0.1)); /*вычисленные_нагрузки_на_оси */ form.SetField("A150", args[78]); form.SetField("A151", args[89]); form.SetField("A152", args[100]); form.SetField("A153", args[111]); form.SetField("A154", args[122]); form.SetField("A155", args[133]); form.SetField("A156", args[144]); form.SetField("A157", args[155]); form.SetField("A158", args[167]); /*ПДК_нагрузки_на_оси */ form.SetField("A159", args[79]); form.SetField("A160", args[90]); form.SetField("A161", args[101]); form.SetField("A162", args[112]); form.SetField("A163", args[123]); form.SetField("A164", args[134]); form.SetField("A165", args[145]); form.SetField("A166", args[156]); form.SetField("A167", args[167]); /*ПДК_по_спец.разрешению_нагрузки_на_оси */ form.SetField("A168", args[80]); form.SetField("A169", args[91]); form.SetField("A170", args[102]); form.SetField("A171", args[113]); form.SetField("A172", args[124]); form.SetField("A173", args[135]); form.SetField("A174", args[146]); form.SetField("A175", args[157]); form.SetField("A176", args[168]); /*_%_превышения_нагрузки_на_оси */ form.SetField("A177", args[81]); form.SetField("A178", args[92]); form.SetField("A179", args[103]); form.SetField("A180", args[114]); form.SetField("A181", args[125]); form.SetField("A182", args[136]); form.SetField("A183", args[147]); form.SetField("A184", args[158]); form.SetField("A185", args[169]); /*_Скорость_ТС_превышения_скорости */ form.SetField("A186", args[251]); form.SetField("A187", args[252]); form.SetField("A188", args[253]); form.SetField("A189", args[254]); form.SetField("A190", args[255]); form.SetField("A191", args[256]); form.SetField("A192", args[257]); /*ИНФОРМАЦИЯ ПО СПЕЦ.РАЗРЕШЕНИЮ */ form.SetField("A193", args[30]); form.SetField("A194", args[32]); form.SetField("A195", args[33]); form.SetField("A196", args[34]); form.SetField("A197", args[35]); form.SetField("A198", args[36]); form.SetField("A199", args[37]); form.SetField("A200", args[39]); form.SetField("A201", args[38]); form.SetField("A202", "-" /*args[169]*/); form.SetField("A203", args[218]); form.SetField("A204", args[229]); /*_Информация о поверке */ form.SetField("A205", args[12]); form.SetField("A206", args[15]); form.SetField("A207", args[14]); form.SetField("A208", args[16]); form.SetField("A209", args[13]); form.SetField("A210", args[17]); /*Информация о контолируемом участке */ if (args[18] == "Региональная") { form.SetField("A211", "Автомобильная дорога регионального значения общего пользования города Севастополь"); } else if (args[18] == "Муниципальная") { form.SetField("A211", "Автомобильная дорога муниципального значения общего пользования города Севастополь"); } else if (args[18] == "Федеральная") { form.SetField("A211", "Автомобильная дорога федерального значения общего пользования города Севастополь"); } //form.SetField("A211", args[18]); form.SetField("A212", args[9]); form.SetField("A213", args[19]); form.SetField("A214", args[10]); form.SetField("A215", "Автомобильная дорога рассчитана под нормативную осевую нагрузку 10 тонн на ось" /*args[125]*/); form.SetField("A216", "Приказ ДТиРДТИ г. Севастополя № ____________от ______________ " /*args[136]*/); form.SetField("A217", args[245]); form.SetField("A218", args[246]); form.SetField("A219", "-" /*args[169]*/); string CheckField = ""; int k = 1; int j = 0; int width = 0; int i = 1; int c = 0; int count = 0; while (KNRA[1, c] > 0) { count = count + KNRA[1, c]; c++; } string Name_field = ""; while (i <= 8) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 1) { width = KNRA[1, j]; } else { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j] - 1; //int c = j + 1; //while (KNRA[0,c] > 0) //{ // KNRA[0, c] = KNRA[0, c] - 1; // c++; //} } Name_field = "A" + '5' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 8) { CheckField = "A" + "5" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[164 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '6' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "6" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[166 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '7' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "7" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[167 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '8' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "8" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[168 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } i = 1; j = 0; CheckField = ""; Name_field = ""; width = 0; while (i <= 9) { if (KNRA[0, j] == i) { if (KNRA[1, j] == 4) { KNRA[1, j] = Convert.ToInt32(args[28]) - (count - 4); } width = KNRA[1, j]; Name_field = "A" + '9' + KNRA[0, j].ToString() + width.ToString(); } k = 1; while (k <= 9) { CheckField = "A" + "9" + i.ToString() + k.ToString(); if (CheckField == Name_field && KNRA[1, j] != 1) { form.SetField(CheckField, args[169 + (j + 1) * 11]); j++; } else { if (KNRA[1, j] == 1) { j++; } form.RemoveField(CheckField); } k++; } i++; } // Установка запрета на редактирование полей. resultStamper.FormFlattening = true; resultStamper.Writer.Add(table); resultStamper.Close(); //} templateReader.Close(); } //File.Copy(@"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\" + pf + ".pdf", @"C:\\Users\\cherednikov\\Desktop\\АКТЫ\\123777\\" + pf + ".pdf"); //if (Puti[5] == "WIN-D3J6PR1H9QK") //{ File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); } //else { File.Copy(@"" + Puti[3] + pf + ".pdf", @"" + Puti[4] + pf + ".pdf"); }; // File.Copy(@"F:\\archiv\\AKT\\" + pf + ".pdf", @"F:\\archivACT\\act\\" + pf + ".pdf"); }