public void LoadTasks() { TasksList.Clear(); using (SqlCommand cmd = new SqlCommand("get_tasks_by_date", Conn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@dt", ChosenDate); Conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { var task = new TaskModel(); task.Id = Convert.ToInt32(reader["id"]); task.Content = reader["content"].ToString(); task.IsDone = Convert.ToBoolean(reader["is_done"]); task.Date = Convert.ToDateTime(reader["dt"]).Date; TasksList.Add(task); } } reader.Close(); Conn.Close(); } Change_TasksState(); }
/// <summary> /// Обработка события прокрутки влево или вправо. /// </summary> /// <param name="sender">источник вызова</param> /// <param name="e">дополнительные параметры</param> private async void OnSwipeEnded(object sender, EventArgs e) { //Удаление задачи для прокрутки вправо if ((e as SwipeEndedEventArgs).SwipeDirection == SwipeDirection.Right) { bool accept = await DisplayAlert("Удалить задачу?", "Задача будет удалена из Вашего списка.", "ОК", "Отмена"); if (accept) { IsCheckBoxEventExecuted = false; Task task = ((sender as SwipeView).Parent as ViewCell).BindingContext as Task; TasksList.Remove(task); User.Tasks.Remove(task); User.DeletedTasks.Add(task); RefreshCategories(); } } //Редактирование задачи для прокрутки влево else if ((e as SwipeEndedEventArgs).SwipeDirection == SwipeDirection.Left) { if ((((sender as SwipeView).Parent as ViewCell).BindingContext as Task).IsCompleted) { await DisplayAlert("Вы уже выполнили задачу", "Нельзя изменить завершенную задачу", "OK"); } else { await Navigation.PushAsync(new EditTaskPage(((sender as SwipeView).Parent as ViewCell).BindingContext as Task)); } } (sender as SwipeView).Close(); IsCheckBoxEventExecuted = true; }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks.Add(TaskDestroy.Require <ObjectMineralGiantPragmiumSource>(count: 1));; prerequisites .Add <QuestMinePragmiumSource>(); }
protected override void PrepareAchievement(TasksList tasks) { foreach (var protoSkill in Api.FindProtoEntities <IProtoSkill>()) { tasks.Add(TaskHaveSkill.Require(protoSkill, minLevel: 1)); } }
public virtual void ShowTaskCursor(TasksList tasksList, int option) { if (!GetLanguage) options = camps; else options = campos; //Program body try { int contCamps = 0; config.WriteFore((Console.WindowWidth / 2 + 2), 4, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 4, checkVacio(tasks.Get(option).Description), "gray", true); contCamps++; Console.WriteLine(); config.WriteFore((Console.WindowWidth / 2 + 2), 7, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 7, checkVacio(tasks.Get(option).DateStart), "gray", true); contCamps++; config.WriteFore((Console.WindowWidth / 2 + 2), 8, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 8, checkVacio(tasks.Get(option).DateDue), "gray", true); contCamps++; Console.WriteLine(); config.WriteFore((Console.WindowWidth / 2 + 2), 10, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 10, checkVacio(tasks.Get(option).Category), "gray", true); contCamps++; config.WriteFore((Console.WindowWidth / 2 + 2), 12, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 12, checkVacio(tasks.Get(option).Priority), "gray", true); contCamps++; config.WriteFore((Console.WindowWidth / 2 + 2), 14, options[contCamps], "white", false); config.WriteFore( (Console.WindowWidth / 2 + (options[contCamps].Length + 4)), 14, checkVacio(tasks.Get(option).Confidential), "gray", true); contCamps = 0; } catch (Exception e) { Console.WriteLine("Error: " + e.Message); } }
public int PostAddList(TasksList list) { list.UserId = this.userId; int listId = repository.AddList(list); return(listId); }
protected sealed override void PrepareProto() { var tasks = new TasksList(); var prerequisites = new QuestsList(); var tempHints = HintsList.GetTempList(); if (!string.IsNullOrEmpty(this.Hints)) { tempHints.Add(this.Hints); } this.PrepareQuest(prerequisites, tasks, tempHints); Api.Assert(tasks.Count >= 1, "At least one task required for a quest"); Api.Assert(tasks.Count <= 256, "Max 256 tasks per quest"); Api.Assert(prerequisites.Count <= 256, "Max 256 prerequisites per quest"); foreach (var task in tasks) { task.TaskTarget = this; } this.Tasks = tasks; this.Prerequisites = prerequisites; this.cachedHints = tempHints.ToString(); tempHints.Clear(); }
protected sealed override void PrepareProto() { var tasks = new TasksList(); var prerequisites = new QuestsList(); // ReSharper disable once LocalVariableHidesMember var hintsList = new HintsList(); if (!string.IsNullOrEmpty(this.Hints)) { hintsList.Add(this.Hints); } this.PrepareQuest(prerequisites, tasks, hintsList); Api.Assert(tasks.Count >= 1, "At least one task required for a quest"); Api.Assert(tasks.Count <= 256, "Max 256 tasks per quest"); Api.Assert(prerequisites.Count <= 256, "Max 256 prerequisites per quest"); foreach (var task in tasks) { task.TaskTarget = this; } this.Tasks = tasks; this.Prerequisites = prerequisites; this.hintsList = hintsList; }
protected override void PrepareAchievement(TasksList tasks) { foreach (var protoPlant in Api.FindProtoEntities <IProtoObjectPlant>()) { tasks.Add(TaskGather.Require(protoPlant)); } }
public async Task <IActionResult> Edit(int id, [Bind("Id,TaskName,TaskInfo,TaskPrority,DateCreated,DueDate,IsComplete")] TasksList tasksList) { if (id != tasksList.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tasksList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TasksListExists(tasksList.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tasksList)); }
protected void FillData() { //Bind List Items to Tasks List DropDown Control by id TasksList.DataSource = CurrentSite.Web.Lists.TryGetList("TestList").Items; TasksList.DataValueField = "Title"; TasksList.DataTextField = "Title"; TasksList.DataBind(); SPListItem item = CurrentSite.Web.Lists.TryGetList("TestList").Items[0]; ClearTextBoxes(); //Fill textboxes NameText.Text = item["Task Name"].ToString(); //If fields in tasks list is null(cause try catch is very heavy) if (item["Start Date"] is DateTime) { StartDate.SelectedDate = (DateTime)item["Start Date"]; } if (item["Due Date"] is DateTime) { DueDate.SelectedDate = (DateTime)item["Due Date"]; } if (item["% Complete"] is Double) { CompleteBox.Text = item["% Complete"].ToString(); } }
public static void Init() { // Get existing open window or if none, make a new one: _window = ( TasksList )EditorWindow.GetWindow(typeof(TasksList)); // This is silly since OnEnable will do this but avoid the warning about unused _window variable. _window.titleContent.text = "Tasks"; }
protected override void PrepareAchievement(TasksList tasks) { foreach (var protoQuest in QuestsSystem.AllQuests) { tasks.Add(TaskCompleteQuest.Require(protoQuest)); } }
protected override void PrepareAchievement(TasksList tasks) { tasks .Add(TaskKill.Require <MobMutantBoar>()) .Add(TaskKill.Require <MobMutantWolf>()) .Add(TaskKill.Require <MobMutantHyena>()); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { var recipeMusket = Api.GetProtoEntity <RecipeMusket>(); var recipeFlintlockPistol = Api.GetProtoEntity <RecipeFlintlockPistol>(); tasks .Add(TaskBuildStructure.Require <ObjectWeaponWorkbench>()) .Add(TaskCraftRecipe.RequireStationRecipe <RecipeAmmoPaperCartridge>( description: CraftPaperCartridge)) .Add(TaskCraftRecipe.RequireStationRecipe( new List <Recipe.RecipeForStationCrafting>() { recipeMusket, recipeFlintlockPistol }, description: CraftMusketOrFlintlockPistol) .WithIcon(ClientItemIconHelper.CreateComposedIcon(this.ShortId, recipeFlintlockPistol.Icon, recipeMusket.Icon))) .Add(TaskUseItem.Require <IProtoItemWeaponRanged>( description: FireTheWeapon)); prerequisites .Add <QuestUseCrowbarAndDeconstructBuilding>(); }
protected override void PrepareAchievement(TasksList tasks) { tasks .Add(TaskCraftRecipe.RequireStationRecipe <RecipeAxeSteel>()) .Add(TaskCraftRecipe.RequireStationRecipe <RecipePickaxeSteel>()) .Add(TaskCraftRecipe.RequireStationRecipe <RecipeToolboxT3>()); }
internal async System.Threading.Tasks.Task CreateTaskAsync() { if (NewTaskName == "") { ErrorMessage = "Please enter the new task's name"; } else if (TaskNameIsInUse()) { ErrorMessage = "That task name is already in use"; } else { var values = new Dictionary <string, string> { { "description", NewTaskName } }; var content = new FormUrlEncodedContent(values); var result = await Client.HttpClient.PostAsync("http://localhost:65177/api/Task/", content); if (result.StatusCode == HttpStatusCode.OK) { TasksList.Add(new Model.Task() { Description = NewTaskName }); } } }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskKill.Require <MobColdBear>(count: 1)); prerequisites .Add <QuestKillAngryPangolins>(); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskKill.Require <MobAngryPangolin>(count: 10)); prerequisites .Add <QuestMasterHunter6>(); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks.Add(TaskDestroy.Require <ObjectMineralPragmiumSource>(count: 5));; prerequisites .Add <QuestMineMoreMineralsStage3>() .Add <QuestAcquirePragmium>(); }
public void UpdateToDo(TasksList taskList) { var updateToDo = toDoApplication.TasksLists.FirstOrDefault(c => c.id == taskList.id); updateToDo.TaskCreationDate = taskList.TaskCreationDate; updateToDo.TaskNotes = updateToDo.TaskNotes; toDoApplication.SaveChanges(); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskCraftRecipe.RequireHandRecipe <RecipePickaxeStone>()); prerequisites .Add <QuestChopDownATree>(); }
private void btnTasks_Click(object sender, EventArgs e) { Hide(); var allTaskForm = new TasksList(); allTaskForm.ShowDialog(); Close(); }
protected override void PrepareAchievement(TasksList tasks) { tasks .Add(TaskGather.Require <ObjectSmallHerbGreen>()) .Add(TaskGather.Require <ObjectSmallHerbRed>()) .Add(TaskGather.Require <ObjectSmallHerbPurple>()) .Add(TaskGather.Require <ObjectSmallHerbBlue>()); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskDestroy.Require <IProtoObjectTree>(count: 3, description: this.Name)); prerequisites .Add <QuestCraftAnAxe>(); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskBuildStructure.Require <ObjectCampfire>()); prerequisites .Add <QuestCraftAToolbox>(); }
private void ReloadTasks(List <Models.Task> tasks) { tasks = tasks.Where(t => t.StateId != Constant.Finalizar).ToList(); TasksList.Clear(); foreach (var task in tasks) { TasksList.Add(task.Cast <TaskItemViewModel>()); } }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { tasks .Add(TaskHaveTechNode.Require <TechNodeFridgeEvaporator>()) .Add(TaskBuildStructure.Require <ObjectFridgeEvaporator>()); prerequisites .Add <QuestBuildMulchboxAndCraftWateringCan>(); }
public void AddTask(TasksList newTask) { newTask.TaskID = Guid.NewGuid().ToString(); newTask.Done = false; newTask.CreateDate = DateTime.Now; newTask.Priority = 3; db.TasksLists.Add(newTask); db.SaveChanges(); }
protected override void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints) { var listMinerals = Api.FindProtoEntities <IProtoObjectMineral>(); tasks.Add(TaskDestroy.Require(list: listMinerals, count: 2000, description: this.Name)); prerequisites .Add <QuestMineMoreMineralsStage3>(); }