Beispiel #1
0
        //common lib
        public bool Insert(season_club entity)
        {
            try
            {
                //thêm CLB vào mùa giải
                db.season_club.Add(entity);

                //thêm CLB vào bảng xếp hạng
                var info_rank = new rank();
                info_rank.footballClub_id = entity.idx_fooballClub_id;
                info_rank.season_id       = entity.idx_season_id;
                info_rank.win_match_guest = 0;
                info_rank.win_match       = 0;
                info_rank.lose_match      = 0;
                info_rank.draw_match      = 0;
                info_rank.win_score       = 0;
                info_rank.lose_score      = 0;

                new rank_dao().Insert(info_rank);

                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public ActionResult DeleteConfirmed(string id)
        {
            rank rank = db.ranks.Find(id);

            db.ranks.Remove(rank);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            rank rank = db.ranks.FirstOrDefault(i => i.rank_id == id);

            db.ranks.Remove(rank);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #4
0
    public void GameOver()
    {
        State = GameState.GameOver;
        UI_Result.SetActive(true);
        rank rank = UI_Result.GetComponent <rank>();

        rank.InScore(Time);
        GameOverEvent.Invoke();
        //StopAllCoroutines();
    }
 public ActionResult Edit([Bind(Include = "rankID,rankname,rankbelt,rankdesc")] rank rank)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rank).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(rank));
 }
        public ActionResult Create([Bind(Include = "rankID,rankname,rankbelt,rankdesc")] rank rank)
        {
            if (ModelState.IsValid)
            {
                db.ranks.Add(rank);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(rank));
        }
 public ActionResult Edit([Bind(Include = "rank_id,student_id,rank_beltcolor,rank_date")] rank rank)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rank).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.student_id = new SelectList(db.students, "student_id", "student_name", rank.student_id);
     return(View(rank));
 }
        public ActionResult Create([Bind(Include = "rank_id,student_id,rank_beltcolor,rank_date")] rank rank)
        {
            if (ModelState.IsValid)
            {
                db.ranks.Add(rank);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.student_id = new SelectList(db.students, "student_id", "student_name", rank.student_id);
            return(View(rank));
        }
Beispiel #9
0
 public HttpResponseMessage TotalRank()
 {
     try
     {
         rank rank = new rank();
         rank.ranks = userRepository.TotalRank().ToList();
         return(Request.CreateResponse(HttpStatusCode.OK, rank));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex));
     }
 }
