Ejemplo n.º 1
0
 public ActionResult Editer(Gaming.Jeu jeu)
 {
     Jeux jeux = new Jeux(Session["DB_REPO"]);
     if (ModelState.IsValid)
     {
         if (jeux.SelectByID(jeu.Id))
         {
             //Le même nom
             String sql = "SELECT * from jeux where Nom='" + jeu.Nom.ToString() + "'";
             jeux.QuerySQL(sql);
             if (jeux.Next())
             {
                 // Vérifier si c'est pas moi-même
                 jeux.SelectByID(jeu.Id);
                 if (jeux.jeu.Nom != jeu.Nom)
                 {
                     ViewBag.Erreur = "Un jeu possède déja ce nom";
                     return View(jeu);
                 }
             }
             try
             {
                 jeux.jeu = jeu;
                 jeux.jeu.UpLoadImage(Request);
                 jeux.Update();
                 return RedirectToAction("Lister", "Jeux");
             }
             catch
             {
                 ViewBag.Erreur = "Une erreur lors de l'update! Avez-vous une image?";
             }
         }
     }
     return View(jeu);
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            /*
             * Rolling test = new Rolling();
             * for(int i = 0; i < 11;  i++)
             * {
             *  Dice[] dices = test.roll_dices();
             *  Console.WriteLine(dices[0].value + " " + dices[1].value);
             * }
             *
             * Tokens_list test2 = new Tokens_list();
             * test2.choose_token();
             * test2.choose_token();
             * test2.choose_token();
             *
             *
             * Card_draw test3 = new Card_draw(2, "Chance");
             * test3.read_all_card_desc();
             *
             * Board test4 = new Board();
             */
            Gaming theGame = new Gaming();

            theGame.launch();
        }
Ejemplo n.º 3
0
        public ActionResult Ajouter(Gaming.Personne personne)
        {
            if (ModelState.IsValid)
            {
                Personnes personnes = new Personnes(Session["DB_REPO"]);

                String sql = "SELECT * from Personnes where Prenom='" + personne.Prenom.ToString() + "'";
                personnes.QuerySQL(sql);
                // Le même prenom
                if(personnes.Next())
                {
                    //Le même nom
                    sql = "SELECT * from Personnes where Nom='" + personne.Nom.ToString() + "'";
                    personnes.QuerySQL(sql);
                    if (personnes.Next())
                    {
                        ViewBag.Erreur = "Un gamer possède déja ce nom et prénom";
                        return View(personne);
                    }
                }

                // Tout est valide
                personnes.personne = personne;
                personnes.personne.UpLoadImage(Request);
                personnes.Insert();
                return RedirectToAction("Lister", "Personnes");
            }
            return View(personne);
        }
Ejemplo n.º 4
0
 void Awake()
 {
     INSTANCE = this;
     canvas   = (GameObject)GameObject.Find("Canvas");
     UIManager.INSTANCE.loadGaming();
     gaming = UIManager.INSTANCE.gaming.GetComponent <Gaming> ();
     UIManager.INSTANCE.gaming.gameObject.SetActive(false);
 }
Ejemplo n.º 5
0
        public static void Factory()
        {
            var g = new Gaming();
            var b = new Business();

            foreach (var item in g.stuff)
            {
                System.Console.WriteLine(item.GetType().FullName);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="ga"></param>
        /// <returns></returns>
        public static int AddDAL(Gaming ga)
        {
            string str = "INSERT INTO dbo.Play(pname, pgs, pje, gid)VALUES(@pname, @pgs, @pje, @gid)";

            SqlParameter[] pa = new SqlParameter[] {
                new SqlParameter("@pname", ga.Pname),
                new SqlParameter("@pgs", ga.Pgs),
                new SqlParameter("@pje", ga.Pje),
                new SqlParameter("@gid", ga.Gid),
            };
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, str, pa));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="ga"></param>
        /// <returns></returns>
        public static int ModificationDAL(Gaming ga)
        {
            string str = "UPDATE dbo.Play SET  pname=@pname, pgs=@pgs, pje=@pje, gid=@gid where pid=@pid";

            SqlParameter[] pa = new SqlParameter[] {
                new SqlParameter("@pname", ga.Pname),
                new SqlParameter("@pgs", ga.Pgs),
                new SqlParameter("@pje", ga.Pje),
                new SqlParameter("@gid", ga.Gid),
                new SqlParameter("@pid", ga.Pid)
            };
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, str, pa));
        }
