public int AddCriteria(CriteriaFAHP criteria, string matrix, int sessionid) { using (var connection = new SqlConnection(_connectionString)) { var command = connection.CreateCommand(); command.CommandText = "FAHPAddCriteria"; command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter { ParameterName = "@CriteriaName", Value = criteria.CriteriaName, SqlDbType = SqlDbType.NVarChar, Direction = ParameterDirection.Input }); command.Parameters.Add(new SqlParameter { ParameterName = "@MatrixAlt", Value = matrix, SqlDbType = SqlDbType.NVarChar, Size = 500, Direction = ParameterDirection.Input }); command.Parameters.Add(new SqlParameter { ParameterName = "@SessionID", Value = sessionid, SqlDbType = SqlDbType.Int, Direction = ParameterDirection.Input }); var id = new SqlParameter { ParameterName = "@CriteriaID", SqlDbType = SqlDbType.Int, Direction = ParameterDirection.Output }; command.Parameters.Add(id); connection.Open(); command.ExecuteNonQuery(); return((int)id.Value); } }
public int AddCriteria(CriteriaFAHP criteria, string matrix, int sessionid) => _fahpDao.AddCriteria(criteria, matrix, sessionid);