Ejemplo n.º 1
0
        public ObjectExtensionsTestsFixture SetLevel2Index1Value()
        {
            Item = 123;

            Source = new Level0
            {
                NotNull = new Level1(),
                Null    = null,
                Value   = 1,
                Level1  = new Level1
                {
                    NotNull = new Level2(),
                    Null    = new Level2(),
                    Value   = 1,
                    Level2s = new List <Level2>
                    {
                        new Level2(),
                        new Level2
                        {
                            Value = (int)Item
                        }
                    }
                }
            };

            return(this);
        }
Ejemplo n.º 2
0
        public static void InsertAllListPerson0(Level0 Person, string idRun, SqlConnection connection, SqlTransaction transaction)
        {
            String query = "INSERT INTO dbo.Level0(IdRun,IdPlate,NumPlate,SampleName,Pos,Id,Or260280,Type1,IdPos,NgUl,Vol,Comments) " +
                           "VALUES (@IdRun,@IdPlate,@NumPlate,@SampleName,@Pos,@Id,@Or260280,@Type,@IdPos,@NgUl,@Vol,@Comments);";

            using (SqlCommand command = new SqlCommand(query, connection, transaction))
            {
                command.Parameters.AddWithValue("@IdRun", idRun);
                command.Parameters.AddWithValue("@IdPlate", Person.IdPlate);
                command.Parameters.AddWithValue("@NumPlate", Person.NumPlate);
                command.Parameters.AddWithValue("@SampleName", Person.SampleName);
                command.Parameters.AddWithValue("@Pos", Person.Pos);
                command.Parameters.AddWithValue("@Id", Person.Id);
                command.Parameters.AddWithValue("@Or260280", Person.Or260280);
                command.Parameters.AddWithValue("@Type", Person.Type);
                command.Parameters.AddWithValue("@IdPos", Person.IdPos);
                command.Parameters.AddWithValue("@NgUl", Person.NgUl);
                command.Parameters.AddWithValue("@Vol", Person.Vol);
                command.Parameters.AddWithValue("@Comments", Person.Comments);
                var result = command.ExecuteNonQuery();
                //command.CommandText = "SELECT @@IDENTITY";// SCOPE_IDENTITY()
                //var IdList = long.Parse(command.ExecuteScalar().ToString());
                //InsertOneRowListPerson(Person.ListPerson, IdList, connection, transaction);

                if (result < 0)
                {
                    Console.WriteLine("Error inserting data into Database!");
                }
            }
        }
Ejemplo n.º 3
0
        public ObjectExtensionsTestsFixture SetLevel3()
        {
            Item = new Level3();

            Source = new Level0
            {
                NotNull = new Level1(),
                Null    = null,
                Value   = 1,
                Level1  = new Level1
                {
                    NotNull = new Level2(),
                    Null    = null,
                    Value   = 1,
                    Level2  = new Level2
                    {
                        NotNull = new Level3(),
                        Null    = null,
                        Value   = 1,
                        Level3  = (Level3)Item
                    }
                }
            };

            return(this);
        }
 // Update is called once per frame
 void Update()
 {
     curr_pos = transform.position;
     //stop IP at firewall if it has been blocked
     if (Level0.helper(gameObject.name))
     {
         if (curr_pos.x < 519 || curr_pos.x > 521)
         {
             transform.Translate(speed, 0, 0);
             if (curr_pos.x >= 1200)
             {
                 transform.position = new Vector3(-1000, curr_pos.y, curr_pos.z);
             }
         }
         else
         {
             transform.Translate(0, 0, 0);
         }
     }
     else if (curr_pos.x >= 1200)
     {
         transform.position = new Vector3(-1000, curr_pos.y, curr_pos.z);
     }
     else
     {
         transform.Translate(speed, 0, 0);
     }
 }