Ejemplo n.º 8
0
        public ActionResult Ajouter(Gaming.UnLienListe unLienListe,string radioJeu, string radioPersonne)
        {
            if (ModelState.IsValid)
            {
                Liste liste = new Liste(Session["DB_REPO"]);
                //liste.unLienListe.IdJeu = Int64.Parse(unLienListe.IdJeu.ToString());
                //liste.unLienListe.IdPersonne = Int64.Parse(unLienListe.IdPersonne.ToString());

                liste.SelectLink(radioPersonne, radioJeu);

                // Si c'est true, c'est pcq le lien existe déja
                if (liste.Next())
                {
                    ViewBag.Erreur = "Ce joueur est déja marqué comme jouant à ce jeu.";
                    liste.unLienListe.IdJeu = Int64.Parse(radioJeu);
                    liste.unLienListe.IdPersonne = Int64.Parse(radioPersonne);
                    return View(unLienListe);
                }
                else
                {
                    if (radioJeu == null || radioJeu == "" || radioPersonne == null || radioPersonne == "")
                    {
                        ViewBag.Erreur = "Un ou plusieurs boutons n'étaient pas cochés.";
                        liste.unLienListe.IdJeu = 0;
                        liste.unLienListe.IdPersonne = 0;
                        return View(unLienListe);
                    }

                    liste.unLienListe.IdJeu = Int64.Parse(radioJeu);
                    liste.unLienListe.IdPersonne = Int64.Parse(radioPersonne);

                    //liste.liste = liste;
                    try
                    {
                        liste.Insert();
                    }
                    catch
                    {
                        ViewBag.Erreur = "Une erreur lors de l'insertion";
                        return View(unLienListe);
                    }

                    return RedirectToAction("Lister", "Liste");
                }
            }
            return View(unLienListe);
        }
Ejemplo n.º 9
0
        public ActionResult Editer(Gaming.Personne personne)
        {
            Personnes personnes = new Personnes(Session["DB_REPO"]);
            if (ModelState.IsValid)
            {
                if (personnes.SelectByID(personne.Id))
                {
                    String sql = "SELECT * from Personnes where Prenom='" + personne.Prenom.ToString() + "'";
                    personnes.QuerySQL(sql);
                    // Le même prenom
                    if (personnes.Next())
                    {
                        //Le même nom
                        sql = "SELECT * from Personnes where Nom='" + personne.Nom.ToString() + "'";
                        personnes.QuerySQL(sql);
                        if (personnes.Next())
                        {
                            // Vérifier si c'est pas moi-même
                            personnes.SelectByID(personne.Id);
                            if (personnes.personne.Prenom != personne.Prenom ||
                                personnes.personne.Nom != personne.Nom)
                            {
                                ViewBag.Erreur = "Un gamer possède déja ce nom et prénom";
                                return View(personne);
                            }
                        }
                    }
                    try
                    {
                        personnes.personne = personne;
                        personnes.personne.UpLoadImage(Request);
                        personnes.Update();
                        return RedirectToAction("Lister", "Personnes");
                    }
                    catch
                    {
                        ViewBag.Erreur = "Une erreur lors de l'update! Avez-vous une image?";
                    }

                }
            }
            return View(personne);
        }
Ejemplo n.º 10
0
        public ActionResult Ajouter(Gaming.Jeu jeu)
        {
            if (ModelState.IsValid)
            {
                Jeux jeux = new Jeux(Session["DB_REPO"]);

                String sql = "SELECT * from jeux where Nom='" + jeu.Nom.ToString() + "'";
                jeux.QuerySQL(sql);
                // Le même nom
                if (jeux.Next())
                {
                    ViewBag.Erreur = "Un jeu possède déja ce nom";
                    return View(jeu);
                }

                // Si tout est valide
                jeux.jeu = jeu;
                jeux.jeu.UpLoadImage(Request);
                jeux.Insert();
                return RedirectToAction("Lister", "Jeux");
            }
            return View(jeu);
        }
