Exemplo n.º 1
0
        private void Get(string mode = "", string sortby = "")
        {
            TaskInfoManager mgr = new TaskInfoManager();
            List <TaskInfo> SortedProjectList;

            TasksInfo = mgr.Get(SearchEntity, TasksInfo, mode);
            string sortbycommand = string.IsNullOrEmpty(sortby) ? "" : Convert.ToString(sortby).ToLower();

            switch (sortbycommand)

            {
            case "startdate":
                SortedProjectList = TasksInfo.OrderBy(o => o.StartDate).ToList();
                TasksInfo         = SortedProjectList;
                break;

            case "enddate":
                SortedProjectList = TasksInfo.OrderBy(o => o.EndDate).ToList();
                TasksInfo         = SortedProjectList;
                break;

            case "priority":
                SortedProjectList = TasksInfo.OrderBy(o => o.Priority).ToList();
                TasksInfo         = SortedProjectList;
                break;

            default:
                break;
            }
            //projectsInfo = students.OrderByDescending(s => s.LastName);
        }
Exemplo n.º 2
0
        private void GetUser(string mode = "")
        {
            TaskInfoManager mgr = new TaskInfoManager();

            SearchUserEntity = new UserInfo();
            Users            = mgr.Get(SearchUserEntity, Users, mode);
        }
Exemplo n.º 3
0
        private void suspend()
        {
            TaskInfoManager mgr = new TaskInfoManager();

            List <TaskInfo> lstUsers = new List <TaskInfo>();

            Entity         = new TaskInfo();
            Entity.Task_Id = Convert.ToInt32(EventArgument);
            //if (mgr.validate(Entity, "delete"))
            {
                Entity        = mgr.GetTaskByID(Entity.Task_Id);
                Entity.Status = true;
                mgr.Update(Entity, "suspend");
            }
            //else
            // {
            //     IsValid = false;
            // }
            ValidationErrors = mgr.ValidationErrors;
            if (ValidationErrors.Count > 0)
            {
                IsValid = false;
            }
            ListMode();
        }
Exemplo n.º 4
0
        private void Delete()
        {
            TaskInfoManager mgr = new TaskInfoManager();

            List <TaskInfo> lstUsers = new List <TaskInfo>();

            Entity            = new TaskInfo();
            Entity.Project_ID = Convert.ToInt32(EventArgument);
            if (mgr.validate(Entity, "delete"))
            {
                mgr.Delete(Entity, out lstUsers);
                TasksInfo = lstUsers;
                Get("Delete");
            }
            else
            {
                IsValid = false;
            }
            ValidationErrors = mgr.ValidationErrors;
            if (ValidationErrors.Count > 0)
            {
                IsValid = false;
            }
            ListMode();
        }
Exemplo n.º 5
0
        private string GetParentTasksbyID(int ParentTaskId)
        {
            TaskInfoManager mgr = new TaskInfoManager();

            parentTaskInfo = mgr.GetAllParentTask();
            ParentTaskInfo result;

            result = parentTaskInfo.First(item => item.ParentTask_ID == ParentTaskId);
            return(result.Parent_Task);
        }
Exemplo n.º 6
0
        private int GetTotalNoTaskCompleted(int ProjectID)
        {
            TaskInfoManager mgr           = new TaskInfoManager();
            TaskInfo        tsearchentity = new TaskInfo();
            List <TaskInfo> result        = new List <TaskInfo>();
            List <TaskInfo> resulttask;

            resulttask = mgr.Get(tsearchentity, result);
            //             = parentTaskInfo.First(item => item.ParentTask_ID == ParentTaskId);
            int taskcount = resulttask.Where(s => s != null && s.Status == true && s.Project_ID == ProjectID).Count();

            return(taskcount);
        }
Exemplo n.º 7
0
        private void Save(string evntArgument)
        {
            try
            {
                //List<TrainingProduct> lstproduct = new List<TrainingProduct>();
                TaskInfoManager mgr = new TaskInfoManager();
                if (string.IsNullOrEmpty(EventCommand))
                {
                    EventCommand = "list";
                }
                if (Convert.ToString(EventCommand).ToLower() == "save" && evntArgument.ToLower() != "edit")
                //if (Mode == "Add")
                {
                    Entity.Parent_ID = Parent_TaskID;
                    mgr.Insert(Entity, IsParentTask, TaskUser_Id);
                    //mgr.Insert(Entity, out lstproduct);
                    //Products = lstproduct;
                }
                else
                {
                    //mgr.Update(Entity, out lstproduct);
                    mgr.Update(Entity, "");
                    //Products = lstproduct;
                }
                ValidationErrors = mgr.ValidationErrors;
                if (ValidationErrors.Count > 0)
                {
                    IsValid = false;
                }

                if (!IsValid)
                {
                    if (Mode == "Add")
                    {
                        AddMode();
                    }
                    else
                    {
                        EditMode();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 8
0
        private void Edit()
        {
            TaskInfoManager mgr = new TaskInfoManager();

            //Entity = mgr.Get(Convert.ToInt32(EventArgument));
            Entity       = mgr.GetTaskByID(Convert.ToInt32(EventArgument));
            Project_Name = Entity.ProjectName;
            Project_Name = GetProjectNamebyID(Entity.Project_ID);
            Manager_Name = GetUserNamebyProjectandTaskID(Entity.Project_ID, Entity.Task_Id);
            if (Entity.Parent_ID > 0)
            {
                Parent_Task   = GetParentTasksbyID(Entity.Parent_ID);
                Parent_TaskID = Entity.Parent_ID;
                IsParentTask  = true;
            }
            {
                IsParentTask = false;
            }
            List <UserInfo> pminfo = mgr.GetProjectManager(Entity.Project_ID);

            IsViewTask = false;
            EditMode();
        }
Exemplo n.º 9
0
        private void GetAllParentTasks(string mode = "")
        {
            TaskInfoManager mgr = new TaskInfoManager();

            parentTaskInfo = mgr.GetAllParentTask();
        }