public static Importance CreateImportance(int value, string name)
 {
     var i = new Importance();
     i.Value = value;
     i.ImportanceName = name;
     DAL.SqlRepository.Importancies.Add(i);
     DAL.SqlRepository.Save();
     return i;
 }
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;
        }
Beispiel #3
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;
        }
 protected bool Equals(Importance other)
 {
     return string.Equals(ImportanceName, other.ImportanceName) && Value == other.Value;
 }