Ejemplo n.º 5
0
        public static void InsertParameterForBarcodePlate(OleDbConnection con, OleDbCommand cmd, OleDbDataReader Reader, string barcodeP, int countP, List <Level0> lp)
        {
            strSQL = "select * from Rikuz WHERE PlateBC=@IdPlate";
            cmd    = new OleDbCommand(strSQL, con);
            cmd.Parameters.AddWithValue("@IdPlate", barcodeP);
            Reader = cmd.ExecuteReader();
            while (Reader.Read())
            {
                var l = new Level0();
                l.NumPlate   = "P" + countP;
                l.IdPlate    = Reader["PlateBC"].ToString();
                l.Or260280   = float.Parse(Reader["260/280"].ToString());
                l.Comments   = Reader["Comments"].ToString();
                l.Type       = Reader["Type"].ToString();
                l.IdPos      = int.Parse(Reader["Position"].ToString());
                l.NgUl       = float.Parse(Reader["ng/ul"].ToString());
                l.Vol        = int.Parse(Reader["Vol"].ToString());
                l.SampleName = Reader["LabNum"].ToString().Equals("NTC") ? (countP == 1 ? "SUP-NGS1" : (countP == 2 ? "NTC1" : (countP == 3 ? "SUP-NGS2" : (countP == 4 ? "NTC2" :
                                                                                                                                                            throw new Exception("sample name is 'NTC' and has not name Plate")
                                                                                                                                                            )))) : Reader["LabNum"].ToString();
                l.Pos = Reader["Loc"].ToString();
                l.Id  = long.Parse(Reader["ID"].ToString());

                lp.Add(l);
            }
        }
Ejemplo n.º 6
0
        public override GameObject Clone()
        {
            var go = new Enemy(Name, FormattedName, CharacterName, (int)BaseWidth, (int)BaseHeight)
            {
                CurrentSprite = CurrentSprite,
                Name          = Name,
                X             = X,
                Y             = Y,
                FormattedName = FormattedName,
                CharacterName = CharacterName,
                Level0        = Level0.Clone(),
                BounceTime    = BounceTime,
                BounceSpeed   = BounceSpeed,
                HitBoxOffSet  = HitBoxOffSet.ToDictionary(x => x.Key, x => x.Value),
                HitBoxSize    = HitBoxSize.ToDictionary(x => x.Key, x => x.Value)
            };

            if (Animations != null)
            {
                go.Animations = new Dictionary <string, Animation>(Animations.Count);
                foreach (var animKey in Animations.Keys)
                {
                    go.Animations[animKey]       = Animations[animKey].Clone();
                    go.Animations[animKey].Owner = go;
                }
            }
            go.CurrentAnimation = CurrentAnimation;
            go.LevelCheck();
            return(go);
        }
        public LevelManager(int _levelid, ContentManager _content, GraphicsDevice _graphicDevice, UI.ScoreBoard _scoreBoard)
        {
            levelid = _levelid;
            Content = _content;
            graphicDevice = _graphicDevice;
            scoreBoard = _scoreBoard;

            level0 = new Level0(graphicDevice, "level0.gleed");
        }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     // levelScreen();
     Destroy(Level_0, 3);
     Destroy(blackoutScreen, 3);
     Instance = this;
     inputfield.ActivateInputField();
     chat();
     chatbutton.onClick.AddListener(() => chat());
     manualbutton.onClick.AddListener(() => manual());
     inputfield.ActivateInputField();
 }
