Beispiel #1
0
        public string CreateTask(int TaskTo, long ProjectId, string TaskTitle, string StartingDate, string FinishingDate)
        {
            TaskManager newTask = new TaskManager();
            newTask.TaskTo = TaskTo;
            newTask.ProjectId = ProjectId;
            newTask.Tite = TaskTitle;
            newTask.TaskDate = DateTime.Now;
            newTask.StartingDate = Convert.ToDateTime(StartingDate);
            newTask.FinishingDate = Convert.ToDateTime(FinishingDate);
            newTask.Status = Domain.EnumStatus.Ongoing;

            if (itService.CreateTask(newTask))
            {
                return "Success";
            }
            else
            {
                return "Failed";
            }
        }
Beispiel #2
0
        public string EditTask(int id, int TaskTo, string TaskTitle, string StartingDate, string FinishingDate,int Status)
        {
            EnumStatus enumDisplayStatus = (EnumStatus)Status;
            string StatusValue = enumDisplayStatus.ToString();

            string[] date1 = StartingDate.Split(' ');
            string[] date2 = FinishingDate.Split(' ');
            string[] dateString = date1[0].Split('/');
            DateTime start_date = Convert.ToDateTime(dateString[1] + "/" + dateString[0] + "/" + dateString[2]);

            string[] dateString1 = date2[0].Split('/');
            DateTime end_date = Convert.ToDateTime(dateString1[1] + "/" + dateString1[0] + "/" + dateString1[2]);

            var task = new TaskManager();
            task.Id = id;
            task.TaskTo = TaskTo;
            task.Tite = TaskTitle;
            task.StartingDate = start_date;
            task.FinishingDate = end_date;
            task.Status = (EnumStatus)Enum.Parse(typeof(EnumStatus), StatusValue, true);
               // task.Status = EnumStatus.stringValue;
            if (itService.UpdateTask(task))
            {
                return "Success";
            }
            else
            {
                return "Failed";
            }
        }