Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        Manage     = GameObject.Find("Manage").GetComponent <Manage>();
        Clickaudio = GameObject.Find("Clickaudio").GetComponent <AudioSource>();
        if (Particle != null)
        {
            Buyaudio = GameObject.Find("Buyaudio").GetComponent <AudioSource>();
        }
        Myimage = GetComponent <Image>();
        if (Checksoundsprite == true)
        {
            Menuaudio = GameObject.Find("Menuaudio").GetComponent <AudioSource>();
            Showsoundsprite();
        }

        if (PlayerLock != null)
        {
            Unlockplayer = PlayerPrefs.GetInt("Unlockplayer" + Buttonnumber, Unlockplayer);
            Checkmylock();
        }
        else if (SunglassLock != null)
        {
            UnlockSunglass = PlayerPrefs.GetInt("UnlockSunglass" + Buttonnumber, UnlockSunglass);
            Checkmylock();
        }
        else if (CapLock != null)
        {
            UnlockCap = PlayerPrefs.GetInt("UnlockCap" + Buttonnumber, UnlockCap);
            Checkmylock();
        }

        if (Mymenu != null)
        {
            Menu = Mymenu.GetComponent <Menu>();
        }
    }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        Manage    = GameObject.Find("Manage").GetComponent <Manage>();
        Birdaudio = GameObject.Find("Birdaudio" + (Random.Range(1, 4))).GetComponent <AudioSource>();

        mycollider = GetComponent <Collider2D>();

        if (GetComponent <Animator>() != null)
        {
            Anim = GetComponent <Animator>();
        }
        if (Jump == true)
        {
            if (transform.position.x <= 0)
            {
                transform.localScale = new Vector3(-1, 1, 1);
            }
            if (GetComponent <Animator>() != null)
            {
                Anim.SetInteger("Bird", 1);
            }
            transform.GetComponent <Rigidbody2D>().velocity = new Vector3(MoveRight, MoveUp);
        }
    }
    void Start()
    {
        x = transform.position.x;
        y = transform.position.y;
        m = Manage.instance;
        int rnd = Random.Range(0, 6);

        switch (rnd)
        {
        case (int)Colors.Yellow:
            c = new Color32(234, 191, 27, 255);
            break;

        case (int)Colors.Orange:
            c = new Color32(226, 124, 38, 255);
            break;

        case (int)Colors.Red:
            c = new Color32(227, 74, 59, 255);
            break;

        case (int)Colors.Green:
            c = new Color32(68, 185, 109, 255);
            break;

        case (int)Colors.Purple:
            c = new Color32(148, 88, 164, 255);
            break;

        case (int)Colors.Blue:
            c = new Color32(51, 148, 209, 255);
            break;
        }

        this.gameObject.transform.GetChild(0).GetComponent <SpriteRenderer>().color = c;
    }
Exemple #4
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        int i = int.Parse(DropDownList2.SelectedValue);

        if (i == 0)
        {
            j = "JudgeLow";
            GridView1.DataSource = Manage.ShowData(j);
            GridView1.DataBind();
        }

        if (i == 1)
        {
            j = "JudgeMid";
            GridView1.DataSource = Manage.ShowData(j);
            GridView1.DataBind();
        }
        if (i == 2)
        {
            j = "JudgeHigh";
            GridView1.DataSource = Manage.ShowData(j);
            GridView1.DataBind();
        }
    }
