public static Urgency CreateUrgency(int value, string name)
 {
     var u = new Urgency {Value = value, UrgencyName = name};
     DAL.SqlRepository.Urgencies.Add(u);
     DAL.SqlRepository.Save();
     return u;
 }
Beispiel #2
0
        /// <summary>
        /// Method to add new task to the database
        /// </summary>
        /// <param name="task">Create using a simple constructor</param>
        public static Task CreateTask(DateTime beginDate, DateTime endDate, string urgencyName, string importanceName,
                    Importance importance, Urgency urgency, int criteriaId, Criteria criteria, string description, Task parent, int parentId)
        {
            var set = DAL.SqlRepository.Tasks;
            var task = (Task)set.Create(typeof(Task));

            task.BeginDate = beginDate;
            task.EndDate = endDate;
            task.Urgency = urgency;
            task.UrgencyName = urgencyName;
            task.Importance = importance;
            task.ImportanceName = importanceName;
            task.Criteria = criteria;
            task.CriteriaId = criteriaId;
            task.Description = description;
            task.Parent = parent;
            task.ParentId = parentId;

            DAL.SqlRepository.Tasks.Add(task);
            DAL.SqlRepository.Save();

            return task;
        }
 protected bool Equals(Urgency other)
 {
     return string.Equals(UrgencyName, other.UrgencyName) && Value == other.Value;
 }
Beispiel #4
0
        /// <summary>
        /// Method to add new step to the database
        /// </summary>
        /// <param name="step">Create using a simple constructor</param>
        public static Step CreateStep(DateTime beginDate, DateTime endDate, string urgencyName, Urgency urgency,
                    string importanceName, Importance importance, int criteriaId, Criteria criteria,
                    int timeRuleId, TimeRule timeRule, string description, Task parentTask, int taskId, int order)
        {
            var set = DAL.SqlRepository.Steps;
            var step = (Step)set.Create(typeof(Step));

            step.BeginDate = beginDate;
            step.EndDate = endDate;
            step.UrgencyName = urgencyName;
            step.Urgency = urgency;
            step.ImportanceName = importanceName;
            step.Importance = importance;
            step.CriteriaId = criteriaId;
            step.Criteria = criteria;
            step.TimeRuleId = timeRuleId;
            step.TimeRule = timeRule;
            step.Description = description;
            step.ParentTask = parentTask;
            step.TaskId = taskId;
            step.Order = order;

            set.Add(step);
            DAL.SqlRepository.Save();
            return step;
        }