예제 #1
0
        public IActionResult Index()
        {
            var _projectId = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
            var list       = StepDB.GetInstance().GetAllDoingWhat(_projectId);

            return(View(list));
        }
        public JsonResult GetGorevByBoardId(int _sprintId)
        {
            try
            {
                var stepList          = StepDB.GetInstance().GetGorevBySprintId(_sprintId);
                var backLogDetailList = new List <BacklogDetail>();

                foreach (var item in stepList)
                {
                    var assigneeUser = PersonDB.GetInstance().GetPersonById(item.AssigneeUser);
                    var milestone    = MilestoneDB.GetInstance().GetMilestoneById(item.MilestoneId);

                    backLogDetailList.Add(new BacklogDetail()
                    {
                        SprintId            = item.SprintId,
                        AssigneeUserName    = $"{assigneeUser.Name} {assigneeUser.Surname}",
                        Descripton          = item.Description,
                        DetailName          = item.Name,
                        MilestoneName       = milestone.Name,
                        AssignedPersonNames = StepDB.GetInstance().GetStepPersonsByStepId(item.Id),
                        StepId = item.Id
                    });
                }
                return(Json(backLogDetailList));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #3
0
        public IActionResult Index()
        {
            var returnList = new List <HomeViewModel>();
            var personId   = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Id;
            var list       = ProjectDB.GetInstance().GetAllProject(personId);

            list.ForEach(item =>
            {
                var assignedPerson = PersonDB.GetInstance().GetPersonById(item.ProjectLeader);
                var step           = StepDB.GetInstance().GetAllNotificationByProjectId(item.Id);
                returnList.Add(new HomeViewModel()
                {
                    AssigneeUserName = $"{assignedPerson.Name} {assignedPerson.Surname}",
                    Code             = item.Code,
                    Description      = item.Description,
                    Id            = item.Id,
                    Name          = item.Name,
                    ProjectLeader = item.ProjectLeader,
                    ShortName     = item.ShortName,
                    Status        = item.Status,
                    Kalan         = step
                });
            });

            return(View(returnList));
        }
        public IActionResult Index()
        {
            var user       = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson"));
            var _projectId = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
            var returnList = StepDB.GetInstance().GetStepPersons(user.Id, _projectId);

            return(View(returnList));
        }
예제 #5
0
 public JsonResult DeleteGorev(int _gorevId)
 {
     try
     {
         var result = StepDB.GetInstance().DeleteGorev(_gorevId);
         return(Json(result));
     }
     catch (System.Exception exc)
     {
         throw exc;
     }
 }
 public JsonResult ChangeStatus(int _stepPersonId, string _status, string _desc)
 {
     try
     {
         var changed = StepDB.GetInstance().SaveStepPersonStatus(_stepPersonId, _status, _desc);
         return(Json(changed != null));
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
예제 #7
0
        public JsonResult GetAllSprint()
        {
            try
            {
                var sprint = StepDB.GetInstance().GetAllSprint(JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id);

                return(Json(sprint));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #8
0
        public JsonResult GetAllMilestone()
        {
            try
            {
                var milestoneList = StepDB.GetInstance().GetAllMilestone(JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject").ToString()).Id);

                return(Json(milestoneList));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #9
0
        public JsonResult GetStepPersonsByStepId(int _gorevId)
        {
            try
            {
                var result = StepDB.GetInstance().GetStepPersonListByStepId(_gorevId);

                return(Json(result));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #10
0
        public JsonResult GetGorevById(int _gorevId)
        {
            try
            {
                var gorev = StepDB.GetInstance().GetGorevById(_gorevId);

                return(Json(gorev));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #11
0
        public JsonResult GetAllKullanici()
        {
            try
            {
                var kullanici = StepDB.GetInstance().GetAllKullanici();

                return(Json(kullanici));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
 public JsonResult GetChartDetail(string _milestoneName)
 {
     try
     {
         var _projectId = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
         var list       = StepDB.GetInstance().GetChartDetail(_milestoneName, _projectId);
         return(Json(list));
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
예제 #13
0
        public JsonResult GetAllNotification()
        {
            try
            {
                var personId      = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Id;
                var milestoneList = StepDB.GetInstance().GetAllNotification(personId);

                return(Json(milestoneList));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
예제 #14
0
        public JsonResult GetAllStep()
        {
            try
            {
                var _projectId        = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
                var stepList          = StepDB.GetInstance().GetAllStep(_projectId);
                var backLogDetailList = new List <BacklogDetail>();

                foreach (var item in stepList)
                {
                    var assigneeUser = PersonDB.GetInstance().GetPersonById(item.AssigneeUser);
                    var milestone    = MilestoneDB.GetInstance().GetMilestoneById(item.MilestoneId);

                    if (milestone == null)
                    {
                        continue;
                    }
                    backLogDetailList.Add(new BacklogDetail()
                    {
                        SprintId            = item.SprintId,
                        AssigneeUserName    = $"{assigneeUser.Name} {assigneeUser.Surname}",
                        Descripton          = item.Description,
                        DetailName          = item.Name,
                        MilestoneName       = milestone.Name,
                        AssignedPersonNames = StepDB.GetInstance().GetStepPersonsByStepId(item.Id),
                        StepId        = item.Id,
                        MilestoneId   = item.MilestoneId,
                        StepEndDate   = Convert.ToDateTime(item.EndDate),
                        StepStartDate = Convert.ToDateTime(item.StartDate),
                        StepStatus    = item.Status
                    });
                }

                var projectMilestones   = MilestoneDB.GetInstance().GetAllMilestoneByProjectId(_projectId);
                var projectMilestoneIds = projectMilestones.Select(x => x.Id).ToList();
                backLogDetailList = backLogDetailList.Where(x => projectMilestoneIds.Contains(x.MilestoneId)).ToList();



                return(Json(backLogDetailList));
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
 public JsonResult SaveWhatsappMessageAsTask(int _redirectId, int _milestoneId, int _sprintId, int _personId, string _title, string _desc)
 {
     try
     {
         if (_desc.Contains("/*") && _desc.Contains("*/"))
         {
             _desc = _desc.Replace("/*", "<br><i>").Replace("*/", "</i>");
         }
         var personId = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Id;
         var result   = StepDB.GetInstance().SaveWhatsappTaskAsStep(_redirectId, _milestoneId, _sprintId, personId, _personId, _title, _desc);
         return(Json(result != null));
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
        public JsonResult GetAllStepForPano()
        {
            try
            {
                var _projectId      = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
                var boardList       = BoardDB.GetInstance().GetBoardByProjectId(_projectId);
                var boardDetailList = new List <BoardRepo>();
                var personId        = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Id;

                foreach (var item in boardList)
                {
                    var stepList = BoardDB.GetInstance().GetStepByBoardId(item.Id, personId);

                    foreach (var step in stepList)
                    {
                        var assigneeUser = PersonDB.GetInstance().GetPersonById(step.AssigneeUser);
                        var milestone    = MilestoneDB.GetInstance().GetMilestoneById(step.MilestoneId);

                        if (milestone == null)
                        {
                            continue;
                        }

                        boardDetailList.Add(new BoardRepo()
                        {
                            SprintId            = step.SprintId,
                            AssigneeUserName    = $"{assigneeUser.Name} {assigneeUser.Surname}",
                            Descripton          = step.Description,
                            DetailName          = step.Name,
                            MilestoneName       = milestone.Name,
                            AssignedPersonNames = StepDB.GetInstance().GetStepPersonsByStepId(step.Id),
                            StepId  = step.Id,
                            BoardId = item.Id
                        });
                    }
                }
                return(Json(boardDetailList));
            }
            catch (System.Exception exc)
            {
                throw exc;
            }
        }
        public JsonResult GetProjectPercentage()
        {
            try
            {
                using (var context = new ProjectManagementEntities())
                {
                    var _projectId = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
                    var pct        = StepDB.GetInstance().GetProjectPercentage(_projectId);

                    pct.Gerceklesen = pct.Gerceklesen == null || pct.Gerceklesen.Trim() == "" ? "0" : pct.Gerceklesen;

                    var yuzde = Math.Round(Convert.ToDouble(pct.Gerceklesen.Replace(".", ",").Trim(), CultureInfo.GetCultureInfo("tr-TR")) * 100, 2);

                    return(Json(yuzde));
                }
            }
            catch (System.Exception exc)
            {
                throw exc;
            }

            /*
             *  SET @pct = 0;
             *  SET @boardId = 0;
             *  SET @allItems = 0;
             *  SET @completedItems = 0;
             *
             *  SET @boardId = (SELECT Id FROM Board AS B
             *  WHERE ProjectId = 1
             *  LIMIT 2,1);
             *
             *  SET @allItems = (SELECT COUNT(1) FROM Step AS S INNER JOIN Milestone AS MS ON MS.Id = S.MilestoneId WHERE MS.ProjectId = 1);
             *  SET @completedItems = (SELECT COUNT(1) FROM Step AS S INNER JOIN Milestone AS MS ON MS.Id = S.MilestoneId INNER JOIN BoardStep AS BS ON BS.StepId = S.Id  WHERE MS.ProjectId = 1 AND BS.BoardId = @boardId);
             *  SET @pct = (@completedItems * 100 / @allItems) / 100;
             *  SELECT @pct;
             */
        }
예제 #18
0
        public IActionResult Index()
        {
            var backLogDetailList = new List <BacklogDetail>();
            var _projectId        = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
            var stepList          = StepDB.GetInstance().GetAllStep(_projectId);

            foreach (var item in stepList)
            {
                var assigneeUser = PersonDB.GetInstance().GetPersonById(item.AssigneeUser);
                var milestone    = MilestoneDB.GetInstance().GetMilestoneById(item.MilestoneId);

                if (milestone == null)
                {
                    continue;
                }

                backLogDetailList.Add(new BacklogDetail()
                {
                    SprintId            = item.SprintId,
                    AssigneeUserName    = $"{assigneeUser.Name} {assigneeUser.Surname}",
                    Descripton          = item.Description,
                    DetailName          = item.Name,
                    MilestoneName       = milestone.Name,
                    AssignedPersonNames = StepDB.GetInstance().GetStepPersonsByStepId(item.Id),
                    StepId     = item.Id,
                    StepStatus = item.Status
                });
            }

            var viewModel = new BacklogViewModel()
            {
                SprintList = SprintDB.GetInstance().GetAllSprintByProjectId(_projectId),
                Details    = backLogDetailList
            };

            return(View(viewModel));
        }
예제 #19
0
        public JsonResult SaveStep(string _startDate, string _endDate, int _milestoneId, string _title, string _desc, int _assignedUserId, List <int> _workerIds, int _sprintID, int _stepId)
        {
            try
            {
                using (var context = new ProjectManagementEntities())
                {
                    if (_stepId == 0)
                    {
                        var step = new Step()
                        {
                            AssigneeUser = _assignedUserId,
                            Description  = _desc,
                            EndDate      = DateTime.ParseExact(_endDate, "dd/MM/yyyy", CultureInfo.InvariantCulture),
                            MilestoneId  = _milestoneId,
                            Name         = _title,
                            SprintId     = _sprintID,
                            StartDate    = DateTime.ParseExact(_startDate, "dd/MM/yyyy", CultureInfo.InvariantCulture),
                            Status       = 1
                        };
                        var result = StepDB.GetInstance().SaveStep(step, _workerIds);
                        if (result != null)
                        {
                            var personName        = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Name;
                            var personSurname     = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Surname;
                            var _projectId        = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
                            var _projectName      = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Name;
                            var personEmail       = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Email;
                            var stepName          = result.Name;
                            var stepPersons       = context.StepPerson.Where(x => x.StepId == result.Id).Select(x => x.PersonId).ToList();
                            var projectPerson     = context.ProjectPerson.Where(x => x.ProjectId == _projectId).Select(x => x.PersonId).ToList();
                            var projectPersonMail = context.Person.FirstOrDefault(x => projectPerson.Contains(x.Id)).Email;
                            var personsMails      = context.Person.Where(x => stepPersons.Contains(x.Id)).Select(x => x.Email).ToList();
                            var message           = _projectName + " adlı projenin " + stepName + " adlı görevi " + personName + " " + personSurname + " tarafından " + DateTime.Now.ToString("dd.MM.yyyy HH:mm") + " tarihinde eklendi";
                            personsMails.Add(personEmail);
                            personsMails.Add(projectPersonMail);
                            personsMails = personsMails.Distinct().ToList();
                            SendEmail(message, personsMails);
                            return(Json(result));
                        }

                        return(Json(result != null));
                    }
                    else
                    {
                        var step = new Step()
                        {
                            AssigneeUser = _assignedUserId,
                            Description  = _desc,
                            EndDate      = DateTime.ParseExact(_endDate, "dd/MM/yyyy", CultureInfo.InvariantCulture),
                            MilestoneId  = _milestoneId,
                            Name         = _title,
                            SprintId     = _sprintID,
                            StartDate    = DateTime.ParseExact(_startDate, "dd/MM/yyyy", CultureInfo.InvariantCulture),
                            Id           = _stepId
                        };
                        var result = StepDB.GetInstance().UpdateStep(step, _workerIds);
                        if (result != null)
                        {
                            var personName        = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Name;
                            var personSurname     = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Surname;
                            var _projectId        = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Id;
                            var _projectName      = JsonConvert.DeserializeObject <Project>(HttpContext.Session.GetString("SelectedProject")).Name;
                            var personEmail       = JsonConvert.DeserializeObject <Person>(HttpContext.Session.GetString("ActivePerson")).Email;
                            var stepName          = result.Name;
                            var stepPersons       = context.StepPerson.Where(x => x.StepId == result.Id).Select(x => x.PersonId).ToList();
                            var projectPerson     = context.ProjectPerson.Where(x => x.ProjectId == _projectId).Select(x => x.PersonId).ToList();
                            var projectPersonMail = context.Person.FirstOrDefault(x => projectPerson.Contains(x.Id)).Email;
                            var personsMails      = context.Person.Where(x => stepPersons.Contains(x.Id)).Select(x => x.Email).ToList();
                            var message           = _projectName + " adlı projenin " + stepName + " adlı görevi " + personName + " " + personSurname + " tarafından " + DateTime.Now.ToString("dd.MM.yyyy HH:mm") + " tarihinde güncellendi";
                            personsMails.Add(personEmail);
                            personsMails.Add(projectPersonMail);
                            personsMails = personsMails.Distinct().ToList();
                            SendEmail(message, personsMails);
                            return(Json(result));
                        }
                        return(Json(result != null));
                    }
                }
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }