public async Task <JsonResult> TLGetByTAIDOID(string id, string oid, string api) { try { var data = TimerLeftService.GetByTAIDOID(Guid.Parse(id), Guid.Parse(oid), Guid.Parse(api)); return(Success(TimerLeftVM.MsToVMs(data))); } catch { return(Failed(MessageUtility.ServerError())); } }
public async Task <JsonResult> TLRemove() { try { var id = Guid.Parse(Request.Form["id"]); var oid = Guid.Parse(Request.Form["oid"]); var taid = Guid.Parse(Request.Form["taid"]); var api = Guid.Parse(Request.Form["api"]); if (TimerLeftService.Remove(id, oid, taid, api)) { return(Success(id.ToString())); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }
public async Task <JsonResult> TLInsert() { try { var id = Guid.Parse(Request.Form["id"]); var oid = Guid.Parse(Request.Form["oid"]); var taid = Guid.Parse(Request.Form["taid"]); var api = Guid.Parse(Request.Form["api"]); var ca = DateTime.Now; var ts = DateTime.Parse(Request.Form["ts"]); var te = DateTime.Parse(Request.Form["te"]); if (TimerLeftService.Insert(id, oid, taid, api, ca, ts, te)) { return(Success(id.ToString())); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }