Beispiel #1
0
 public override void Compose(Yupi.Protocol.ISender session, ClubLevel clubLevel, Rank rank, bool isAmbadassor = false)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger((int)clubLevel);
         message.AppendInteger((int)rank);
         message.AppendBool(isAmbadassor);
         session.Send(message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Insert a ClubLevel to the database
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool Insert(ClubLevel entity)
 {
     try
     {
         db.ClubLevels.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public ActionResult Create(Club club)
        {
            if (ModelState.IsValid)
            {
                //Xử lý MetaTitle
                if (!string.IsNullOrEmpty(club.Name))
                {
                    club.MetaTitle = StringHelper.ToUnsignString(club.Name);
                }

                var userSession = (UserLogin)Session[FootballFlick.Common.CommonConstants.USER_SESSION];
                club.OwnerID = userSession.UserID;

                var dao = new ClubDao();
                if (dao.CheckCode(club.Code) == false)
                {
                    long id = dao.Insert(club);
                    if (id > 0)
                    {
                        //Tự động Insert level của Club vào ClubLevel
                        ClubLevel clubLevel = new ClubLevel()
                        {
                            ClubID = id, LevelID = 1, Date = DateTime.Now
                        };
                        bool resLv = new ClubLevelDao().Insert(clubLevel);
                        if (resLv == false)
                        {
                            ModelState.AddModelError("", "Automatically create ClubLevel failed.");
                        }

                        ViewBag.Success = "Create your Club successfully";
                    }
                    else
                    {
                        ModelState.AddModelError("", "Create a new club failed.");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "The Code already exists. Please try another Code.");
                }
            }
            return(View(club));
        }
Beispiel #4
0
        public ActionResult Create(Club club)
        {
            if (ModelState.IsValid)
            {
                //Xử lý MetaTitle
                if (!string.IsNullOrEmpty(club.Name))
                {
                    club.MetaTitle = StringHelper.ToUnsignString(club.Name);
                }

                var dao = new ClubDao();
                if (dao.CheckCode(club.Code) == false)
                {
                    //Insert Club vào database
                    long id = dao.Insert(club);
                    if (id > 0)
                    {
                        //Tự động Insert level của Club vào ClubLevel
                        ClubLevel clubLevel = new ClubLevel()
                        {
                            ClubID = id, LevelID = 1, Date = DateTime.Now
                        };
                        bool resLv = new ClubLevelDao().Insert(clubLevel);
                        if (resLv == false)
                        {
                            ModelState.AddModelError("", "Automatically create ClubLevel failed.");
                        }

                        //Thông báo tạo mới thành công
                        SetAlert("Create a new club successfully.", "success");
                        return(RedirectToAction("Index", "Club"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Create a new club failed.");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "The Code already exists. Please try another Code.");
                }
            }
            return(View(club));
        }
Beispiel #5
0
 private Dance(int value, ClubLevel clubLevel)
     : base(value, value.ToString())
 {
     this.ClubLevel = clubLevel;
 }
Beispiel #6
0
 public int Delete(ClubLevel _clubLevel)
 {
     return(clubLevelProviderRepository.Delete(_clubLevel));
 }
Beispiel #7
0
 public int Update(ClubLevel _clubLevel)
 {
     return(clubLevelProviderRepository.Update(_clubLevel));
 }
Beispiel #8
0
 public int Insert(ClubLevel _clubLevel)
 {
     return(clubLevelProviderRepository.Insert(_clubLevel));
 }
Beispiel #9
0
 public virtual bool HasLevel(ClubLevel level)
 {
     return(this.GetLevel() >= level);
 }
Beispiel #10
0
 public Subscription(ClubLevel level, DateTime expires)
     : this()
 {
     this.ExpireTime = expires;
     this.ClubLevel  = level;
 }