Ejemplo n.º 11
0
        private void btnxg_Click(object sender, EventArgs e)
        {
            try
            {
                Gaming ga = new Gaming();

                ga.Pgs = txtgs.Text.Trim();
                ga.Pname = txtname.Text.Trim();
                ga.Pje = Convert.ToInt32(txtqian.Text.Trim());
                ga.Gid = Convert.ToInt32(cmbyxlx.SelectedValue);
                ga.Pid = Convert.ToInt32(txtpid.Text.Trim());

                GameBLL.AddBLL(ga);

                getShow();
                MessageBox.Show("修改成功");
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 12
0
        public ActionResult Editer(Gaming.UnLienListe unLienListe, string radioJeu, string radioPersonne)
        {
            Liste liste = new Liste(Session["DB_REPO"]);
            if (ModelState.IsValid)
            {
                if (liste.SelectByID(unLienListe.Id))
                {
                    liste.SelectLink(radioPersonne, radioJeu);

                    // Si c'est true, c'est pcq le lien existe déja
                    if (liste.Next())
                    {
                        ViewBag.Erreur = "Ce joueur est déja marqué comme jouant à ce jeu.";
                        unLienListe.IdJeu = Int64.Parse(radioJeu);
                        unLienListe.IdPersonne = Int64.Parse(radioPersonne);
                        return View(unLienListe);
                    }
                    else
                    {
                        liste.unLienListe.IdJeu = Int64.Parse(radioJeu);
                        liste.unLienListe.IdPersonne = Int64.Parse(radioPersonne);
                        try
                        {
                            liste.Update();
                        }
                        catch
                        {
                            ViewBag.Erreur = "Une erreur lors de l'update";
                            return View(unLienListe);
                        }
                        return RedirectToAction("Lister", "Liste");
                    }

                }
            }
            return View(unLienListe);
        }
Ejemplo n.º 13
0
    void Start()
    {
        _createfood.enabled = false;
        _createitems.enabled = false;
        _createweather.enabled = false;

        //初始化狀態機
        Prepare _p = new Prepare();
        Gaming _g = new Gaming();
        EndingPrepare _ep = new EndingPrepare();
        GameEnd _e = new GameEnd();

        _p.AddTransition(_g, "GoGaming");
        _g.AddTransition(_ep, "GoPrepareEnd");
        _ep.AddTransition(_e, "GoEnd");

        AddState(_p, "PrepareGame");
        AddState(_g, "Gaming");
        AddState(_ep, "PrepareEnd");
        AddState(_e, "TheEnd");

        InitFSM();
    }
Ejemplo n.º 14
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="ga"></param>
 /// <returns></returns>
 public static int ModificationBLL(Gaming ga)
 {
     return(GameDAL.ModificationDAL(ga));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="ga"></param>
 /// <returns></returns>
 public static int AddBLL(Gaming ga)
 {
     return(GameDAL.AddDAL(ga));
 }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            int pilih;

            do
            {
                Console.WriteLine("\n======== Toko Laptop & Komputer Awan ========\n");
                Console.WriteLine("Barang apa yang ingin anda beli : ");
                Console.WriteLine("1. Laptop ");
                Console.WriteLine("2. Komputer ");
                Console.WriteLine("3. Keluar ");
                Console.WriteLine("Masukan Pilihan Anda [1/2]  = ");
                pilih = Convert.ToInt32(Console.ReadLine());

                if (pilih == 1)
                {
                    Console.WriteLine("\n======== Laptop Toko Awan ========\n");
                    Console.WriteLine("Laptop apa yang ingin ingin anda beli : ");
                    Console.WriteLine("1. Acer ");
                    Console.WriteLine("2. Asus");
                    Console.WriteLine("3. Lenovo \n");
                    Console.WriteLine("Masukan Pilihan Anda [1-3]  = ");
                    int pilihlaptop = Convert.ToInt32(Console.ReadLine());

                    if (pilihlaptop == 1)
                    {
                        // Laptop Acer
                        Acer myAcer = new Acer();
                        myAcer.BeliLaptop();
                        myAcer.beliL();
                    }

                    else if (pilihlaptop == 2)
                    {
                        // Laptop Asus
                        Asus myAsus = new Asus();
                        myAsus.BeliLaptop();
                        myAsus.beliL();
                    }

                    else if (pilihlaptop == 3)
                    {
                        // Laptop Lenovo
                        Lenovo myLenovo = new Lenovo();
                        myLenovo.BeliLaptop();
                        myLenovo.beliL();
                    }

                    else
                    {
                        Console.WriteLine("Maaf Pilihan Tidak Tersedia");
                    }
                }

                else if (pilih == 2)
                {
                    Console.WriteLine("\n======== Komputer Toko Awan ========\n");
                    Console.WriteLine("Komputer apa yang ingin ingin anda beli : ");
                    Console.WriteLine("1. Komputer Biasa ");
                    Console.WriteLine("2. Komputer Gaming");
                    Console.WriteLine("3. Komputer VideoEditing \n");
                    Console.WriteLine("Masukan Pilihan Anda [1-3]  = ");
                    int pilihkomputer = Convert.ToInt32(Console.ReadLine());

                    if (pilihkomputer == 1)
                    {
                        Biasa myBiasa = new Biasa();
                        myBiasa.BeliKomputer();
                    }

                    else if (pilihkomputer == 2)
                    {
                        Gaming myGaming = new Gaming();
                        myGaming.BeliKomputer();
                    }

                    else if (pilihkomputer == 3)
                    {
                        VideoEditing myVideoEditing = new VideoEditing();
                        myVideoEditing.BeliKomputer();
                    }

                    else
                    {
                        Console.WriteLine("Maaf Pilihan Tidak Tersedia");
                    }
                }
            }while(pilih != 3);
        }
Ejemplo n.º 17
0
        public static void FactoryofFactories()
        {
            var g = n.Instance <Gaming>();

            var c = new Gaming();
        }
Ejemplo n.º 18
0
        public readonly long QUIZ_TIME = 120 * 1000; // 120 sec.

        public QuizController()
        {
            Authenticator = new Authenticator();
            Gaming        = new Gaming();
            EventLogger   = new EventLogger();
        }
Ejemplo n.º 19
0
        private Card RandomCard(Vector2 position, bool front, int playerID)
        {
            Card c = null;

            if (Globals.r.Next(4) == 0)
            {
                int cardsCount = 31;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Actor(position, front, playerID);
                    break;

                case 1:
                    c = new Artist(position, front, playerID);
                    break;

                case 2:
                    c = new Astrophysicist(position, front, playerID);
                    break;

                case 3:
                    c = new Babysitter(position, front, playerID);
                    break;

                case 4:
                    c = new BabysitterU(position, front, playerID);
                    break;

                case 5:
                    c = new BusDriver(position, front, playerID);
                    break;

                case 6:
                    c = new Conman(position, front, playerID);
                    break;

                case 7:
                    c = new DeliveryPerson(position, front, playerID);
                    break;

                case 8:
                    c = new DrugDealer(position, front, playerID);
                    break;

                case 9:
                    c = new FastFoodEmployee(position, front, playerID);
                    break;

                case 10:
                    c = new Hacker(position, front, playerID);
                    break;

                case 11:
                    c = new Hitman(position, front, playerID);
                    break;

                case 12:
                    c = new HumanTrafficker(position, front, playerID);
                    break;

                case 13:
                    c = new IndieGameDev(position, front, playerID);
                    break;

                case 14:
                    c = new Influencer(position, front, playerID);
                    break;

                case 15:
                    c = new InstaModel(position, front, playerID);
                    break;

                case 16:
                    c = new InternDev(position, front, playerID);
                    break;

                case 17:
                    c = new JuniorDev(position, front, playerID);
                    break;

                case 18:
                    c = new Musician(position, front, playerID);
                    break;

                case 19:
                    c = new OnlyFans(position, front, playerID);
                    break;

                case 20:
                    c = new Referee(position, front, playerID);
                    break;

                case 21:
                    c = new RiceFarmer(position, front, playerID);
                    break;

                case 22:
                    c = new Santa(position, front, playerID);
                    break;

                case 23:
                    c = new Shelfstacker(position, front, playerID);
                    break;

                case 24:
                    c = new Shoplifter(position, front, playerID);
                    break;

                case 25:
                    c = new Sporter(position, front, playerID);
                    break;

                case 27:
                    c = new Streamer(position, front, playerID);
                    break;

                case 28:
                    c = new SugarDaddy(position, front, playerID);
                    break;

                case 29:
                    c = new TaxiDriver(position, front, playerID);
                    break;

                case 30:
                    c = new Writer(position, front, playerID);
                    break;

                case 26:
                    c = new YogaInstructor(position, front, playerID);
                    break;
                }
            }
            else
            {
                int cardsCount = 12;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Alcohol(position, front, playerID);
                    break;

                case 1:
                    c = new Drugs(position, front, playerID);
                    break;

                case 2:
                    c = new EatingOut(position, front, playerID);
                    break;

                case 3:
                    c = new FastFood(position, front, playerID);
                    break;

                case 4:
                    c = new Gambling(position, front, playerID);
                    break;

                case 5:
                    c = new Gaming(position, front, playerID);
                    break;

                case 6:
                    c = new Joint(position, front, playerID);
                    break;

                case 7:
                    c = new PomXML(position, front, playerID);
                    break;

                case 8:
                    c = new Shopping(position, front, playerID);
                    break;

                case 9:
                    c = new Smoking(position, front, playerID);
                    break;

                case 10:
                    c = new SocialMedia(position, front, playerID);
                    break;

                case 11:
                    c = new Streaming(position, front, playerID);
                    break;
                }
            }

            return(c);
        }