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); } }
/// <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)); }
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)); }
private Dance(int value, ClubLevel clubLevel) : base(value, value.ToString()) { this.ClubLevel = clubLevel; }
public int Delete(ClubLevel _clubLevel) { return(clubLevelProviderRepository.Delete(_clubLevel)); }
public int Update(ClubLevel _clubLevel) { return(clubLevelProviderRepository.Update(_clubLevel)); }
public int Insert(ClubLevel _clubLevel) { return(clubLevelProviderRepository.Insert(_clubLevel)); }
public virtual bool HasLevel(ClubLevel level) { return(this.GetLevel() >= level); }
public Subscription(ClubLevel level, DateTime expires) : this() { this.ExpireTime = expires; this.ClubLevel = level; }