Exemple #5
0
        public void Deployment()
        {
            Engine engine = new Engine();
            Logger logger = new Logger(engine);
            Manage manage = new Manage(engine);

            engine.Triggers.Register <TurnAddResources>();

            var field  = engine.Field;
            var player = engine.Chiefs[0];
            var enemy  = engine.Chiefs[1];

            player.Cards.Factory.CreateDefaultHq <HqConsol>();
            enemy.Cards.Factory.CreateDefaultHq <HqStrike>();

            var Medium = player.Cards.Factory.Create <TankMedium>();
            var Heavy  = player.Cards.Factory.Create <TankHeavy>();

            var Light = new[] {
                enemy.Cards.Factory.Create <TankLight>(),
                enemy.Cards.Factory.Create <TankLight>(),
                enemy.Cards.Factory.Create <TankLight>()
            };

            manage.Draw(Medium);
            manage.Draw(Heavy);
            manage.Draw(enemy, 3);

            manage.StartGame(player);

            Assert.AreEqual(3, enemy.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(5, player.GetTotalIncrease());
            Assert.AreEqual(5, player.GetResources());
            Assert.AreEqual(4, enemy.GetTotalIncrease());
            Assert.AreEqual(0, enemy.GetResources());

            var HeavyDeploy = manage.Deploy(Heavy, field.GetCell(1, 0));

            Assert.AreEqual(Status.NotEnoughResources, HeavyDeploy.GetStatus());
            Assert.IsTrue(Heavy.GetLocation().IsReserve());

            Assert.AreEqual(5, player.GetTotalIncrease());
            Assert.AreEqual(5, player.GetResources());

            var MediumDeploy = manage.Deploy(Medium, field.GetCell(1, 1));

            Assert.IsTrue(MediumDeploy.IsValid());
            Assert.IsTrue(Medium.GetLocation().IsBattlefield());
            Assert.AreEqual(field.GetCell(1, 1), Medium.GetFieldLocation().GetCell());

            Assert.AreEqual(6, player.GetTotalIncrease());
            Assert.AreEqual(1, player.GetResources());

            manage.EndTurn(player);

            var deploy = new[] {
                manage.Deploy(Light[0], field.GetCell(4, 1)),
                manage.Deploy(Light[1], field.GetCell(3, 1)),
                manage.Deploy(Light[2], field.GetCell(3, 2)),
            };

            Assert.IsTrue(deploy[0].IsValid());
            Assert.IsTrue(deploy[1].IsValid());
            Assert.IsFalse(deploy[2].IsValid());

            Assert.AreEqual(Status.NotEnoughResources, deploy[2].GetStatus());

            Assert.AreEqual(field.GetCell(4, 1), Light[0].GetFieldLocation().GetCell());
            Assert.AreEqual(field.GetCell(3, 1), Light[1].GetFieldLocation().GetCell());

            Assert.IsTrue(Light[0].GetLocation().IsBattlefield());
            Assert.IsTrue(Light[1].GetLocation().IsBattlefield());
            Assert.IsTrue(Light[2].GetLocation().IsReserve());

            manage.EndTurn(enemy);

            HeavyDeploy = manage.Deploy(Heavy, field.GetCell(1, 0));
            Assert.IsTrue(HeavyDeploy.IsValid());
            Assert.IsTrue(Heavy.GetLocation().IsBattlefield());
            Assert.AreEqual(field.GetCell(1, 0), Heavy.GetFieldLocation().GetCell());
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["Account"] == null)
     {
         if (Session["Name"] == null)
         {
             Response.Redirect("Default.aspx");
         }
         else
         {
             if (Convert.ToString(Login.GetPermission(Session["Name"].ToString())) == "2".Trim())
             {
                 DateTime tmp = DateTime.Now;
                 String   gkt = tmp.ToString("MM/dd/yyyy");
                 if (Manage.CheckDate(gkt) == true)
                 {
                     Response.AddHeader("refresh", "0;url=ChamCong.aspx");
                 }
                 else
                 {
                     Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx");
                 }
             }
             else
             {
                 Response.Redirect("Default.aspx");
             }
         }
     }
     else
     {
         if (Request.Cookies["Account"]["Permission"].ToString() == "2".Trim())
         {
             if (Session["Name"] == null)
             {
                 DateTime tmp = DateTime.Now;
                 String   gkt = tmp.ToString("MM/dd/yyyy");
                 if (Manage.CheckDate(gkt) == true)
                 {
                     Response.AddHeader("refresh", "0;url=ChamCong.aspx");
                 }
                 else
                 {
                     Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx");
                 }
             }
             else
             {
                 DateTime tmp = DateTime.Now;
                 String   gkt = tmp.ToString("MM/dd/yyyy");
                 if (Manage.CheckDate(gkt) == true)
                 {
                     Response.AddHeader("refresh", "0;url=ChamCong.aspx");
                 }
                 else
                 {
                     Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx");
                 }
             }
         }
         else
         {
             Response.Redirect("Default.aspx");
         }
     }
 }
Exemple #7
0
        public void Prediction()
        {
            var engine = new Engine();
            var logger = new Logger(engine);
            var manage = new Manage(engine);

            var field  = engine.Field;
            var player = engine.Chiefs[0];
            var enemy  = engine.Chiefs[1];

            var strike  = player.Cards.Factory.CreateDefaultHq <HqStrike>();
            var Medium  = player.Cards.Factory.Create <TankMedium>();
            var Light   = player.Cards.Factory.Create <TankLight>();
            var Order   = player.Cards.Factory.Create <ParisGun>();
            var Platoon = player.Cards.Factory.Create <PlatoonEnforceArtillery>();

            var guards = enemy.Cards.Factory.CreateDefaultHq <HqGuards>();
            var Heavy  = enemy.Cards.Factory.Create <TankHeavy>();

            manage.Position(Heavy, field.GetCell(0, 1));
            manage.Position(Medium, field.GetCell(0, 2));
            manage.Draw(player, 3);
            manage.SetResources(player, 50);

            manage.StartGame(enemy);
            manage.Fight(Heavy, strike);

            Assert.AreEqual(3, strike.GetDamage());

            manage.EndTurn(enemy);

            var emulated = player.GetEmulated();

            emulated.Attack(
                new Io.Target()
            {
                SourceId = Medium.Id,
                TargetId = Heavy.Id
            }
                );
            emulated.Order(
                new Io.Target()
            {
                SourceId = Order.Id,
                TargetId = Heavy.Id
            }
                );

            Assert.AreEqual(
                Status.AbilityIsUsed,
                emulated.Attack(
                    new Io.Target()
            {
                SourceId = Medium.Id,
                TargetId = Heavy.Id
            }
                    )
                );

            Assert.AreEqual(
                Status.NotAtReserve,
                emulated.Order(
                    new Io.Target()
            {
                SourceId = Order.Id,
                TargetId = Heavy.Id
            }
                    )
                );

            var damages = emulated.GetDamagePredictions();

            Assert.AreEqual(2, damages.Count);

            Assert.AreEqual(damages[0].CardId, Heavy.Id);
            Assert.AreEqual(4, damages[0].Value);

            Assert.AreEqual(damages[1].CardId, strike.Id);
            Assert.AreEqual(-2, damages[1].Value);

            Assert.AreEqual(0, Heavy.GetDamage());
            Assert.AreEqual(3, strike.GetDamage());

            Assert.AreEqual(
                Status.Success,
                emulated.Deploy(new Io.Position
            {
                CardId = Light.Id,
                X      = 1,
                Y      = 0
            })
                );

            Assert.AreEqual(
                Status.Success,
                emulated.Move(new Io.Position
            {
                CardId = Light.Id,
                X      = 1,
                Y      = 1
            })
                );

            Assert.AreEqual(
                Status.Success,
                emulated.Deploy(new Io.SingleCard()
            {
                CardId = Platoon.Id
            })
                );
            Assert.AreEqual(Status.Success, emulated.EndTurn());
        }
