/// <summary> /// Initializes a new instance of the <see cref="ApiTask" /> class. /// </summary> /// <param name="dynamicProperties">dynamicProperties.</param> /// <param name="id">id.</param> /// <param name="title">title.</param> /// <param name="description">description.</param> /// <param name="requestGuid">requestGuid.</param> /// <param name="status">status.</param> /// <param name="serviceType">serviceType.</param> /// <param name="comments">comments.</param> /// <param name="allComments">allComments.</param> /// <param name="errorMessage">errorMessage.</param> /// <param name="lastModifiedTime">lastModifiedTime.</param> /// <param name="taskType">taskType.</param> /// <param name="allowReassign">allowReassign.</param> /// <param name="allowEdit">allowEdit.</param> /// <param name="dynamicActions">dynamicActions.</param> public ApiTask(ApiTaskDynamicProperties dynamicProperties = default(ApiTaskDynamicProperties), Guid id = default(Guid), string title = default(string), string description = default(string), Guid requestGuid = default(Guid), TaskResult status = default(TaskResult), ServiceType serviceType = default(ServiceType), string comments = default(string), List <TaskComment> allComments = default(List <TaskComment>), string errorMessage = default(string), DateTime lastModifiedTime = default(DateTime), TaskType taskType = default(TaskType), bool allowReassign = default(bool), bool allowEdit = default(bool), List <TaskDynamicActions> dynamicActions = default(List <TaskDynamicActions>)) { this.DynamicProperties = dynamicProperties; this.Title = title; this.Description = description; this.Comments = comments; this.AllComments = allComments; this.ErrorMessage = errorMessage; this.DynamicActions = dynamicActions; this.DynamicProperties = dynamicProperties; this.Id = id; this.Title = title; this.Description = description; this.RequestGuid = requestGuid; this.Status = status; this.ServiceType = serviceType; this.Comments = comments; this.AllComments = allComments; this.ErrorMessage = errorMessage; this.LastModifiedTime = lastModifiedTime; this.TaskType = taskType; this.AllowReassign = allowReassign; this.AllowEdit = allowEdit; this.DynamicActions = dynamicActions; }
public GetPlayerProfileResponse(Guid playerId, string displayName, TaskType?defaultTaskType, string defaultRealm) { PlayerId = playerId; DisplayName = displayName; DefaultTaskType = defaultTaskType; DefaultRealm = defaultRealm; }
private async Task DoSearch() { TaskType?taskTypeFilter = ComboBoxTaskType.SelectedItem != null ? (TaskType)(ComboBoxTaskType.SelectedItem) : (TaskType?)null; TaskList = new TaskIncrementalLoad( TextBoxTaskTitleSearch.Text, taskTypeFilter, CheckBoxShowInactive.IsChecked.Value); await TaskList.LoadMoreItemsAsync(); taskList.ItemsSource = TaskList; }
public IActionResult ByName(string username, string search, TaskType?type, bool?isActive) { ProfileViewModel viewModel; if (type != null) { search = search == null ? string.Empty : search; viewModel = this.profileService.GetProfileInfoByNameWithSearch(username, search, (TaskType)type, isActive); } else { viewModel = this.profileService.GetProfileInfoByName(username); } viewModel.HelpTasks = viewModel.HelpTasks.Reverse(); return(this.View(viewModel)); }
public void GivenValidProfileValues_UpdatesPlayerInDatabase(string name, TaskType?taskType, string realm) { // Arrange var player = new Player(); Context.Players.Add(player); Context.SaveChanges(); var dto = new SetPlayerProfileRequest(player.Id, name, taskType, realm); // Act var result = _controller.SetPlayerProfile(dto); // Assert var foundPlayer = Context.Players.Find(result.Value); foundPlayer.DisplayName.Should().Be(name); foundPlayer.DefaultTaskType.Should().Be(taskType); foundPlayer.DefaultRealm.Should().Be(realm); }
/// <summary> /// Initializes a new instance of the <see cref="TaskList" /> class. /// </summary> /// <param name="id">id.</param> /// <param name="title">title.</param> /// <param name="requester">requester.</param> /// <param name="requestTicketNumber">requestTicketNumber.</param> /// <param name="requesterDisplayName">requesterDisplayName.</param> /// <param name="dueDate">dueDate.</param> /// <param name="dueDateType">dueDateType.</param> /// <param name="serviceType">serviceType.</param> /// <param name="serviceTypeDescription">serviceTypeDescription.</param> /// <param name="createdTime">createdTime.</param> /// <param name="taskType">taskType.</param> /// <param name="status">status.</param> /// <param name="statusDescription">statusDescription.</param> public TaskList(Guid id = default(Guid), string title = default(string), string requester = default(string), int requestTicketNumber = default(int), string requesterDisplayName = default(string), DateTime?dueDate = default(DateTime?), DueDateType?dueDateType = default(DueDateType?), ServiceType?serviceType = default(ServiceType?), string serviceTypeDescription = default(string), DateTime createdTime = default(DateTime), TaskType?taskType = default(TaskType?), TaskResult?status = default(TaskResult?), string statusDescription = default(string)) { this.Id = id; this.Title = title; this.Requester = requester; this.RequestTicketNumber = requestTicketNumber; this.RequesterDisplayName = requesterDisplayName; this.DueDate = dueDate; this.DueDateType = dueDateType; this.ServiceType = serviceType; this.ServiceTypeDescription = serviceTypeDescription; this.CreatedTime = createdTime; this.TaskType = taskType; this.Status = status; this.StatusDescription = statusDescription; }
public TaskList Get(int page, int pagesize, string title = "", TaskType?taskType = null, bool showInActive = false) { return(new TaskBF(DB).List(page, pagesize, showInActive, title, taskType)); }
/// <summary> /// Initializes a new instance of the <see cref="TaskReport" /> class. /// </summary> /// <param name="id">id.</param> /// <param name="title">title.</param> /// <param name="requester">requester.</param> /// <param name="requesterLoginName">requesterLoginName.</param> /// <param name="requesterDisplayName">requesterDisplayName.</param> /// <param name="requestTicketNumber">requestTicketNumber.</param> /// <param name="dueDate">dueDate.</param> /// <param name="dueDateType">dueDateType.</param> /// <param name="serviceType">serviceType.</param> /// <param name="serviceTypeDescription">serviceTypeDescription.</param> /// <param name="createdTime">createdTime.</param> /// <param name="taskType">taskType.</param> /// <param name="status">status.</param> /// <param name="statusDescription">statusDescription.</param> /// <param name="isApproveTask">isApproveTask.</param> /// <param name="assignee">assignee.</param> /// <param name="assigneeLoginName">assigneeLoginName.</param> /// <param name="assigneeDisplayName">assigneeDisplayName.</param> public TaskReport(Guid id = default(Guid), string title = default(string), string requester = default(string), string requesterLoginName = default(string), string requesterDisplayName = default(string), int requestTicketNumber = default(int), DateTime?dueDate = default(DateTime?), DueDateType?dueDateType = default(DueDateType?), ServiceType?serviceType = default(ServiceType?), string serviceTypeDescription = default(string), DateTime createdTime = default(DateTime), TaskType?taskType = default(TaskType?), TaskResult?status = default(TaskResult?), string statusDescription = default(string), bool isApproveTask = default(bool), string assignee = default(string), string assigneeLoginName = default(string), string assigneeDisplayName = default(string)) { this.Id = id; this.Title = title; this.Requester = requester; this.RequesterLoginName = requesterLoginName; this.RequesterDisplayName = requesterDisplayName; this.RequestTicketNumber = requestTicketNumber; this.DueDate = dueDate; this.DueDateType = dueDateType; this.ServiceType = serviceType; this.ServiceTypeDescription = serviceTypeDescription; this.CreatedTime = createdTime; this.TaskType = taskType; this.Status = status; this.StatusDescription = statusDescription; this.IsApproveTask = isApproveTask; this.Assignee = assignee; this.AssigneeLoginName = assigneeLoginName; this.AssigneeDisplayName = assigneeDisplayName; }
public TaskList List(int page, int pagesize, bool showInActive, string title = "", TaskType?taskType = null) { try { IQueryable <TaskListModel> tasks = from task in db.Tasks where (title == "" || task.Title.ToLower().Contains(title.ToLower())) && (!taskType.HasValue || task.TaskType == taskType.Value) && (showInActive || task.IsActive) select new TaskListModel { ID = task.ID, Title = task.Title, TaskType = task.TaskType }; int recCount = tasks.Count(); int fetchCount = pagesize; if (pagesize == 0) { fetchCount = recCount; } else if ((page + 1) * pagesize > recCount) { fetchCount = recCount - page * pagesize; } if (fetchCount > 0) { var results = tasks.OrderByDescending(c => c.ID) .Skip(page * pagesize) .Take(fetchCount) .ToList(); return(new TaskList { RecordCount = recCount, Data = results }); } else { return(new TaskList()); } } catch (Exception ex) { throw ex; } }
public TaskIncrementalLoad(string title, TaskType?taskType, bool showInactive) { this.title = title; this.taskType = taskType; this.showInactive = showInactive; }
internal static async Task <TasksListAPI> Get( int page, int pageSize, bool showInActive, string title = "", TaskType?taskType = null) { TasksListAPI data = null; HttpBaseProtocolFilter RootFilter = new HttpBaseProtocolFilter(); RootFilter.CacheControl.ReadBehavior = HttpCacheReadBehavior.MostRecent; RootFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache; using (HttpClient client = new HttpClient(RootFilter)) { Uri uri = null; if (title == null || title.Length == 0) { if (!taskType.HasValue) { uri = new Uri(string.Format( "{0}/{1}?page={2}&pagesize={3}&showInActive={4}", AppSettings.ServerUrl, APICommon.TASK_PATH, page, pageSize, showInActive)); } else { uri = new Uri(string.Format( "{0}/{1}?page={2}&pagesize={3}&showInActive={4}&taskType={5}", AppSettings.ServerUrl, APICommon.TASK_PATH, page, pageSize, showInActive, taskType.Value)); } } else { if (!taskType.HasValue) { uri = new Uri(string.Format( "{0}/{1}?page={2}&pagesize={3}&showInActive={4}&title={5}", AppSettings.ServerUrl, APICommon.TASK_PATH, page, pageSize, showInActive, title)); } else { uri = new Uri(string.Format( "{0}/{1}?page={2}&pagesize={3}&showInActive={4}&title={5}&taskType={6}", AppSettings.ServerUrl, APICommon.TASK_PATH, page, pageSize, showInActive, title, taskType.Value)); } } try { var response = await client.GetStringAsync(uri); DataContractJsonSerializer js = new DataContractJsonSerializer(typeof(TasksListAPI)); MemoryStream ms = new MemoryStream(System.Text.ASCIIEncoding.ASCII.GetBytes(response)); data = (TasksListAPI)js.ReadObject(ms); } catch (Exception ex) { throw ex; } return(data); } }