public String Replay(int hold_id, int u_id, string replay) { Result result = new Result(); try { User user = iuser.GetUser(u_id); Hold hold = ihold.GetHold(hold_id); if (replay == null) { hold.h_replay = String.Empty; } else { hold.h_replay = replay.Replace(" ", String.Empty); } hold.h_replay_by = user.u_id; hold.h_replay_date = DateTime.Now; ihold.Update(hold); result.Objects = null; result.Message = "Success"; return(JsonConvert.SerializeObject(result)); } catch (Exception ex) { result.Objects = null; result.Message = ex.Message; return(JsonConvert.SerializeObject(result)); } }
public ActionResult Replay(int id, string replay) { if (getCurrentUser() == null) { return(RedirectToAction("Index", "Login")); } else { Hold hold = ihold.GetHold(id); if (replay == null) { hold.h_replay = String.Empty; } else { hold.h_replay = replay.Replace(" ", String.Empty); } hold.h_replay_by = getCurrentUser().u_id; hold.h_replay_date = DateTime.Now; ihold.Update(hold); return(new EmptyResult()); } }