예제 #1
0
        public void Pribor()
        {
            var          applicationDirectory = Path.GetDirectoryName(Application.ExecutablePath);
            const string model     = @"pribor/model";
            var          model_var = Path.Combine(applicationDirectory, model);

            string SerNomer_Text     = @"pribor/SerNomer";
            var    SerNomer_Text_var = Path.Combine(applicationDirectory, SerNomer_Text);

            string InventarNomer_Text     = @"pribor/InventarNomer";
            var    InventarNomer_Text_var = Path.Combine(applicationDirectory, InventarNomer_Text);

            string SrokIstech_Text     = @"pribor/SrokIstech";
            var    SrokIstech_Text_var = Path.Combine(applicationDirectory, SrokIstech_Text);

            string Poveren_Text     = @"pribor/Poveren";
            var    Poveren_Text_var = Path.Combine(applicationDirectory, Poveren_Text);

            string address_lab_Text = @"pribor/address_lab";
            var    address_lab_var  = Path.Combine(applicationDirectory, address_lab_Text);

            string name_lab_Text = @"pribor/name_lab";
            var    name_lab_var  = Path.Combine(applicationDirectory, name_lab_Text);

            StreamReader fs = new StreamReader(model_var);
            string       model1;

            model1 = fs.ReadLine();
            int index = Model1.FindString(model1);

            if (index != -1)
            {
                Model1.SelectedIndex = index;
            }
            else
            {
                Model1.SelectedIndex = 0;
            }
            fs.Close();

            StreamReader fs1 = new StreamReader(SerNomer_Text_var);

            textBox1.Text = fs1.ReadLine();
            fs1.Close();

            StreamReader fs2 = new StreamReader(InventarNomer_Text_var);

            textBox2.Text = fs2.ReadLine();
            fs2.Close();

            StreamReader fs3 = new StreamReader(SrokIstech_Text_var);

            textBox3.Text = fs3.ReadLine();
            fs3.Close();

            if (textBox3.Text != "")
            {
                checkBox1.Checked = true;
            }
            else
            {
                textBox3.Enabled = false;
            }

            StreamReader fs4 = new StreamReader(Poveren_Text_var);

            dateTimePicker1.Text = fs4.ReadLine();
            fs4.Close();

            StreamReader fs5 = new StreamReader(address_lab_var);

            textBox5.Text = fs5.ReadLine();
            fs5.Close();

            StreamReader fs6 = new StreamReader(name_lab_var);

            textBox4.Text = fs6.ReadLine();
            fs6.Close();
        }