using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StekloMaster
{
    public partial class Form15 : Form
    {
        public Form15()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow == null) return;
            Form1 g = this.Owner as Form1;
            g.textBox10.Text = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
            this.Close();
        }

        private void Form12_Load(object sender, EventArgs e)
        {
            string putin = "";
            if (Application.StartupPath.IndexOf("comp") != -1)
            {
                putin = Application.StartupPath.Substring(0, Application.StartupPath.IndexOf("\\comp"));
            }
            else
            {
                putin = Application.StartupPath;
            }
            StreamReader sr2 = new StreamReader(putin + "\\podem.akv");
            string k2 = sr2.ReadToEnd();
            sr2.Close();
            string[] rn = k2.Split('\n');
            foreach (string s in rn)
            {
                string tmp = s.Replace("\r", "");
                if (tmp == "" || tmp == null) continue;
                int i = dataGridView1.Rows.Count;
                dataGridView1.Rows.Add();
                dataGridView1.Rows[i].Cells[0].Value = tmp.Split('|')[0];
                dataGridView1.Rows[i].Cells[1].Value = tmp.Split('|')[1];
            }
        }
    }
}
