示例#1
0
    public Batch getBatch(Batch batch)
    {
        if (Authenticated_AorC())
        {
            try
            {
                Movement.Database.TestBatch test = new Movement.Database.TestBatch(batch.batchID);
                Batch newBatch = new Batch();
                newBatch.batchID     = test.TestBatchID;
                newBatch.description = test.Description;
                newBatch.name        = test.Name;
                //newBatch.scripts = test.TestScripts;

                return(newBatch);
            }
            catch (Exception e)
            {
                Log(e);
                return(new Batch());
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
    public Batch getBatch(Batch batch)
    {
        if (Authenticated_AorC())
        {
            try
            {
                Movement.Database.TestBatch test = new Movement.Database.TestBatch(batch.batchID);
                Batch newBatch = new Batch();
                newBatch.batchID = test.TestBatchID;
                newBatch.description = test.Description;
                newBatch.name = test.Name;
                //newBatch.scripts = test.TestScripts;

                return newBatch;
            }
            catch (Exception e)
            {
                Log(e);
                return new Batch();
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }