public int ChangeGrossSales(NewMoneyMade nmm) { SqlConnection connection = new SqlConnection(connectionString); SqlCommand command = new SqlCommand("usp_changeGrossSales"); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@ConsignmentID", nmm.ConsignmentID)); command.Parameters.Add(new SqlParameter("@NewAmount", nmm.NewMoneyMadeString)); command.Connection = connection; connection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(command); DataTable table = new DataTable(); adapter.Fill(table); connection.Close(); if (table.Rows[0][0].ToString() == nmm.NewMoneyMadeString) { return(1); } else { return(0); } }
public void ChangeMoneyMadeTest() { NewMoneyMade nmm = new NewMoneyMade(); nmm.ConsignmentID = GetConsignmentID(); nmm.NewMoneyMadeString = "TESTMONEYMADE2"; int result = controller.ChangeMoneyMade(nmm); Assert.AreEqual(result, 1); }