/// <summary> /// Constructor 3 /// </summary> public Task(String year, String hour, String sec, String description, PriorityTypes priorityType) { this.date = year; this.hour = hour; this.sec = sec; this.description = description; this.priorityType = priorityType; }
private PriorityTypes ReadUnit (out bool success) { success = false; PriorityTypes unit = PriorityTypes.Normal; if (cmbUnit.SelectedIndex >= 0) { success = true; unit = (PriorityTypes)cmbUnit.SelectedIndex; } else GiveMessage("Wrong unit!"); return unit; }
public List <IssueInfo> GetIssuesByCriteria(int issueId = 0, string subject = "", StatusTypes status = StatusTypes.None, PriorityTypes priority = PriorityTypes.None, string assignTo = "", DateTime?dueDate = null) { using (var conn = GetSqlConnection()) { List <IssueInfo> infos = conn.Query <IssueInfo>("usp_IssueGet", new { issueId, subject, status, priorityId = priority, assignTo, dueDate }, commandType: CommandType.StoredProcedure).AsList(); return(infos); } }
public void CreateTask(ToDoListModel toDoList, CategoryTypes category, PriorityTypes priority, DateTime expirationDate, string task) { Guard.WhenArgument(toDoList, "To-Do List").IsNull().Throw(); Guard.WhenArgument(expirationDate, "Expiration Date").IsLessThan(DateTime.Now.Date).Throw(); Guard.WhenArgument(task, "Task").IsNullOrEmpty().Throw(); var taskToBeAdded = new ToDoListTask() { Task = task, ExpirationDate = expirationDate, Category = category, Priority = priority }; toDoList.Tasks.Add(taskToBeAdded); unitOfWork.Commit(); }
private void AddBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(TaskName.Text) || (AssignedToUser.SelectedIndex == -1) || (Priority.SelectedIndex == -1) || (StartDate.Date == null) || (EndDate.Date == null)) { ErrorTxt.Text = "Enter all the fields!"; } else if (StartDate.Date > EndDate.Date) { ErrorTxt.Text = "Start Date cannot exceed End date!"; } else { TaskModel task = new TaskModel(); task.AssignedToUser = AssignedToUser.SelectedValue.ToString(); task.AssignedByUser = App.CurrentUser; task.TaskName = TaskName.Text; PriorityTypes priority = (PriorityTypes)Enum.Parse(typeof(PriorityTypes), Priority.SelectedItem.ToString()); task.Priority = (int)priority; task.StartDate = (DateTimeOffset)StartDate.Date; task.EndDate = (DateTimeOffset)EndDate.Date; task.Description = DescriptionTxt.Text; task.TaskId = DateTime.Now.Ticks; TaskDB.AddTask(task); ErrorTxt.Text = "Successfully Added!"; int index = Users.FindIndex(user => user.Username.Equals(App.CurrentUser.ToString())); AssignedToUser.ItemsSource = Users; AssignedToUser.DisplayMemberPath = "Username"; AssignedToUser.SelectedValuePath = "Username"; AssignedToUser.SelectedIndex = index; var enumval = Enum.GetValues(typeof(PriorityTypes)).Cast <PriorityTypes>(); Priority.ItemsSource = enumval.ToList(); Priority.SelectedIndex = 1; StartDate.Date = DateTime.Today; EndDate.Date = DateTime.Today; TaskName.Text = ""; DescriptionTxt.Text = ""; } }
private void SaveBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(TaskName.Text) || (AssignedToUser.SelectedIndex == -1) || (Priority.SelectedIndex == -1) || (StartDate.Date == null) || (EndDate.Date == null)) { ErrorTxt.Text = "Enter all the fields!"; } else if (StartDate.Date > EndDate.Date) { ErrorTxt.Text = "Start Date cannot exceed End date!"; } else { ErrorTxt.Text = "Successfully Updated!"; if ((DateTimeOffset)StartDate.Date != task.StartDate) { TaskDB.UpdateStartDate(task.TaskId, (DateTimeOffset)StartDate.Date); } if ((DateTimeOffset)EndDate.Date != task.EndDate) { TaskDB.UpdateEndDate(task.TaskId, (DateTimeOffset)EndDate.Date); } PriorityTypes priority = (PriorityTypes)Enum.Parse(typeof(PriorityTypes), Priority.SelectedItem.ToString()); if ((int)priority != task.Priority) { TaskDB.UpdatePriority(task.TaskId, (int)priority); } if (!DescriptionTxt.Text.Equals(task.Description)) { TaskDB.UpdateDescription(task.TaskId, DescriptionTxt.Text); } string currAssignedTo = AssignedToUser.SelectedValue.ToString(); if (!currAssignedTo.Equals(task.AssignedToUser)) { TaskDB.UpdateAssignedTo(task.TaskId, currAssignedTo); } } }
/// <summary> /// Simple set method /// </summary> public void SetPriorityType(PriorityTypes priorityType) { this.priorityType = priorityType; }
private void DefaultValues() { date = DateTime.Now; description = "string.empty"; priority = PriorityTypes.Normal; }
public TodoTask(TodoTask theOther) { description = theOther.description; unit = theOther.unit; }
public TodoTask(string name, PriorityTypes unit) { this.description = name; this.unit = Unit; }
public SpeakerPriority(PriorityTypes PriorityType, string Name) { this.PriorityType = PriorityType; this.Name = Name; }
public void AddEvent(PriorityTypes type, Func <EVENT_RETURN> e, int interval_ms, int delay_ms, string identifier = "null") { AddEvent(type, new GameEvent(e, interval_ms, delay_ms, identifier)); }
public void AddEvent(PriorityTypes type, GameEvent e) { queue[(int)type].Add(e); }
/// <summary> /// отрисовка всех знаков приоритета в зависимости от типа приоритетов /// </summary> /// <param name="PriorityType">тип приоритетов движения</param> private void DrawSigns(PriorityTypes PriorityType) { var cross = Envirmnt.Inst.Cross; var clMap = Envirmnt.Inst.CellMap; //пешеходный переход PaintCell(Pictures.signCrosswalk, clMap[14 - cross.LinesVertical][27]); PaintCell(Pictures.signCrosswalk, clMap[16 + cross.LinesVertical][29]); //знаки кругового движения PaintCell(Pictures.signRing, clMap[16 + cross.LinesVertical][28]); PaintCell(Pictures.signRing, clMap[2][16 + cross.LinesHorisontal]); PaintCell(Pictures.signRing, clMap[14 - cross.LinesVertical][2]); PaintCell(Pictures.signRing, clMap[28][14 - cross.LinesHorisontal]); Image prTypeSign = null; //списко картинок других знаков по часовой стрелке Image[] otherSigns = new Image[8]; switch (Envirmnt.Inst.Cross.PriorityType) { case PriorityTypes.MainRing: prTypeSign = Pictures.signMainRing; otherSigns[0] = otherSigns[2] = otherSigns[4] = otherSigns[6] = Pictures.signYieldVertical; otherSigns[1] = otherSigns[3] = otherSigns[5] = otherSigns[7] = Pictures.signMain; break; case PriorityTypes.SecondaryRing: prTypeSign = null; otherSigns[0] = otherSigns[2] = otherSigns[4] = otherSigns[6] = Pictures.signMain; otherSigns[1] = otherSigns[3] = otherSigns[5] = otherSigns[7] = Pictures.signYieldVertical; break; case PriorityTypes.MainStreetHorisontal: prTypeSign = Pictures.signMainHorisontal; otherSigns[0] = otherSigns[4] = otherSigns[6] = Pictures.signYieldVertical; otherSigns[1] = otherSigns[3] = otherSigns[5] = otherSigns[7] = Pictures.signMain; otherSigns[2] = Pictures.signMain; otherSigns[3] = Pictures.signYieldVertical; break; case PriorityTypes.MainStreetVertical: prTypeSign = Pictures.signMainHorisontal; otherSigns[0] = otherSigns[2] = otherSigns[6] = Pictures.signYieldVertical; otherSigns[1] = otherSigns[3] = otherSigns[7] = Pictures.signMain; otherSigns[4] = Pictures.signMain; otherSigns[5] = Pictures.signYieldVertical; break; } //отрисовка схемы приоритетов PaintCell(prTypeSign, clMap[14 - cross.LinesVertical][3]); PaintCell(prTypeSign, clMap[27][14 - cross.LinesHorisontal]); PaintCell(prTypeSign, clMap[16 + cross.LinesVertical][27]); PaintCell(prTypeSign, clMap[3][16 + cross.LinesHorisontal]); //отрисовка других знаков PaintCell(otherSigns[0], clMap[14 - cross.LinesVertical][4]); PaintCell(otherSigns[1], clMap[15][4]); PaintCell(otherSigns[2], clMap[26][14 - cross.LinesHorisontal]); PaintCell(otherSigns[3], clMap[26][15]); PaintCell(otherSigns[4], clMap[16 + cross.LinesVertical][26]); PaintCell(otherSigns[5], clMap[15][26]); PaintCell(otherSigns[6], clMap[4][16 + cross.LinesHorisontal]); PaintCell(otherSigns[7], clMap[4][15]); }