Beispiel #10
0
 //common lib
 public bool Insert(rank entity)
 {
     try
     {
         db.ranks.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
        // GET: ranks/Details/5
        public ActionResult Details(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            rank rank = db.ranks.FirstOrDefault(i => i.rank_id == id);

            if (rank == null)
            {
                return(HttpNotFound());
            }
            return(View(rank));
        }
        // GET: ranks/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            rank rank = db.ranks.Find(id);

            if (rank == null)
            {
                return(HttpNotFound());
            }
            return(View(rank));
        }
Beispiel #13
0
    private void Reward(ObjectivesScriptableObject.Objective o, rank r)
    {
        if (completed.Contains(o))
        {
            return;
        }

        completed.Add(o);

        MonoBehaviour.print(@"Player achieved """ + o.objectiveDescription + @""" with a " + r.ToString() + " rank!");

        recentCleared.Add(o);
        recentClearedRanks.Add(r);

        {
            string t = "";
            switch (r)
            {
            case rank.bronze:
                t = o.feedbackOnBronze;
                bronzeCompleted++;
                break;

            case rank.silver:
                t = o.feedbackOnSilver;
                silverCompleted++;
                break;

            case rank.gold:
                t = o.feedbackOnGold;
                goldCompleted++;
                break;
            }

            if (objectivesScriptableObject.objectives.IndexOf(o) == 0)
            {
                objective0.text = t;
            }
            else if (objectivesScriptableObject.objectives.IndexOf(o) == 1)
            {
                objective1.text = t;
            }

            bronzeCompletedText.text = bronzeCompleted.ToString();
            silverCompletedText.text = silverCompleted.ToString();
            goldCompletedText.text   = goldCompleted.ToString();
        }

        OptionsMenu.RequestOpen();
    }
        // GET: ranks/Details/5
        public ActionResult Details(int?id, string color)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            rank rank = db.ranks.Find(id, color);

            if (rank == null)
            {
                return(HttpNotFound());
            }
            return(View(rank));
        }
        // GET: ranks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            rank rank = db.ranks.FirstOrDefault(i => i.rank_id == id);

            if (rank == null)
            {
                return(HttpNotFound());
            }
            ViewBag.student_id = new SelectList(db.students, "student_id", "student_name", rank.student_id);
            return(View(rank));
        }
        // GET: ranks/Edit/5
        public ActionResult Edit(int?id, string color)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            rank rank = db.ranks.Find(id, color);

            if (rank == null)
            {
                return(HttpNotFound());
            }
            ViewBag.student_id = new SelectList(db.students, "student_id", "email_id", rank.student_id);
            return(View(rank));
        }
Beispiel #17
0
        public void generatePiece(rank r, Point2D pos, bool isRed)
        {
            switch (r)
            {
            case rank.Rook:
            {
                if (isRed && Red_rook_id < 2 && !board.board[pos.X][pos.Y].isEmpty)
                {
                    board.board[pos.X][pos.Y] = new Rook(true, pos.X, pos.Y, Red_rook_id);
                    Red_rook_id++;
                    break;
                }
                else if (!isRed && Black_rook_id < 2 && !board.board[pos.X][pos.Y].isEmpty)
                {
                    board.board[pos.X][pos.Y] = new Rook(true, pos.X, pos.Y, Black_rook_id);
                    Black_rook_id++;
                    break;
                }
            }

            case rank.Advisor:
            {
                if (isRed && Advisor.checkPos(pos.X, pos.Y, isRed) && !board.board[pos.X][pos.Y].isEmpty && Red_Advisor_id < 2)
                {
                    board.board[pos.X][pos.Y] = new Advisor(isRed, pos.X, pos.Y, Red_Advisor_id);
                    Red_Advisor_id++;
                    break;
                }
                else if (!isRed && Advisor.checkPos(pos.X, pos.Y, isRed) && !board.board[pos.X][pos.Y].isEmpty && Black_Advisor_id < 2)
                {
                    board.board[pos.X][pos.Y] = new Advisor(isRed, pos.X, pos.Y, Red_Advisor_id);
                    Black_Advisor_id++;
                    break;
                }
            }
            }
        }
Beispiel #18
0
 public Deck(suit cs, rank cv) : base(cs, cv)
 {
 }
Beispiel #19
0
 public Card(rank r, suit s)
 {
     Rank       = r;
     Suit       = s;
     IsFaceDown = true;
 }
Beispiel #20
0
 public Card(rank Rank, suit Suit)
 {
     this.Rank = Rank;
     this.Suit = Suit;
 }
Beispiel #21
0
 var(rank, score) when rank == 2 => score += 2,
Beispiel #22
0
 //constructor
 public Card(suit cs, rank cv)
 {
     cardShape = cs;
     cardValue = cv;
 }
Beispiel #23
0
        public static bool ProfFunc(List <Professor> prList)
        {
            {
                string profMnu = "---------Professor Menu---------\n" +
                                 "Press 1 to list all Professors\n" +
                                 "Press 2 to add a new Professors\n" +
                                 "Press 3 to update an existing Professors\n" +
                                 "Press 4 to delete a Professor\n" +
                                 "Press 5 to return to main menu";

                Console.WriteLine(profMnu);
                string StuChoice = null;


                while (StuChoice != "5")
                {
                    StuChoice = Console.ReadLine();

                    switch (StuChoice)
                    {
                    case "1":
                        Modify.showAll <Professor>(prList);
                        break;

                    case "2":
                        Console.WriteLine("Please enter in new details: \n");

                        Console.WriteLine("Name");
                        string Name = Console.ReadLine();

                        Console.WriteLine("Address one,two and City");
                        string Address1 = Console.ReadLine();
                        string Address2 = Console.ReadLine();
                        string City     = Console.ReadLine();

                        Console.WriteLine("Email:");
                        string newEmail = Console.ReadLine();

                        Console.WriteLine("Hire Date:(MM-DD-YYYY)");
                        string   newDate     = Console.ReadLine();
                        DateTime UpdatedDate = Convert.ToDateTime(newDate);


                        Console.WriteLine("Enter number to chose rank\n 0 = Associate \n 1 = Professor \n 2 for Assistant Professor:");

                        Console.WriteLine("Rank");
                        string DesigS = Console.ReadLine();
                        int    tr     = Convert.ToInt32(DesigS);


                        Console.WriteLine("Salary");
                        string sall   = Console.ReadLine();
                        Double newSal = Convert.ToDouble(sall);

                        rank nRank = (rank)tr;


                        Console.WriteLine("Hours (Format: Day: from-to) ");
                        string newH = Console.ReadLine();

                        Modify.Add <Professor>(prList, new Professor(Name, new Address(Address1, Address2, City), newEmail, newSal, UpdatedDate, newH, nRank));
                        Console.WriteLine("New List\n");
                        Modify.showAll <Professor>(prList);
                        Console.WriteLine(profMnu);
                        break;


                    case "3":

                        Console.WriteLine("Enter the name and email of the prof youd like to update:\n");

                        Console.WriteLine("Name");
                        string findName = Console.ReadLine();
                        Console.WriteLine("Email:");
                        string findEmail = Console.ReadLine();

                        UpdateProf(findName, findEmail, prList);
                        Console.WriteLine("New List");
                        Modify.showAll <Professor>(prList);
                        Console.WriteLine(profMnu);
                        break;


                    case "4":
                        Modify.showAll <Professor>(prList);
                        Console.WriteLine("Please entter the name and email of the Prof you'd like to delete:\n");
                        Console.WriteLine("\nName");
                        string name = Console.ReadLine();
                        Console.WriteLine("\nEmail");
                        string email = Console.ReadLine();

                        Del(name, email, prList);

                        Console.WriteLine("New List");
                        Modify.showAll <Professor>(prList);
                        Console.WriteLine("\n" + profMnu);

                        break;


                    case "5":

                        break;
                    }
                }
                return(true);
            }
        }
 public Professor(string Name, Address Residence, string email, double salary, DateTime hiredate, double hours, rank rank) : base(Name, Residence, email, salary, hiredate)
 {
     this.hours = hours;
     this.rank  = rank;
 }