how to get value from winform textbox and add to database field
<p>i have two table(kala,reception) and two winforms(kala,reception), i want when i fill the reception form(specialy txtqty) and insert the data, it(txtqty) adds to kala table field(txtkqty). how can i write this code behind the button in reception form.
reception form:</p>

<pre><code>private void btninsert_Click(object sender, EventArgs e)
        {
            string check = br.createreceipt(int.Parse(txtreceptcode.Text),
                                            int.Parse(comboBox_kala.SelectedValue.ToString()),
                                            int.Parse(comboBox_suplier.SelectedValue.ToString()
                                                ), int.Parse(txtqty.Text), DateTime.Parse(dateTimePicker_recept.Text));
            if (check == "true")
            {
                dtrecept = br.getdata();
                dataGridViewrecept.DataSource = dtrecept;
                txtreceptcode.Text = null;
                txtqty.Text = null;
            }


        } 
</code></pre>

<p>kala form</p>

<pre><code> private void btnkalainsert_Click(object sender, EventArgs e)
        {
            string check = bk.createkala(int.Parse(txtkalacode.Text), txtkalaname.Text, int.Parse(txtkqty.Text),
                                         int.Parse(txtkalapoint.Text));
            if (check=="true")
            {
                dt = bk.Getdata();
                dataGridViewkala.DataSource = dt;
            }
            else
            {
                MessageBox.Show(check);
            }
        }
</code></pre>

<p>reception DAL:</p>

<pre><code>namespace DAL
{
  public  class TblreceiptionDal
    {
        SqlConnection cn=new SqlConnection("Data Source=(local);Initial Catalog=store;Integrated Security=true");
        public DataTable getall()
        {
            DataSet ds=new DataSet();
            SqlDataAdapter sa = new SqlDataAdapter("Spinforeceip", cn);
            sa.SelectCommand.CommandType = CommandType.StoredProcedure;
            sa.Fill(ds, "Spinforeceip");
            return ds.Tables["Spinforeceip"];
        }
        public string createreceipt(int recept_id,int kala_id,int suplier_id,int recept_qty ,DateTime recept_date)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("Sptblreception_insert", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@recept_id", recept_id);
                cmd.Parameters.AddWithValue("@kala_id", kala_id);
                cmd.Parameters.AddWithValue("@suplier_id", suplier_id);
                cmd.Parameters.AddWithValue("@recept_qty", recept_qty);
                cmd.Parameters.AddWithValue("@recept_date", recept_date);
                cn.Open();
                cmd.ExecuteNonQuery();
                cn.Close();
                return "true";
            }
            catch (Exception ex)
            {
                return ex.Message;
                throw;
            }

        }
        public String deletereceipt(int recept_id)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("Sptblreception_delete",cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@recept_id", recept_id);
                cn.Open();
                cmd.ExecuteNonQuery();
                cn.Close();
                return "true";
            }
            catch (Exception ex)
            {
                return ex.Message;
                throw;
            }
        }
        public string updatereceipt(int recept_id,int kala_id,int suplier_id,int recept_qty ,DateTime recept_date)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("Sptblreception_update", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@recept_id", recept_id);
                cmd.Parameters.AddWithValue("@kala_id", kala_id);
                cmd.Parameters.AddWithValue("@suplier_id", suplier_id);
                cmd.Parameters.AddWithValue("@recept_qty", recept_qty);
                cmd.Parameters.AddWithValue("@recept_date", recept_date);
                cn.Open();
                cmd.ExecuteNonQuery();
                cn.Close();
                return "true";
            }
            catch (Exception ex)
            {
                return ex.Message;
                throw;
            }
        }
      public string receptgetbyid(int recept_id)
      {
          try
          {
              SqlCommand cmd = new SqlCommand("Sptblreception_getbyid",cn);
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.Parameters.AddWithValue("@recept_id", recept_id);
              cn.Open();
              cmd.ExecuteNonQuery();
              cn.Close();
              return "true";

          }
          catch (Exception ex)
          {
              return ex.Message;
              throw;
          }
      }
    }
}
</code></pre>

