public void AddCashBank(FundUnit oUnit) { SqlCommand oCommand = new SqlCommand(); oCommand.Connection = this.Connection; oCommand.CommandType = CommandType.StoredProcedure; oCommand.CommandText = "SP_TRANS_INSERT_FUND"; oCommand.Parameters.Add(new SqlParameter("@AccountNumber", oUnit.AccountNumber)); oCommand.Parameters.Add(new SqlParameter("@AccountName", oUnit.AccountName)); oCommand.ExecuteNonQuery(); }
private void btnAdd_Click(object sender, EventArgs e) { FundManager oManager = new FundManager(); FundUnit oUnit = new FundUnit(); oUnit.AccountNumber = txtAccountNo.Text; oUnit.AccountName = txtAccountName.Text; oManager.ConnectionString = this.ConnectionString; oManager.Open(); oManager.AddCashBank(oUnit); oManager.Close(); txtAccountNo.Text = ""; txtAccountName.Text = ""; BindGrid(); }