public IHttpActionResult Get(string key) { Library.DTO.Notification notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; // authentication int?UserID = fwBll.GetUserIDFromSecreteKey(key, out notification); if (UserID.HasValue) { object data = executor.CustomFunction(UserID.Value, "get-message", new Hashtable(), out notification); return(Ok(data)); } else { notification.Type = Library.DTO.NotificationType.Error; notification.Message = "Invalid key!"; } return(Ok(new Library.DTO.ReturnData <object>() { Data = null, Message = notification })); }
public IHttpActionResult GetQAQCByUserID(string strUserID) { Library.DTO.Notification notification = new Library.DTO.Notification(); int? UserID = fwBll.GetUserIDFromSecreteKey(strUserID, out notification); object data = null; if (UserID.HasValue) { // authentication if (!fwBll.CanPerformAction(UserID.Value, moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } System.Collections.Hashtable inputs = new System.Collections.Hashtable(); data = executor.CustomFunction(UserID.Value, "api-get-qaqc-by-userid", inputs, out notification); } return(Ok(data)); }