Update() public method

public Update ( ) : void
return void
Exemplo n.º 1
0
 public IActionResult Edit(int id, Room room)
 {
     if (id != room.Id)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         room.Action     = Actions.ActionUpdate;
         room.ActionDate = DateTime.Now.ToString("F");
         room.ActionBy   = "Me";
         room.IsDelete   = 0;
         string updated = roomManager.Update(room);
         ViewData["Message"] = updated;
         ModelState.Clear();
         if (updated.Equals("1"))
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ViewData["Message"] = updated;
             return(View(room));
         }
     }
     else
     {
         ViewData["Message"] = Message.Warning("Fill up all fields correctly");
         //get by id
         Room roomModel = roomManager.GetById(room.Id);
         return(View(roomModel));
     }
 }
Exemplo n.º 2
0
 public ActionResult Edit(RoomEntity room)
 {
     try
     {
         RoomManager.Update(room);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Edit(Room room)
        {
            ModelState.Remove("CreatedOn");
            ModelState.Remove("ModifiedOn");
            ModelState.Remove("ModifiedUsername");

            if (ModelState.IsValid)
            {
                Room db_room = roomManager.Find(x => x.Id == room.Id);
                db_room.CategoryId  = room.CategoryId;
                db_room.Title       = room.Title;
                db_room.Description = room.Description;
                db_room.IsAdmin     = room.IsAdmin;
                db_room.IsKullanici = room.IsKullanici;
                db_room.IsYetkili   = room.IsYetkili;
                db_room.IsYonetici  = room.IsYonetici;

                roomManager.Update(db_room);
                return(RedirectToAction("Index"));
            }
            ViewBag.CategoryId = new SelectList(categoryManager.List(), "Id", "Title", room.CategoryId);
            return(View(room));
        }
Exemplo n.º 4
0
 /// <summary>
 /// 处理定时器事件
 /// 当服务端很久没有收到MsgPing时, 可以认为连接已经断开。在服务端的定时事件中(EventHandler的OnTimer方法)编写心跳机制的处理函数。CheckPing方法会遍历所有的客户端信息, 然后判断连接是否超时。
 /// </summary>
 public static void OnTimer()
 {
     CheckPing();
     RoomManager.Update();
 }
Exemplo n.º 5
0
 internal override void Update(GameTime _GT)
 {
     mRoomManager.Update(_GT);
     mUIManager.Update(_GT);
     base.Update(_GT);
 }
Exemplo n.º 6
0
 public void Post([FromBody] Room room)
 {
     _repo.Update(room.RoomID, room);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            RoomManager.Update(gameTime);
        }