Ejemplo n.º 9
0
        public static List <Level0> SelectAllListPersonForIdFile(string idPlate)
        {
            var           lp     = new List <Level0>();
            SqlConnection con    = null;
            SqlDataReader Reader = null;

            try
            {
                con = new SqlConnection(connectionString);
                con.Open();
                SqlCommand cmd    = null;
                var        strSQL = "select * from dbo.Level0 WHERE IdPlate=@IdPlate";
                cmd = new SqlCommand(strSQL, con);
                cmd.Parameters.AddWithValue("@IdPlate", idPlate);
                Reader = cmd.ExecuteReader();
                while (Reader.Read())
                {
                    var p = new Level0();
                    p.Id         = long.Parse(Reader["Id"].ToString());
                    p.IdPlate    = Reader["IdPlate"].ToString();
                    p.NumPlate   = Reader["NumPlate"].ToString();
                    p.SampleName = Reader["SampleName"].ToString();
                    p.Pos        = Reader["Pos"].ToString();
                    p.Or260280   = float.Parse(Reader["Or260280"].ToString());
                    p.NgUl       = float.Parse(Reader["NgUl"].ToString());
                    p.Vol        = int.Parse(Reader["Vol"].ToString());
                    p.Type       = Reader["Type1"].ToString();
                    p.Comments   = Reader["Comments"].ToString();
                    p.IdPos      = int.Parse(Reader["IdPos"].ToString());
                    lp.Add(p);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (Reader != null)
                {
                    Reader.Close();
                }
                if (con != null)
                {
                    con.Close();
                }
            }
            return(lp);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// The constructor for the GameplayScreen
        /// </summary>
        public GameplayScreen(Game game)
        {
            TransitionOnTime  = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            _pauseAction = new InputAction(
                new[] { Buttons.Start, Buttons.Back },
                new[] { Keys.Back, Keys.Escape }, true);

            _game = game;

            level0 = new Level0(_game);//ScreenManager.Game);
            level1 = new Level1();
            level2 = new Level2();
        }
Ejemplo n.º 11
0
        public ObjectExtensionsTestsFixture SetLevel1Value()
        {
            Item = 123;

            Source = new Level0
            {
                NotNull = new Level1(),
                Null    = null,
                Value   = 1,
                Level1  = new Level1
                {
                    Value = (int)Item
                }
            };

            return(this);
        }
Ejemplo n.º 12
0
        public ObjectExtensionsTestsFixture SetLevel1Index1()
        {
            Item = new Level1();

            Source = new Level0
            {
                NotNull = new Level1(),
                Null    = null,
                Value   = 1,
                Level1s = new List <Level1>
                {
                    new Level1(),
                    (Level1)Item
                }
            };

            return(this);
        }
Ejemplo n.º 13
0
        public void ChangeLevel(int id)
        {
            levelid = id;
            soundStopped = false;
            gdReset = true;
            switch (levelid)
            {
                case 0:
                    {
                        level0 = new Level0(graphicDevice, "level0.gleed");
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;
                    }
                    break;
                case 1:
                    {
                        level0 = null;
                        level1 = new Level1(graphicDevice, "level1.gleed");
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;
                    }
                    break;
                case 2:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = new Level2(graphicDevice, "level2.gleed");
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 3:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = new Level3(graphicDevice, "level3.gleed");
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 4:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = new Level4(graphicDevice, "level4.gleed");
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 5:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = new Level5(graphicDevice, "level5.gleed");
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 6:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = new Level6(graphicDevice, "level6.gleed");
                        level7 = null;

                    }
                    break;
                case 7:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = new Level7(graphicDevice, "Level7.gleed");

                    }
                    break;

                default: break;
            }
        }
Ejemplo n.º 14
0
        public static List <Level0> SelectIfSampleinLevel0(string IdCantrige, List <PersonLevel1> list1)
        {
            SqlConnection con    = null;
            var           lp     = new List <Level0>();
            SqlDataReader Reader = null;
            SqlCommand    cmd    = null;

            try
            {
                var strSQL = "select * from dbo.Level0 WHERE SampleName=@SampleName and IdRun=@IdCantrige";
                con = new SqlConnection(connectionString);
                con.Open();

                foreach (var sample in list1)
                {
                    cmd = new SqlCommand(strSQL, con);
                    cmd.Parameters.AddWithValue("@IdCantrige", IdCantrige);
                    cmd.Parameters.AddWithValue("@SampleName", sample.Name);
                    Reader = cmd.ExecuteReader();
                    if (Reader.HasRows)
                    {
                        while (Reader.Read())
                        {
                            var p = new Level0();
                            p.Id         = long.Parse(Reader["Id"].ToString());
                            p.IdPlate    = Reader["IdPlate"].ToString();
                            p.NumPlate   = Reader["NumPlate"].ToString();
                            p.SampleName = Reader["SampleName"].ToString();
                            p.Pos        = Reader["Pos"].ToString();
                            p.Or260280   = float.Parse(Reader["Or260280"].ToString());
                            p.NgUl       = float.Parse(Reader["NgUl"].ToString());
                            p.Vol        = int.Parse(Reader["Vol"].ToString());
                            p.Type       = Reader["Type1"].ToString();
                            p.Comments   = Reader["Comments"].ToString();
                            p.IdPos      = int.Parse(Reader["IdPos"].ToString());
                            lp.Add(p);
                            //  return Reader["SampleName"].ToString();
                        }
                        //cmd.Clone();
                        //Reader.Close();
                    }
                    else
                    {
                        SamplesNotInStep1 += sample.Name + " , ";
                    }
                    Reader.Close();
                    //else { throw new Exception("the samples : " + sample.Name +" , " + "not in step 1 "); }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (Reader != null)
                {
                    Reader.Close();
                }
                if (con != null)
                {
                    con.Close();
                }
            }
            return(lp);
        }
Ejemplo n.º 15
0
 public ObjectExtensionsTestsFixture()
 {
     Source = new Level0();
     Item   = new object();
 }