Inheritance: MonoBehaviour
Exemplo n.º 1
0
    public int NuevoTest(myTest a)
    {
        int           res = 0;
        SqlConnection cnn = new SqlConnection(cadenaConection);

        try
        {
            cnn.Open();
            SqlCommand cmd = new SqlCommand("spInsertTest", cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@pName", a.Nombre);
            res = cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            throw new Exception("Error to insert the record", ex);
        }
        finally
        {
            cnn.Close();
        }


        return(res);
    }
Exemplo n.º 2
0
Arquivo: test.cs Projeto: mono/gert
	static int Main (string [] args)
	{
		myTest test = new myTest ();
		if (test.Read () != 1)
			return 1;
		return 0;
	}
Exemplo n.º 3
0
    IEnumerator Start()
    {
        int loopCount = 1000 * 1000;

        loopCount = 10000 * 100000;
        //loopCount = 10000;

        var test  = new myTest();
        var iTest = test as ITest;
        int sum   = 0;

        yield return(new WaitForSeconds(1));

        CpuProfilerBase(
            () => {
            for (int i = 0; i < loopCount; ++i)
            {
            }
        }
            );

        yield return(new WaitForSeconds(1));

        CpuProfiler("value...",
                    () => {
            for (int i = 0; i < loopCount; ++i)
            {
                sum = test.value;
            }
        }
                    );

        yield return(new WaitForSeconds(1));

        CpuProfiler("normalProperty...",
                    () => {
            for (int i = 0; i < loopCount; ++i)
            {
                sum = test.normalProperty;
            }
        }
                    );

        yield return(new WaitForSeconds(1));

        CpuProfiler("virtualProperty...",
                    () => {
            for (int i = 0; i < loopCount; ++i)
            {
                sum = iTest.virtualProperty;
            }
        }
                    );
    }
Exemplo n.º 4
0
    IEnumerator Start () {
        int loopCount = 1000 * 1000;
        loopCount = 10000 * 100000;
        //loopCount = 10000;

        var test = new myTest();
        var iTest = test as ITest;
        int sum = 0;
        
        yield return new WaitForSeconds(1);

        CpuProfilerBase(
            () => {
                for (int i = 0; i < loopCount; ++i) {
                }
            }
        );

        yield return new WaitForSeconds(1);

        CpuProfiler("value...", 
            () => {
                for (int i = 0; i < loopCount; ++i) {
                    sum = test.value;
                }
            }
        );

        yield return new WaitForSeconds(1);

        CpuProfiler("normalProperty...", 
            () => {
                for (int i = 0; i < loopCount; ++i) {
                    sum = test.normalProperty;
                }
            }
        );

        yield return new WaitForSeconds(1);

        CpuProfiler("virtualProperty...", 
            () => {
                for (int i = 0; i < loopCount; ++i) {
                    sum = iTest.virtualProperty;
                }
            }
        );
    }
Exemplo n.º 5
0
    public List <myTest> ListarTest(string id)
    {
        SqlConnection cnn = new SqlConnection(cadenaConection);
        List <myTest> l   = new List <myTest>();
        myTest        mt  = null;

        try
        {
            cnn.Open();
            SqlCommand cmd = new SqlCommand("spListTest", cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@pName", id);
            SqlDataReader r = cmd.ExecuteReader();

            if (r.HasRows)
            {
                while (r.Read())
                {
                    mt        = new myTest();
                    mt.Id     = r.GetInt32(0);
                    mt.Nombre = r.GetString(1);
                    l.Add(mt);
                }
            }
        }
        catch (Exception ex)
        {
            l = null;
            throw new Exception("Error to insert the record", ex);
        }
        finally
        {
            cnn.Close();
        }

        return(l);
    }