예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            string code             = this.textBox1.Text;
            string name             = this.textBox3.Text;
            departements_search frm = new departements_search();

            frm.showdi(ref code, ref name);
            this.textBox3.Text = name;
            this.textBox1.Text = code;
            try
            {
                con.OpenConection();
                SqlCommand cmd = new SqlCommand("fill_departement", con.con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("code", Int32.Parse(textBox1.Text));
                var b = cmd.Parameters.Add("name", SqlDbType.VarChar, 255);
                b.Direction = ParameterDirection.Output;
                var c = cmd.Parameters.Add("manager", SqlDbType.VarChar, 255);
                c.Direction = ParameterDirection.Output;
                var d = cmd.Parameters.Add("phone", SqlDbType.VarChar, 255);
                d.Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                textBox3.Text = b.Value.ToString();
                textBox4.Text = c.Value.ToString();
                textBox5.Text = d.Value.ToString();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }



            con.CloseConnection();
        }
예제 #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            string code             = this.textBox5.Text;
            string name             = this.textBox14.Text;
            departements_search frm = new departements_search();

            frm.showdi(ref code, ref name);
            this.textBox14.Text = name;
            this.textBox5.Text  = code;
        }