<p>reception BLL:</p>

<pre><code>namespace BLL
{
   public class Bllreceipt
    {
         TblreceiptionDal tr = new TblreceiptionDal();
       public DataTable getdata()
       {
           return tr.getall();
       }
       public string createreceipt(int recept_id,int kala_id,int suplier_id,int recept_qty ,DateTime recept_date)
       {
           return tr.createreceipt(recept_id, kala_id, suplier_id, recept_qty, recept_date);
       }
       public String deletereceipt(int recept_id)
       {
           return tr.deletereceipt(recept_id);
       }
       public string updatereceipt(int recept_id,int kala_id,int suplier_id,int recept_qty ,DateTime recept_date)
       {
           return tr.updatereceipt(recept_id, kala_id, suplier_id, recept_qty, recept_date);
       }
        public string receptgetbyid(int recept_id)
        {
            return tr.receptgetbyid(recept_id);
        }
    }
}
</code></pre>

<p>kala DAL:</p>

<pre><code>namespace DAL
{
    public class TblkalaDal
    {
        SqlConnection cn=new SqlConnection("Data Source=(local); Initial Catalog=store;Integrated Security=True");
        public DataTable Getdata()
        {
            try
            {
                DataSet ds=new DataSet();
                SqlDataAdapter da = new SqlDataAdapter("Sptblkala_getdata",cn);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.Fill(ds, "Sptblkala_getdata");
                return ds.Tables["Sptblkala_getdata"];
            }
            catch (Exception)
            {
                return null;
                throw;
            }
        }
public string createkala(int kala_id,string kala_name,int kala_qty,int kala_orderpoint)
{
    try
    {
        SqlCommand cmd = new SqlCommand("Sptblkala_insert", cn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@kala_id", kala_id);
        cmd.Parameters.AddWithValue("@kala_name", kala_name);
        cmd.Parameters.AddWithValue("@kala_qty", kala_qty);
        cmd.Parameters.AddWithValue("@kala_orderpoint", kala_orderpoint);
        cn.Open();
        cmd.ExecuteNonQuery();
        cn.Close();
        return "true";
    }
    catch (Exception ex)
    {
        return ex.Message;
        throw;
    }

}
        public string Deletekala(int kala_id)
        {
            try
            {
                SqlCommand dm = new SqlCommand("Sptblkala_delete", cn);
                dm.CommandType = CommandType.StoredProcedure;
                dm.Parameters.AddWithValue("@kala_id", kala_id);
                cn.Open();
                dm.ExecuteNonQuery();
                cn.Close();
                return "true";
            }
            catch (Exception ex)
            {
             return   ex.Message;
                throw;
            }

        }

        public string updatekala(int kala_id,string kala_name,int kala_qty,int kala_orderpoint)
        {
            try
            {
                SqlCommand uk = new SqlCommand("Sptblkala_update", cn);
                uk.CommandType = CommandType.StoredProcedure;
                uk.Parameters.AddWithValue("@kala_id", kala_id);
                uk.Parameters.AddWithValue("@kala_name", kala_name);
                uk.Parameters.AddWithValue("@kala_qty", kala_qty);
                uk.Parameters.AddWithValue("@kala_orderpoint", kala_orderpoint);
                cn.Open();
                uk.ExecuteNonQuery();
                cn.Close();
                return "true";
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
</code></pre>

<p>Kala BLL:</p>

<pre><code>namespace BLL
{
    public class bllkala
    {
        TblkalaDal tk=new TblkalaDal();
        public string createkala(int kala_id,string kala_name,int kala_qty,int kala_orderpoint)
        {
            return tk.createkala(kala_id, kala_name, kala_qty, kala_orderpoint);
        }
        public string deletekala(int kala_id)
        {
            return tk.Deletekala(kala_id);
        }
        public string updatekala(int kala_id,string kala_name,int kala_qty,int kala_orderpoint)
        {
            return tk.updatekala(kala_id, kala_name, kala_qty, kala_orderpoint);
        }
        public DataTable Getdata()
        {
          return  tk.Getdata();
        }
    }
}
</code></pre>