Exemple #8
0
        private void NouvelleReservationCommande_Load(object sender, EventArgs e)
        {
            helper.modifier = false; // le form sera aussi utiliser si on veut modifier la reservation mais on part du principe que de base ce n'est pas le cas.
            try
            {                        // On ajoute les participant de la reservation dans la listbox.
                listBoxPersonnesPresentes.DataSource    = Manage.GetParticipantParReservation(Manage.GetListReservation().FirstOrDefault(x => x.numeroReservation == helper.numeroReservation).idReservation);
                listBoxPersonnesPresentes.DisplayMember = "prenom";
                listBoxPersonnesPresentes.ValueMember   = "idDetailReservation";
                if (listBoxPersonnesPresentes.Items.Count != 0) // A la base elle sera vide, mais si elle n'est pas vide on indique les choix
                {
                    var selectedParticipant = (ParticipantParReservationModel)listBoxPersonnesPresentes.SelectedItem;
                    labelEntree.Text = Manage.GetCarteByRestaurantAndType(GetNumeroRestaurant(), 1)
                                       .FirstOrDefault(x => x.idCarteRestaurant == selectedParticipant.entree).Element;
                    labelPlat.Text = Manage.GetCarteByRestaurantAndType(GetNumeroRestaurant(), 2)
                                     .FirstOrDefault(x => x.idCarteRestaurant == selectedParticipant.plat).Element;
                    labelDessert.Text = Manage.GetCarteByRestaurantAndType(GetNumeroRestaurant(), 3)
                                        .FirstOrDefault(x => x.idCarteRestaurant == selectedParticipant.dessert).Element;
                    labelPrixTotal.Text = selectedParticipant.prixParPersonne.ToString();
                }

                if (helper.supprimer) // Si on modifie la reservation alors on le bouton supprimer devient visible
                {
                    button_supprimer.Visible = true;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Exemple #9
0
        internal int GetNumeroRestaurant() // On crée une fonction qui recupere l'idRestaurant de la reservation
        {
            var idTable = Manage.GetListReservation().FirstOrDefault(x => x.numeroReservation == helper.numeroReservation).idTable;

            return(Manage.GetTables().FirstOrDefault(x => x.idTables == idTable).idRestaurant);
        }
Exemple #10
0
     public ActionResult Fltr(string parameters)
     {
         ContentResult cr = new ContentResult();
         cr.Content = "1";
         parameters = HttpUtility.UrlDecode(parameters);
         string[] parce = parameters.Split('|');
         string searchId = parce[0];
         string[] manufparce = parce[1].Split(',');
         DetailModels dsst = new DetailModels();
         dsst.Details = new Dictionary<string, Parameters.DetailInfo>();
         DatabaseControl dbc = new DatabaseControl();
         SqlConnection conn = new SqlConnection();
         Dictionary<string, Parameters.DetailInfo> dic = new Dictionary<string, Parameters.DetailInfo>();
         foreach (var manuf in manufparce)
         {
             if (manuf.Trim() == string.Empty) continue;
             string requestmanuf = "and detail_manuf='" + manuf + "'";
             if (manuf == "#all") requestmanuf = string.Empty;
             SqlDataReader dr =
                 dbc.GetDataFromDB(
                     String.Format("select * from dbo.search_index where id_request='{0}' {1}", searchId, requestmanuf),
                     out conn);
           
             while (dr.Read())
             {
                 Parameters.DetailInfo di = new Parameters.DetailInfo();
                 di.Manuf = dr["detail_manuf"].ToString();
                 di.Name = dr["detail_name"].ToString();
                 di.Hash = dr["detHash"].ToString();
                 di.Delivery = dr["detail_delivery"].ToString();
                 di.BaseCount = dr["detail_basecount"].ToString();
                 di.Code = dr["det_code"].ToString();
                 di.PartId = dr["detail_partId"].ToString();
                 di.Price = decimal.Parse(dr["price"].ToString());
                 di.RealPrice = Manage.GetSummWithComission(di.Price);
                 di.SearchID = dr["id_request"].ToString();
                 di.Storage = dr["detail_detStorage"].ToString();
                 dsst.Filtered = true;
                 if (dic.ContainsKey(di.Hash))
                 {
                     Parameters.DetailInfo detailInfoTEmp = dic[di.Hash];
                     if (detailInfoTEmp.Price <= di.Price) // если сумма меньше
                     {
                         if (detailInfoTEmp.AverageDelivery <= di.AverageDelivery) continue;
                         if ((detailInfoTEmp.AverageDelivery - di.AverageDelivery) < 2) continue;

                     }
                     dic[di.Hash] = di;

                 }
                 else
                 {
                     dic.Add(di.Hash, di);
                 }
             }
              if (manuf == "all") break;
         }
        conn.Close();
         string auth = string.Empty;
         var authcookie = Request.Cookies.Get("Aurh");
         if (authcookie != null)auth = authcookie.Value;
         
         string response = "<table id=\"detailsTable\" class=\"table\">" +
                           "<tr><th class=\"mainth\" style=\"width: 25px\">п\\п</th>" +
                           "<th class=\"mainth\">Название</th><th class=\"mainth\" align=\"center\">" +
                           "Производитель</th><th class=\"mainth\" align=\"center\" >Срок доставки</th><th class=\"mainth\" align=\"center\" >Склад</th><th class=\"mainth\" align=\"center\" >Цена(руб.)</th>";
         if (auth == "1") response = response + "<th class=\"mainth\" align=\"center\" ></th>";
         response=response+ "</tr>";
         int i = 0;
         foreach (KeyValuePair<string,Parameters.DetailInfo> detailInfo in dic)
         {
          
             response = response + "<tr id=\"" + detailInfo.Value.Hash + "\">" +
                        "<td style=\"width: 15px\" class=\"maintd\" name=\"intex-" + i + "\">" + (i + 1) + "</td>" +
                        "<td class=\"maintd\" name=\"detName\" >" + detailInfo.Value.Name + "</td>" +
                        "<td class=\"maintd\" name=\"detManuf\">" + detailInfo.Value.Manuf + "</td>" +
                        "<td class=\"maintd\" name=\"detDelivery\">" + detailInfo.Value.Delivery + "</td>" +
                        "<td class=\"maintd\" name=\"detStorage\">" + detailInfo.Value.Storage + "</td>" +
                        "<td class=\"maintd\" name=\"detPrice\">" +
                        detailInfo.Value.Price.ToString("N", new NumberFormatInfo()) + "</td>";
             if (auth == "1") response = response + "<td class=\"maintd\" class=\"tableCell-gray\"><button name=\"tobasket\" id=\"" + detailInfo.Key + "\" type=\"submit\" class=\"buttonCarrito\" value=\"tobasket\" onclick=\"addToBaskt(this.id)\">в корзину</button></td></tr>";
             i++;
             }
             cr.Content = response + "</table>";
         
         return cr;
     }
Exemple #11
0
 public ManageTest()
 {
     _manage = new Manage(new DbManageFake(), new JsonEditorFake(), null, null, false);
 }
        public IEnumerable <BookGroupDto> GetAllBookGroupsWithCategory(IEnumerable <BookGroupDto> bookGroups, IEnumerable <BookCategory> bookCategories, IEnumerable <CategoryDto> categories)
        {
            Manage manage = new Manage();

            foreach (var rowBookCate in bookCategories)
            {
                foreach (var cate in categories)
                {
                    if (rowBookCate.CategoryId == cate.Id)
                    {
                        manage.add(rowBookCate.BookGroupId, cate);
                    }
                }
            }


            List <BookGroupDto> tmp = new List <BookGroupDto>();

            foreach (var bookGroup in bookGroups)
            {
                var cateTmp = manage.getItem(bookGroup.Id);
                if (cateTmp == null)
                {
                    var bookGroupDto = _entities.Include(c => c.Image).Where(x => x.IsDeleted == false && x.Id == bookGroup.Id)
                                       .Select(c => new BookGroupDto
                    {
                        Id                = c.Id,
                        Name              = c.Name,
                        Fee               = c.Fee,
                        PunishFee         = c.PunishFee,
                        Quantity          = c.Quantity,
                        Author            = c.Author,
                        PublishingPlace   = c.PublishingPlace,
                        PublishingCompany = c.PublishingCompany,
                        PublishDate       = c.PublishDate,
                        Description       = c.Description,
                        PageNumber        = c.PageNumber,
                        Height            = c.Height,
                        Width             = c.Width,
                        Thick             = c.Thick,
                        PublishNumber     = c.PublishNumber,
                        Image             = c.Image.Where(x => x.IsDeleted == false).ToList(),
                        RatingAverage     = Math.Round((double)c.Feedback.Sum(x => x.Rating) / (c.Feedback.Count), 2)
                    }).FirstOrDefault();
                    tmp.Add(bookGroupDto);
                }
                else
                {
                    var bookGroupDto = _entities.Include(c => c.Image).Where(x => x.Id == cateTmp.Id && x.IsDeleted == false)
                                       .Select(c => new BookGroupDto
                    {
                        Id                = c.Id,
                        Name              = c.Name,
                        Fee               = c.Fee,
                        PunishFee         = c.PunishFee,
                        Quantity          = c.Quantity,
                        Author            = c.Author,
                        PublishingPlace   = c.PublishingPlace,
                        PublishingCompany = c.PublishingCompany,
                        PublishDate       = c.PublishDate,
                        Description       = c.Description,
                        PageNumber        = c.PageNumber,
                        Height            = c.Height,
                        Width             = c.Width,
                        Thick             = c.Thick,
                        PublishNumber     = c.PublishNumber,
                        Image             = c.Image.Where(x => x.IsDeleted == false).ToList(),
                        Category          = cateTmp.listRecord,
                        RatingAverage     = Math.Round((double)c.Feedback.Sum(x => x.Rating) / (c.Feedback.Count), 2)
                    }).FirstOrDefault();

                    tmp.Add(bookGroupDto);
                }
            }

            return(tmp);
        }
Exemple #13
0
        public void CardAutoDraw()
        {
            Engine engine = new Engine();
            Logger logger = new Logger(engine);
            Manage manage = new Manage(engine);

            var autoDraw = engine.Triggers.Register <CardAutoDraw>();

            var player = engine.Chiefs[0];
            var enemy  = engine.Chiefs[1];

            player.Cards.SetShuffleOff();

            var plCards = new FieldCard[] {
                player.Cards.Factory.Create <TankLight>(),
                player.Cards.Factory.Create <TankMedium>(),
                player.Cards.Factory.Create <TankHeavy>(),
                player.Cards.Factory.Create <TankSpg>()
            };

            var enCards = new FieldCard[] {
                enemy.Cards.Factory.Create <TankLight>(),
                enemy.Cards.Factory.Create <TankMedium>(),
                enemy.Cards.Factory.Create <TankHeavy>(),
                enemy.Cards.Factory.Create <TankSpatg>()
            };

            Assert.AreEqual(1, autoDraw.GetCount());
            autoDraw.SetCount(2);
            Assert.AreEqual(2, autoDraw.GetCount());
            autoDraw.SetCount(1);
            Assert.AreEqual(1, autoDraw.GetCount());

            manage.StartGame(enemy);

            Assert.AreEqual(0, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(0, enemy.Cards.CountLocation(Location.Reserve));

            manage.EndTurn(enemy);

            Assert.AreEqual(1, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(0, enemy.Cards.CountLocation(Location.Reserve));
            Assert.IsTrue(plCards[0].GetLocation().IsReserve());

            manage.EndTurn(player);

            Assert.AreEqual(1, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(1, enemy.Cards.CountLocation(Location.Reserve));

            manage.EndTurn(enemy);
            manage.EndTurn(player);

            Assert.AreEqual(2, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(2, enemy.Cards.CountLocation(Location.Reserve));

            manage.EndTurn(enemy);
            manage.EndTurn(player);

            Assert.AreEqual(3, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(3, enemy.Cards.CountLocation(Location.Reserve));

            manage.EndTurn(enemy);
            manage.EndTurn(player);

            Assert.AreEqual(4, player.Cards.CountLocation(Location.Reserve));
            Assert.AreEqual(4, enemy.Cards.CountLocation(Location.Reserve));

            manage.EndTurn(enemy);
            manage.EndTurn(player);
            manage.EndTurn(enemy);
            manage.EndTurn(player);
            manage.EndTurn(enemy);
            manage.EndTurn(player);

            Utils.ArrayAreEqual(plCards, player.Cards.FromLocation(Location.Reserve));
            Utils.ArrayAreEqual(enCards, enemy.Cards.FromLocation(Location.Reserve));
        }
Exemple #14
0
 private void Awake()
 {
     manage    = GameObject.Find("Manager").GetComponent <Manage>();
     forceArea = GameObject.Find("ForceArea").GetComponent <forceArea>();
 }
Exemple #15
0
 public bool DeleteEntity(Manage entity)
 {
     return(base.DeleteEntity <Manage>(entity));
 }
Exemple #16
0
 public bool UpdateEntity(Manage entity)
 {
     return(base.UpdateEntity <Manage>(entity));
 }
Exemple #17
0
 // Use this for initialization
 void Start()
 {
     manage = GameObject.FindWithTag("Manager").GetComponent<Manage>();
     move = GetComponent<Moves>();
 }
Exemple #18
0
 // Start is called before the first frame update
 void Start()
 {
     Manage = GameObject.Find("Manage").GetComponent <Manage>();
 }
Exemple #19
0
 public void method_21()
 {
     foreach (Control control in this.panel1.Controls)
     {
         control.Dispose();
     }
     this.panel1.Controls.Clear();
     Manage manage = new Manage {
         TopLevel = false,
         FormBorderStyle = FormBorderStyle.None,
         Visible = true
     };
     this.panel1.Controls.Add(manage);
 }
 void Awake()
 {
     ev = manager.GetComponent <Manage> ();
 }
Exemple #21
0
        private void comboBoxMenu_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataSet oDataSet4 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 1);
                listBoxEntreeChoisie.DataSource    = oDataSet4.Tables["CarteMenus"];
                listBoxEntreeChoisie.DisplayMember = "Element";
                listBoxEntreeChoisie.ValueMember   = "idCarteRestaurant";

                DataSet oDataSet5 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 2);
                listBoxPlatChoisi.DataSource    = oDataSet5.Tables["CarteMenus"];
                listBoxPlatChoisi.DisplayMember = "Element";
                listBoxPlatChoisi.ValueMember   = "idCarteRestaurant";

                DataSet oDataSet6 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 3);
                listBoxDessertChoisi.DataSource    = oDataSet6.Tables["CarteMenus"];
                listBoxDessertChoisi.DisplayMember = "Element";
                listBoxDessertChoisi.ValueMember   = "idCarteRestaurant";

                if (listBoxEntreeChoisie.Items.Count != 0 && listBoxPlatChoisi.Items.Count != 0 && listBoxDessertChoisi.Items.Count != 0)
                {
                    var selectedEntree  = (Int32)((DataRowView)listBoxEntreeChoisie.SelectedItem)["idcarteRestaurant"];
                    var selectedPlat    = (Int32)((DataRowView)listBoxPlatChoisi.SelectedItem)["idcarteRestaurant"];
                    var selectedDessert = (Int32)((DataRowView)listBoxDessertChoisi.SelectedItem)["idcarteRestaurant"];
                    labelPrix.Text = (Convert.ToInt32((Manage.GetPrixGroupe(selectedEntree) + Manage.GetPrixGroupe(selectedPlat) + Manage.GetPrixGroupe(selectedDessert)) * 0.9)).ToString() + " €";
                }
                else
                {
                    labelPrix.Text = "...";
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Exemple #22
0
        private void button5_Click(object sender, EventArgs e)
        {
            String requestId = textBox1.Text;

            Manage.removeRequest(requestId);
        }
Exemple #23
0
 private void listBoxDessertChoisi_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBoxEntreeChoisie.Items.Count != 0 && listBoxPlatChoisi.Items.Count != 0 && listBoxDessertChoisi.Items.Count != 0)
     {
         var selectedEntree  = (Int32)((DataRowView)listBoxEntreeChoisie.SelectedItem)["idcarteRestaurant"];
         var selectedPlat    = (Int32)((DataRowView)listBoxPlatChoisi.SelectedItem)["idcarteRestaurant"];
         var selectedDessert = (Int32)((DataRowView)listBoxDessertChoisi.SelectedItem)["idcarteRestaurant"];
         labelPrix.Text = (Convert.ToInt32((Manage.GetPrixGroupe(selectedEntree) + Manage.GetPrixGroupe(selectedPlat) + Manage.GetPrixGroupe(selectedDessert)) * 0.9)).ToString() + " €";
     }
     else
     {
         labelPrix.Text = "...";
     }
 }
Exemple #24
0
 private void buttonTerminer_Click(object sender, EventArgs e)
 {
     try
     {
         if (listBoxPersonnesPresentes.Items.Count != GetNbreParticipant()) // Si pas tous les participant ont été ajoutés
         {
             MessageBox.Show(
                 "N'oubliez pas de completer le menu des participants avant de venir. Si les menus ne sont pas completés votre réservation ne sera pas prise en compte !");
             this.Hide();
             Form1 oNouvelleReservation = new Form1();
             oNouvelleReservation.Closed   += (s, args) => this.Close(); // On repasse au form initiale
             oNouvelleReservation.MdiParent = this.MdiParent;
             oNouvelleReservation.Show();
         }
         else
         {
             Manage.ConfirmerReservation(Manage.GetListReservation() // On confirme la reservation dans la db et on rajoute le prix total de la reservation
                                         .FirstOrDefault(x => x.numeroReservation == helper.numeroReservation).idReservation, Manage.SumPrixTotalReservation(Manage.GetListReservation()
                                                                                                                                                             .FirstOrDefault(x => x.numeroReservation == helper.numeroReservation).idReservation));
             this.Hide();
             Form1 oNouvelleReservation = new Form1(); // On retourne a la forme initiale
             oNouvelleReservation.Closed   += (s, args) => this.Close();
             oNouvelleReservation.MdiParent = this.MdiParent;
             oNouvelleReservation.Show();
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
Exemple #25
0
        private void CarteMenu_Load(object sender, EventArgs e)
        {
            try
            {
                DataSet oDataSet = Manage.SelectCarteRestaurantByType(idRestaurant, 1);
                listBoxEntree.DataSource    = oDataSet.Tables["CarteRestaurant"];
                listBoxEntree.DisplayMember = "Element";
                listBoxEntree.ValueMember   = "idCarteRestaurant";

                DataSet oDataSet2 = Manage.SelectCarteRestaurantByType(idRestaurant, 2);
                listBoxPlat.DataSource    = oDataSet2.Tables["CarteRestaurant"];
                listBoxPlat.DisplayMember = "Element";
                listBoxPlat.ValueMember   = "idCarteRestaurant";

                DataSet oDataSet3 = Manage.SelectCarteRestaurantByType(idRestaurant, 3);
                listBoxDessert.DataSource    = oDataSet3.Tables["CarteRestaurant"];
                listBoxDessert.DisplayMember = "Element";
                listBoxDessert.ValueMember   = "idCarteRestaurant";

                DataSet oDataSet0 = Manage.SelectMenuByRestaurant(idRestaurant);
                if (oDataSet0.Tables["Menus"].Rows.Count != 0)
                {
                    buttonSupprimerMenu.Enabled = true;
                    comboBoxMenu.DataSource     = oDataSet0.Tables["Menus"];
                    comboBoxMenu.DisplayMember  = "idMenu";
                    comboBoxMenu.ValueMember    = "idMenu";

                    DataSet oDataSet4 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 1);
                    if (oDataSet4.Tables["CarteMenus"].Rows.Count != 0)
                    {
                        listBoxEntreeChoisie.DataSource    = oDataSet4.Tables["CarteMenus"];
                        listBoxEntreeChoisie.DisplayMember = "Element";
                        listBoxEntreeChoisie.ValueMember   = "idCarteRestaurant";
                    }
                    else
                    {
                        buttonDeleteEntree.Enabled = false;
                    }

                    DataSet oDataSet5 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 2);
                    if (oDataSet5.Tables["CarteMenus"].Rows.Count != 0)
                    {
                        listBoxPlatChoisi.DataSource    = oDataSet5.Tables["CarteMenus"];
                        listBoxPlatChoisi.DisplayMember = "Element";
                        listBoxPlatChoisi.ValueMember   = "idCarteRestaurant";
                    }
                    else
                    {
                        buttonDeletePlat.Enabled = false;
                    }

                    DataSet oDataSet6 = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 3);
                    if (oDataSet6.Tables["CarteMenus"].Rows.Count != 0)
                    {
                        listBoxDessertChoisi.DataSource    = oDataSet6.Tables["CarteMenus"];
                        listBoxDessertChoisi.DisplayMember = "Element";
                        listBoxDessertChoisi.ValueMember   = "idCarteRestaurant";
                    }
                    else
                    {
                        buttonDeleteDessert.Enabled = false;
                    }

                    if (listBoxEntreeChoisie.Items.Count != 0 && listBoxPlatChoisi.Items.Count != 0 && listBoxDessertChoisi.Items.Count != 0)
                    {
                        var selectedEntree  = (Int32)((DataRowView)listBoxEntreeChoisie.SelectedItem)["idcarteRestaurant"];
                        var selectedPlat    = (Int32)((DataRowView)listBoxPlatChoisi.SelectedItem)["idcarteRestaurant"];
                        var selectedDessert = (Int32)((DataRowView)listBoxDessertChoisi.SelectedItem)["idcarteRestaurant"];
                        labelPrix.Text = (Convert.ToInt32((Manage.GetPrixGroupe(selectedEntree) + Manage.GetPrixGroupe(selectedPlat) + Manage.GetPrixGroupe(selectedDessert)) * 0.9)).ToString() + " €";
                    }
                    else
                    {
                        labelPrix.Text = "...";
                    }
                }
                else
                {
                    buttonAddEntree.Enabled     = false;
                    buttonAddPlat.Enabled       = false;
                    buttonAddDessert.Enabled    = false;
                    buttonDeleteEntree.Enabled  = false;
                    buttonDeletePlat.Enabled    = false;
                    buttonDeleteDessert.Enabled = false;
                    buttonSupprimerMenu.Enabled = false;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Exemple #26
0
 internal int GetNbreParticipant() // On crée une fonction qui recupère le nombre de participant dans la reservation
 {
     return(Manage.GetListReservation().FirstOrDefault(x => x.numeroReservation == helper.numeroReservation).nbreDePersonnes);
 }
Exemple #27
0
        private void buttonAddPlat_Click(object sender, EventArgs e)
        {
            try
            {
                Manage.InsertCarteRestaurantMenu((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], (Int32)((DataRowView)listBoxPlat.SelectedItem)["idCarteRestaurant"]);

                DataSet oDataSet = Manage.GetCarteMenuNoLinq((Int32)((DataRowView)comboBoxMenu.SelectedItem)["idMenu"], 2);
                listBoxPlatChoisi.DataSource    = oDataSet.Tables["CarteMenus"];
                listBoxPlatChoisi.DisplayMember = "Element";
                listBoxPlatChoisi.ValueMember   = "idCarteRestaurant";
                if (buttonDeletePlat.Enabled == false)
                {
                    buttonDeletePlat.Enabled = true;
                    if (listBoxEntreeChoisie.Items.Count != 0 && listBoxPlatChoisi.Items.Count != 0 && listBoxDessertChoisi.Items.Count != 0)
                    {
                        var selectedEntree  = (Int32)((DataRowView)listBoxEntreeChoisie.SelectedItem)["idcarteRestaurant"];
                        var selectedPlat    = (Int32)((DataRowView)listBoxPlatChoisi.SelectedItem)["idcarteRestaurant"];
                        var selectedDessert = (Int32)((DataRowView)listBoxDessertChoisi.SelectedItem)["idcarteRestaurant"];
                        labelPrix.Text = (Convert.ToInt32((Manage.GetPrixGroupe(selectedEntree) + Manage.GetPrixGroupe(selectedPlat) + Manage.GetPrixGroupe(selectedDessert)) * 0.9)).ToString() + " €";
                    }
                    else
                    {
                        labelPrix.Text = "...";
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Exemple #28
0
 /// <summary>
 ///添加电影院
 /// </summary>
 /// <param name="ddy"></param>
 /// <returns></returns>
 public static bool addManage(Manage ddy)
 {
     return(DAL.ManageServer.addManage(ddy));
 }
Exemple #29
0
 /// <summary>
 /// 左导航条
 /// </summary>
 /// <returns></returns>
 public ActionResult LeftNav()
 {
     return(PartialView(Manage.GetFunctions(LoginUserDetail.Nick, true, 0)));
 }
Exemple #30
0
 public static void Menu()
 {
     Console.Clear();
     Return.PlayerInfo();
     Return.Managers();
     Write.Line(90, 17, Color.SPEAK + "Toggle Information" + Color.RESET);
     Write.Line(90, 19, "[S]tats");
     Write.Line(90, 20, "[I]njuries");
     Write.Line(90, 21, "[E]quipment");
     if (display == Display.Stats)
     {
         Return.Roster(player, 5);
     }
     else if (display == Display.Injuries)
     {
         Manage.Injuries();
     }
     else if (display == Display.Equipment)
     {
         Manage.Equipment();
     }
     while (day < 11)
     {
         Write.Line(0, 18, "[1] " + Color.GOLD + "Hire Gladiators\n" + Color.RESET);
         Write.Line("[2] " + Color.ENERGY + "Manage Gladiators" + Color.RESET);
         Write.Line("[3] " + Color.ITEM + "Purchase Equipment" + Color.RESET);
         Write.Line("[4] " + Color.ENERGY + "Jobs" + Color.RESET);
         if (Graveyard.graveyard.Count > 0)
         {
             Write.Line("[5] " + Color.DURABILITY + "Graveyard" + Color.RESET);
         }
         else
         {
             Write.Line("[X] " + Color.MITIGATION + "The graveyard is empty" + Color.RESET);
         }
         int gladiatorsWithAWin = 0;
         foreach (Owner o in Create.owners)
         {
             foreach (Gladiator g in o.roster)
             {
                 if (g.wins > 0)
                 {
                     gladiatorsWithAWin++;
                 }
             }
         }
         if (gladiatorsWithAWin > 9)
         {
             Write.Line("[6] " + Color.XP + "Top 10 Gladiators" + Color.RESET);
         }
         else
         {
             Write.Line("[X] " + Color.MITIGATION + "Not enough gladiators have won a match" + Color.RESET);
         }
         Write.Line("[7] " + Color.XP + "Owner Rankings" + Color.RESET);
         if (audience)
         {
             Write.Line("[8] " + Color.XP + "Audience with the emperor" + Color.RESET);
         }
         else
         {
             Write.Line("[X] " + Color.MITIGATION + "The emperor has no interest in you" + Color.RESET);
         }
         if (fightsToday)
         {
             Write.Line("[A] " + Color.STRENGTH + "The Arena!" + Color.RESET);
         }
         else
         {
             Write.Line("[X] " + Color.MITIGATION + "There are no other fights today" + Color.RESET);
         }
         Write.Line("[0] " + Color.TIME + "Next day" + Color.RESET);
         Write.Line("[Q] Quit");
         string choice = Return.Option();
         if (choice == "1")
         {
             Slaver.Hire();
         }
         else if (choice == "2")
         {
             Manage.Gladiators();
         }
         else if (choice == "3")
         {
             Purchase.Equipment();
         }
         else if (choice == "5" && Graveyard.graveyard.Count > 0)
         {
             Graveyard.Visit();
         }
         else if (choice == "6" && gladiatorsWithAWin > 9)
         {
             Rankings.Gladiators();
         }
         else if (choice == "7")
         {
             Rankings.Owner();
         }
         else if (choice == "a")
         {
             fightsToday = false;
             for (int i = 0; i < 6; i++)
             {
                 Owner o = owners[Return.RandomInt(0, owners.Count)];
                 schedule.Add(o);
                 owners.Remove(o);
             }
             owners = schedule;
             ScheduleDisplay();
             Combat.Start(schedule[0].roster[0], schedule[1].roster[0]);
             Combat.Start(schedule[2].roster[0], schedule[3].roster[0]);
             Combat.Start(schedule[4].roster[0], schedule[5].roster[0]);
         }
         else if (choice == "0")
         {
             day++;
             player.actions = 3;
             if (day % 3 == 0)
             {
                 Slaver.NewStock();
             }
             // All the next day stuff
             fightsToday = true;
         }
         else if (choice == "s")
         {
             display = Display.Stats;
         }
         else if (choice == "e")
         {
             display = Display.Equipment;
         }
         else if (choice == "i")
         {
             display = Display.Injuries;
         }
         else if (choice == "q")
         {
             Environment.Exit(0);
         }
         Menu();
     }
     Console.Clear();
     Write.Line("YOU ARE IN THE NEXT STAGE OF THE GAME! CONGRATS!");
     Write.KeyPress();
     Environment.Exit(0);
 }
        private void dataOfficialsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(this.HomeClub.ClubId != 0 && this.GuestClub.ClubId != 0)
            {
                FrmAddOfficials dataAddOfficials = new FrmAddOfficials(this.HomeClub.ClubId, this.GuestClub.ClubId, this.HomeClubOfficials, this.GuestClubOfficials);
                dataAddOfficials.ShowDialog();

                if (dataAddOfficials.OfficialsAddSuccess)
                {
                    Thread loadingThread = new Thread(new ThreadStart(showLoadingForm));
                    loadingThread.Start();

                    this.HomeManages = new BindingList<Manage>();
                    this.GuestManages = new BindingList<Manage>();

                    this.HomeClubOfficials = dataAddOfficials.HomeOfficialsManage;
                    this.GuestClubOfficials = dataAddOfficials.GuestOfficialsManage;

                    this.HomeTeamOfficials.Clear();
                    this.GuestTeamOfficials.Clear();

                    using (var db = new MatchReporterEntities())
                    {
                        List<Manage> previousManages = new List<Manage>(db.Manage.Where<Manage>(m => m.MatchId == this.Match.MatchId).ToList<Manage>());
                        foreach (Manage manage in previousManages)
                        {
                            db.Manage.Remove(manage);
                        }
                        db.SaveChanges();
                    }

                    foreach (ClubOfficial official in this.HomeClubOfficials)
                    {
                        TeamOfficial teamOfficial = new TeamOfficial(official.ClubOfficialId, official.FirstName, official.LastName);
                        this.HomeTeamOfficials.Add(teamOfficial);

                        Manage manage = new Manage(this.Match.MatchId, official.ClubOfficialId);
                        this.HomeManages.Add(manage);
                    }

                    foreach (ClubOfficial official in this.GuestClubOfficials)
                    {
                        TeamOfficial teamOfficial = new TeamOfficial(official.ClubOfficialId, official.FirstName, official.LastName);
                        this.GuestTeamOfficials.Add(teamOfficial);

                        Manage manage = new Manage(this.Match.MatchId, official.ClubOfficialId);
                        this.GuestManages.Add(manage);
                    }

                    using (var db = new MatchReporterEntities())
                    {
                        foreach (Manage manage in this.HomeManages)
                        {
                            db.Manage.Add(manage);
                        }

                        foreach (Manage manage in this.GuestManages)
                        {
                            db.Manage.Add(manage);
                        }
                        db.SaveChanges();

                        this.SavedManages = true;
                    }

                    dgvHomeOfficials.DataSource = this.HomeTeamOfficials;
                    dgvGuestOfficials.DataSource = this.GuestTeamOfficials;
                    dgvHomeOfficials.Refresh();
                    dgvGuestOfficials.Refresh();

                    btnHomeOfficialWarning.Enabled = true;
                    btnGuestOfficialWarning.Enabled = true;
                    btnHomeOfficialSuspension.Enabled = true;
                    btnGuestOfficialSuspension.Enabled = true;
                    btnHomeOfficialDisqualification.Enabled = true;
                    btnGuestOfficialDisqualification.Enabled = true;
                    btnHomeOfficialUndo.Enabled = true;
                    btnGuestOfficialUndo.Enabled = true;

                    loadingThread.Abort();
                }
                //dataAddOfficials.Dispose();
            }
            else
            {
                MessageBox.Show(this, "Da biste dodali službene osobe, prvo je potrebno dodati momčadi.", "Greška",
                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #32
0
 void Start()
 {
     Manage       = GameObject.Find("Manage").GetComponent <Manage>();
     LoopRgb2d    = Loop.GetComponent <Rigidbody2D>();
     Balloonaudio = GameObject.Find("Balloonaudio").GetComponent <AudioSource>();
 }
Exemple #33
0
 private void button1_Click(object sender, EventArgs e)
 {
     Manage.delegateView();
 }