示例#1
0
        /// <summary>
        /// Used to mark scrum as completed
        /// </summary>
        /// <param name="scrumId"></param>
        private void MarkScrumComplete(int scrumId)
        {
            Scrum scrum = _scrumRepository.FirstOrDefault(x => x.Id == scrumId);

            scrum.IsOngoing = false;
            _scrumRepository.Update(scrum);
        }
示例#2
0
        /// <summary>
        /// Resume the scrum meeting
        /// </summary>
        /// <param name="scrum"></param>
        /// <param name="groupName"></param>
        /// <param name="accessToken"></param>
        /// <returns>scrum resume message along with the next question</returns>
        private string ScrumResume(Scrum scrum, string groupName, string accessToken)
        {
            ScrumStatus status    = FetchScrumStatus(groupName, accessToken, null, null, null).Result;
            var         returnMsg = string.Empty;

            //keyword encountered is "scrum resume"
            if (status == (ScrumStatus.Halted))
            {
                //scrum resumed
                scrum.IsHalted = false;
                _scrumRepository.Update(scrum);
                //when the scrum is resumed then, the next question is to be asked
                returnMsg += _stringConstant.ScrumResumed + GetQuestion(scrum.Id, groupName, null, null, scrum.ProjectId, accessToken).Result;
                return(returnMsg);
            }
            else if (status == (ScrumStatus.OnGoing))
            {
                returnMsg += _stringConstant.ScrumNotHalted + GetQuestion(scrum.Id, groupName, null, null, scrum.ProjectId, accessToken).Result;
                return(returnMsg);
            }
            else
            {
                return(ReplyToClient(status) + _stringConstant.ScrumCannotBeResumed);
            }
        }
示例#3
0
        public ActionResult Edit(int id)
        {
            Scrum scrum = _ScrumService.GetScrumById(id);

            if (scrum == null)  // new scrum
            {
                scrum = new Scrum()
                {
                    DateOfScrum = DateTime.Now,
                    SprintId    = SessionHelper.GetCurrentSprintId(User.Identity.Name, Session)
                };
                scrum = _ScrumService.GenerateNewScrumDetails(SessionHelper.GetCurrentSprintId(User.Identity.Name, Session), scrum);
            }

            IMembershipService membershipService = new AccountMembershipService();
            ScrumViewModel     scrumViewModel    = new ScrumViewModel()
            {
                ScrumModel      = scrum,
                MemberUsernames = membershipService.GetAlphabeticalUsernameList()
            };

            scrumViewModel.MemberUsernames.Insert(0, AccountMembershipService.UNASSIGNED);

            return(PartialView(scrumViewModel));
        }
示例#4
0
        /// <summary>
        /// Method to return the details of scrum for a particular project
        /// </summary>
        /// <param name="projectId">project Id</param>
        /// <param name="scrumDate">Date of scrum</param>
        /// <param name="userId">userId of user</param>
        /// <returns>Details of the scrum</returns>
        public async Task <ScrumProjectDetails> ScrumReportDetailsAsync(int projectId, DateTime scrumDate, string userId)
        {
            _logger.Debug("start Method : " + scrumDate + "projectId :" + projectId);
            //Getting details of the logged in user from Oauth server
            User loginUser = await _oauthCallsRepository.GetUserByEmployeeIdAsync(userId);

            //Getting details of the specific project from Oauth server
            ProjectAc project = await _oauthCallsRepository.GetProjectDetailsAsync(projectId);

            //Getting scrum for a specific project
            Scrum scrum = await _scrumDataRepository.FirstOrDefaultAsync(x => x.ProjectId == project.Id && DbFunctions.TruncateTime(x.ScrumDate) == DbFunctions.TruncateTime(scrumDate));

            _logger.Debug("scrume object: " + scrum);

            ScrumProjectDetails scrumProjectDetail = new ScrumProjectDetails();

            scrumProjectDetail.ScrumDate = scrumDate.ToString(_stringConstant.FormatForDate);
            if (scrum != null)
            {
                scrumProjectDetail.ProjectCreationDate = project.CreatedDate;
                if (loginUser.Role == _stringConstant.Admin)
                {
                    project.TeamLeaderId = loginUser.Id;
                }
                //getting scrum answers of employees in a specific project
                scrumProjectDetail.EmployeeScrumAnswers = await GetEmployeeScrumDetailsAsync(project, scrum, loginUser, scrumDate);
            }
            return(scrumProjectDetail);
        }
示例#5
0
        // GET: Scrums/Edit/5
        public ActionResult Edit(int?id)
        {
            ViewBag.ReturnUrl = Request.UrlReferrer;
            var scrums = db.Scrums.SingleOrDefault(c => c.ScrumId == id);

            var departments       = db.Departments.ToList();
            var scrumstatuses     = db.ScrumStatuses.ToList();
            var classifications   = db.Classifications.ToList();
            var scrumcreatedbys   = db.ScrumCreatedBies.ToList();
            var scrumresponsibles = db.ScrumResponsibles.ToList();

            var viewModel = new SaveScrumViewModel()
            {
                Scrum             = scrums,
                Departments       = departments,
                ScrumStatuses     = scrumstatuses,
                Classifications   = classifications,
                ScrumCreatedBies  = scrumcreatedbys,
                ScrumResponsibles = scrumresponsibles
            };

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Scrum scrum = db.Scrums.Find(id);

            if (scrum == null)
            {
                return(HttpNotFound());
            }

            return(View("Edit", viewModel));
            //return View(scrum);
        }
示例#6
0
        protected ScrumDetail BuildScrumDetail(Sprint sprint, Task task)
        {
            Scrum       mostRecentScrum       = GetMostRecentScrum(sprint);
            ScrumDetail mostRecentScrumDetail = null;

            if (mostRecentScrum != null && mostRecentScrum.ScrumDetails.Count() > 0)
            {
                var results = from s in mostRecentScrum.ScrumDetails
                              where s.TaskId == task.TaskId
                              select s;
                if (results.Count() > 0)
                {
                    mostRecentScrumDetail = results.First();
                }
            }
            ScrumDetail scrumDetail = new ScrumDetail()
            {
                AssignedTo     = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.AssignedTo : AccountMembershipService.UNASSIGNED,
                HoursCompleted = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursCompleted : 0,
                HoursRemaining = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursRemaining :
                                 ((task.Hours != null) ? (int)task.Hours : 0),
                StoryTaskDescription = task.Story.UserDefinedId + " -> " + task.Description,
                TaskId = task.TaskId
            };

            return(scrumDetail);
        }
示例#7
0
        /// <summary>
        ///  Create a new scrum from the input.
        /// </summary>
        /// <param name="scrumStartCardResponseId">Activity id of scrum summary card.</param>
        /// <param name="scrumCardId">Activity Id of scrum card.</param>
        /// <param name="members">JSON serialized member and activity mapping.</param>
        /// <param name="scrumMaster">An instance of scrum master details.</param>
        /// <param name="turnContext">Context object containing information cached for a single turn of conversation with a user.</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
        /// <returns>void.</returns>
        private async Task CreateScrumAsync(string scrumStartCardResponseId, string scrumCardId, string members, ScrumMaster scrumMaster, ITurnContext turnContext, CancellationToken cancellationToken)
        {
            string conversationId = turnContext.Activity.Conversation.Id;

            try
            {
                Scrum scrumEntity = new Scrum
                {
                    ThreadConversationId     = conversationId,
                    ScrumStartActivityId     = scrumCardId,
                    IsCompleted              = false,
                    MembersActivityIdMap     = members,
                    ScrumStartCardResponseId = scrumStartCardResponseId,
                    ScrumMasterId            = scrumMaster.ScrumMasterId,
                    ScrumId     = conversationId,
                    ChannelName = scrumMaster.ChannelName,
                    TeamId      = scrumMaster.TeamId,
                    CreatedOn   = DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", CultureInfo.InvariantCulture),
                    AADGroupID  = scrumMaster.AADGroupID,
                };
                var savedData = await this.scrumStorageProvider.CreateOrUpdateScrumAsync(scrumEntity);

                if (!savedData)
                {
                    await turnContext.SendActivityAsync(this.localizer.GetString("ErrorSavingScrumData"), cancellationToken : cancellationToken);
                }
            }
            catch (Exception ex)
            {
                this.logger.LogError(ex, $"For {conversationId}: saving scrum data to table storage failed. {ex.Message}", SeverityLevel.Error);
                await turnContext.SendActivityAsync(this.localizer.GetString("ErrorMessage"), cancellationToken : cancellationToken);

                throw;
            }
        }
示例#8
0
 public Scrum SaveScrum(Scrum scrum)
 {
     if (scrum != null)
     {
         if (scrum.ScrumId == 0 && !ScrumDateExists(scrum))  // this is new
         {
             _ScrumTimeEntities.AddToScrums(scrum);
         }
         else  // the scrum exists
         {
             if (scrum.ScrumId == 0)  // the scrum matches an existing date
             {
                 ScrumTimeEntities freshScrumTimeEntities =
                     new ScrumTimeEntities(_ScrumTimeEntities.Connection.ConnectionString);
                 Scrum scrumByDate = GetScrumByDateOfScrumAndSprintId(freshScrumTimeEntities,
                                                                      scrum.DateOfScrum, scrum.SprintId);
                 DeleteScrum(freshScrumTimeEntities, scrumByDate.ScrumId);
             }
             else  // the scrum matches an existing scrum id
             {
                 //ScrumTimeEntities freshScrumTimeEntities =
                 //    new ScrumTimeEntities(_ScrumTimeEntities.Connection.ConnectionString);
                 //Scrum existingScrum = GetScrumById(freshScrumTimeEntities, scrum.ScrumId);
                 //DeleteScrum(freshScrumTimeEntities, existingScrum.ScrumId);
                 DeleteScrum(scrum.ScrumId);
                 scrum.ScrumId = 0;
                 //_ScrumTimeEntities.ObjectStateManager.ChangeObjectState(scrum, System.Data.EntityState.Added);
             }
             _ScrumTimeEntities.AddToScrums(scrum);
         }
         _ScrumTimeEntities.SaveChanges();
     }
     return(scrum);
 }
示例#9
0
        /// <summary>
        /// Fetches the previous day's questions and answers of the employee of the given id for the given project
        /// </summary>
        /// <param name="employeeId"></param>
        /// <param name="projectId"></param>
        /// <returns>previous day status</returns>
        private string FetchPreviousDayStatus(string employeeId, int projectId)
        {
            string previousDayStatus = string.Empty;
            //previous scrums
            List <Scrum> scrumList = _scrumRepository.Fetch(x => x.ProjectId == projectId && x.ScrumDate < DateTime.UtcNow.Date).OrderByDescending(x => x.ScrumDate).ToList();

            if (scrumList.Any())
            {
                //previous scrum
                Scrum              previousScrum = scrumList.FirstOrDefault();
                List <Question>    questions     = _questionRepository.Fetch(x => x.Type == 1).OrderBy(x => x.OrderNumber).ToList();
                List <ScrumAnswer> scrumAnswers  = _scrumAnswerRepository.Fetch(x => x.ScrumId == previousScrum.Id && x.EmployeeId == employeeId).ToList();
                if (scrumAnswers.Any() && questions.Any())
                {
                    previousDayStatus = Environment.NewLine + _stringConstant.PreviousDayStatus + Environment.NewLine;
                    foreach (var question in questions)
                    {
                        //Question and the corresponding answer appended
                        previousDayStatus += "*_Q_*: " + question.QuestionStatement + Environment.NewLine + "*_A_*: _" + scrumAnswers.FirstOrDefault(x => x.QuestionId == question.Id).Answer + "_" + Environment.NewLine;
                    }
                    previousDayStatus += Environment.NewLine + _stringConstant.AnswerToday + Environment.NewLine + Environment.NewLine;
                }
            }
            return(previousDayStatus);
        }
示例#10
0
        /// <summary>
        /// Stores or update scrum data in Microsoft Azure Table storage.
        /// </summary>
        /// <param name="scrumData">Holds scrum entity data.</param>
        /// <returns>A task that represents scrum entity data is saved or updated.</returns>
        public async Task <bool> CreateOrUpdateScrumAsync(Scrum scrumData)
        {
            scrumData = scrumData ?? throw new ArgumentNullException(nameof(scrumData));

            try
            {
                Scrum scrumEntity = new Scrum()
                {
                    IsCompleted              = scrumData.IsCompleted,
                    ThreadConversationId     = scrumData.ThreadConversationId,
                    ScrumStartActivityId     = scrumData.ScrumStartActivityId,
                    ScrumStartCardResponseId = scrumData.ScrumStartCardResponseId,
                    MembersActivityIdMap     = scrumData.MembersActivityIdMap,
                    ScrumTeamConfigId        = scrumData.ScrumTeamConfigId,
                    ScrumId     = scrumData.ThreadConversationId,
                    ChannelName = scrumData.ChannelName,
                    TeamId      = scrumData.TeamId,
                    CreatedOn   = scrumData.CreatedOn,
                    AadGroupId  = scrumData.AadGroupId,
                };

                await this.EnsureInitializedAsync();

                TableOperation operation = TableOperation.InsertOrReplace(scrumEntity);
                var            result    = await this.CloudTable.ExecuteAsync(operation);

                return(result.HttpStatusCode == (int)HttpStatusCode.NoContent);
            }
            catch (Exception ex)
            {
                this.logger.LogError(ex, $"An error occurred in CreateOrUpdateScrumAsync: ScrumTeamConfigId : {JsonConvert.SerializeObject(scrumData)}.", SeverityLevel.Error);
                throw;
            }
        }
示例#11
0
        /// <summary>
        /// Get active scrum by scrum master id.
        /// </summary>
        /// <param name="scrumMasterId">Scrum master id</param>
        /// <returns>A task that represents the scrum data needs to be returned.</returns>
        public async Task <Scrum> GetActiveScrumAsync(string scrumMasterId)
        {
            Scrum activeScrum = null;
            var   result      = await this.scrumStorageProvider.GetScrumByScrumMasterIdAsync(scrumMasterId);

            activeScrum = result.Where(scrum => scrum.IsCompleted == false).FirstOrDefault();
            return(activeScrum);
        }
示例#12
0
        /// <summary>
        /// Delete scrum status entity from Microsoft Azure Table storage.
        /// </summary>
        /// <param name="scrum">Holds scrum entity data.</param>
        /// <returns>Delete operation response.</returns>
        public async Task <TableResult> DeleteEntityAsync(Scrum scrum)
        {
            await this.EnsureInitializedAsync();

            TableOperation deleteOperation = TableOperation.Delete(scrum);

            return(await this.CloudTable.ExecuteAsync(deleteOperation));
        }
示例#13
0
        public ActionResult DeleteConfirmed(int id, string returnUrl)
        {
            Scrum scrum = db.Scrums.Find(id);

            db.Scrums.Remove(scrum);
            db.SaveChanges();
            return(Redirect(returnUrl));
        }
示例#14
0
        protected bool ScrumDateExists(Scrum scrum)
        {
            var results = from s in _ScrumTimeEntities.Scrums
                          where s.DateOfScrum == scrum.DateOfScrum &&
                          s.SprintId == scrum.SprintId
                          select s;

            return((results.Count() > 0) ? true : false);
        }
示例#15
0
        /// <summary>
        /// Get end scrum summary card activity.
        /// </summary>
        /// <param name="scrum">Scrum details of the running scrum.</param>
        /// <param name="conversationId">Conversation id for updating the conversation.</param>
        /// <param name="scrumMembers">Members who are part of the scrum.</param>
        /// <param name="turnContext">Context object containing information cached for a single turn of conversation with a user.</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
        /// <returns>Returns end scrum summary card activity to be updated in team.</returns>
        public async Task <IActivity> GetEndScrumSummaryActivityAsync(Scrum scrum, string conversationId, string scrumMembers, ITurnContext <IMessageActivity> turnContext, CancellationToken cancellationToken)
        {
            var activity = turnContext?.Activity;

            if (scrum == null || scrum.IsCompleted == true)
            {
                await turnContext.SendActivityAsync(string.Format(CultureInfo.CurrentCulture, this.localizer.GetString("ErrorScrumDoesNotExist"), activity.From.Name), cancellationToken : cancellationToken);

                return(null);
            }

            var activityId = this.GetActivityIdToMatch(scrum.MembersActivityIdMap, activity.From.Id);

            if (string.IsNullOrEmpty(activityId))
            {
                await turnContext.SendActivityAsync(string.Format(CultureInfo.CurrentCulture, this.localizer.GetString("ErrorUserIsNotPartOfRunningScrumAndTryToEndScrum"), activity.From.Name), cancellationToken : cancellationToken);

                this.logger.LogInformation($"Member who is updating the scrum is not the part of scrum for: {conversationId}");
                return(null);
            }

            if (string.IsNullOrEmpty(scrumMembers))
            {
                this.logger.LogInformation("Scrum members detail could not be found");
                await turnContext.SendActivityAsync(this.localizer.GetString("ErrorMessage"), cancellationToken : cancellationToken);

                return(null);
            }

            var membersActivityIdMap = JsonConvert.DeserializeObject <Dictionary <string, string> >(scrumMembers);

            scrum.IsCompleted          = true;
            scrum.ThreadConversationId = conversationId;
            var savedData = await this.scrumStorageProvider.CreateOrUpdateScrumAsync(scrum);

            if (!savedData)
            {
                this.logger.LogError("Error in saving scrum information in storage.");
                await turnContext.SendActivityAsync(this.localizer.GetString("ErrorSavingScrumData"), cancellationToken : cancellationToken);

                return(null);
            }

            var scrumStartCardResponseId = scrum.ScrumStartCardResponseId;
            var scrumMaster = await this.scrumMasterStorageProvider.GetScrumMasterDetailsByScrumMasterIdAsync(scrum.ScrumMasterId);

            var updatedScrumSummary = await this.scrumHelper.GetScrumSummaryAsync(scrum.ScrumMasterId, scrumStartCardResponseId, membersActivityIdMap);

            var scrumStartCard  = ScrumCard.GetScrumStartCard(updatedScrumSummary, membersActivityIdMap, scrum.ScrumMasterId, scrum.ScrumStartActivityId, this.localizer, scrumMaster.TimeZone);
            var activitySummary = MessageFactory.Attachment(scrumStartCard);

            activitySummary.Id           = scrumStartCardResponseId;
            activitySummary.Conversation = activity.Conversation;
            return(activitySummary);
        }
示例#16
0
 //public ActionResult Edit([Bind(Include = "ScrumId,CreatedBy,CreationDateTime,Responsible,Task,Action,DueDateTime,CompletionDateTime,Notes")] Scrum scrum)
 public ActionResult Edit(Scrum scrum, string returnUrl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(scrum).State = EntityState.Modified;
         db.SaveChanges();
         return(Redirect(returnUrl));
     }
     return(View());
     //return View(scrum);
 }
示例#17
0
        public static Scrum GetScrumById(ScrumTimeEntities scrumTimeEntities, int id)
        {
            Scrum scrum   = null;
            var   results = from s in scrumTimeEntities.Scrums
                            where s.ScrumId == id
                            select s;

            if (results.Count() > 0)
            {
                scrum = results.First <Scrum>();
            }
            return(scrum);
        }
示例#18
0
        public IActionResult About(int taskid)
        {
            if (HttpContext.Session.GetInt32("userid") == null)
            {
                return(RedirectToAction("Index"));
            }

            Scrum onetask = _context.scrumtable.Include(x => x.user).Include(x => x.parts).ThenInclude(x => x.user).SingleOrDefault(x => x.id == taskid);

            ViewBag.makername = onetask.user.name + " " + onetask.user.lastname;

            return(View("About", onetask));
        }
示例#19
0
        public IActionResult Edit(int taskid)
        {
            if (HttpContext.Session.GetInt32("userid") == null)
            {
                return(RedirectToAction("Index"));
            }

            Scrum onetask = _context.scrumtable.Include(x => x.user).Include(x => x.parts).ThenInclude(x => x.user).SingleOrDefault(x => x.id == taskid);

            ViewBag.about  = onetask;
            ViewBag.errors = ViewBag.errors;

            return(View());
        }
示例#20
0
        // GET: Scrums/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Scrum scrum = db.Scrums.Find(id);

            if (scrum == null)
            {
                return(HttpNotFound());
            }
            return(View(scrum));
        }
示例#21
0
        private void OnControlledCompanyProjectAdded(Scrum scrumObj)
        {
            ListViewElementProject newElement = CreateListViewElement(scrumObj.BindedProject);

            ButtonSelectorProjects.AddButton(newElement.GetComponent <Button>());
            ListViewCompanyProjects.AddControl(newElement.gameObject);
            newElement.Text.text = base.GetProjectListViewElementText(scrumObj.BindedProject);

            scrumObj.BindedProject.ProgressUpdated       += OnProjectProgressUpdated;
            scrumObj.BindedProject.Completed             += OnProjectCompleted;
            scrumObj.BindedProject.CompletionTimeUpdated += OnCompanyProjectCompletionTimeUpdated;

            SetListViewCompanyProjectsText();
        }
示例#22
0
        protected Scrum GetMostRecentScrum(Sprint sprint)
        {
            Scrum    mostRecentScrum = null;
            DateTime maxScrumDate    = DateTime.MinValue;

            if (sprint.Scrums != null && sprint.Scrums.Count() > 0)
            {
                maxScrumDate = sprint.Scrums.Max(s => s.DateOfScrum);
            }
            if (maxScrumDate.CompareTo(DateTime.MinValue) > 0)
            {
                mostRecentScrum = GetScrumByDateOfScrumAndSprintId(_ScrumTimeEntities, maxScrumDate, sprint.SprintId);
            }
            return(mostRecentScrum);
        }
        private void OnControlledCompanyProjectAdded(Scrum scrumObj)
        {
            ListViewElementProject newElement = CreateListViewElement(scrumObj.BindedProject);

            newElement.Text.text         = GetProjectListViewElementText(scrumObj.BindedProject);
            newElement.FrontImage.sprite = scrumObj.BindedProject.Icon;
            ButtonSelectorProjects.AddButton(newElement.Button);

            ListViewCompanyProjects.AddControl(newElement.gameObject);

            scrumObj.BindedProject.ProgressUpdated += OnProjectProgressUpdated;
            scrumObj.BindedProject.Completed       += OnProjectCompleted;
            scrumObj.BindedProject.WorkerRemoved   += OnProjectWorkerRemoved;
            SetListViewCompanyProjectsText();
        }
示例#24
0
        // GET: Scrums/Delete/5
        public ActionResult Delete(int?id)
        {
            ViewBag.ReturnUrl = Request.UrlReferrer;
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Scrum scrum = db.Scrums.Find(id);

            if (scrum == null)
            {
                return(HttpNotFound());
            }
            return(View(scrum));
        }
    public void AddProject(LocalProject projectToAdd)
    {
        //Scrum instance for project that will be added
        Scrum projectScrum = (Scrum)ScriptsGameObject.AddComponent(typeof(Scrum));

        projectScrum.BindedProject = projectToAdd;
        ScrumProcesses.Add(projectScrum);
        ProjectAdded?.Invoke(projectScrum);

#if DEVELOPMENT_BUILD || UNITY_EDITOR
        string debugInfo = string.Format("[{3}] Project added to company\nName {0}\nID {1}\nComplete bonus {2}",
                                         projectToAdd.Name, projectToAdd.ID, projectToAdd.CompletionBonus, this.GetType().Name);
        Debug.Log(debugInfo);
#endif
    }
示例#26
0
        public static Scrum GetScrumByDateOfScrumAndSprintId(ScrumTimeEntities scrumTimeEntities,
                                                             DateTime dateOfScrum, int sprintId)
        {
            Scrum scrum   = null;
            var   results = from s in scrumTimeEntities.Scrums
                            where s.DateOfScrum == dateOfScrum &&
                            s.SprintId == sprintId
                            select s;

            if (results.Count() > 0)
            {
                scrum = results.First <Scrum>();
            }
            return(scrum);
        }
示例#27
0
        //public ActionResult Create([Bind(Include = "ScrumId,CreatedBy,CreationDateTime,Responsible,Task,Action,DueDateTime,CompletionDateTime,Notes")] Scrum scrum)
        public ActionResult Create(Scrum scrum, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                db.Scrums.Add(scrum);
                db.SaveChanges();
                //var creator = new ScrumCreatedBy();
                //creator.
                return(Redirect(returnUrl));
                //System.Net.Mail.MailMessage m = System.Net.Mail.MailMessage(
                //new System.Net.Mail.MailAddress("", "New Scrum Assigned"),
                //new System.Net.Mail.MailAddress())
            }

            return(View());
            //return View(scrum);
        }
示例#28
0
        public Scrum GenerateNewScrumDetails(int sprintId, Scrum scrum)
        {
            SprintService sprintService = new SprintService(_ScrumTimeEntities);
            Sprint        sprint        = sprintService.GetSprintById(sprintId);

            if (sprint != null)
            {
                foreach (Story story in sprint.Stories)
                {
                    foreach (Task task in story.Tasks)
                    {
                        ScrumDetail scrumDetail = BuildScrumDetail(sprint, task);
                        scrum.ScrumDetails.Add(scrumDetail);
                    }
                }
            }
            return(scrum);
        }
示例#29
0
        public void DeleteScrum(ScrumTimeEntities scrumTimeEntities, int scrumId)
        {
            Scrum existingScrum = GetScrumById(scrumTimeEntities, scrumId);

            if (existingScrum != null && existingScrum.ScrumId > 0)
            {
                List <ScrumDetail> scrumDetails = existingScrum.ScrumDetails.ToList <ScrumDetail>();
                foreach (ScrumDetail scrumDetail in scrumDetails)
                {
                    scrumTimeEntities.DeleteObject(scrumDetail);
                }
                scrumTimeEntities.DeleteObject(existingScrum);
                scrumTimeEntities.SaveChanges();
            }
            else
            {
                throw new Exception("You have attempted to delete a scrum that does not exist.");
            }
        }
示例#30
0
        /// <summary>
        /// Get end scrum summary card activity.
        /// </summary>
        /// <param name="scrum">Scrum details of the running scrum.</param>
        /// <param name="conversationId">Conversation id for updating the conversation.</param>
        /// <param name="scrumMembers">Members who are part of the scrum.</param>
        /// <param name="turnContext">Context object containing information cached for a single turn of conversation with a user.</param>
        /// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
        /// <returns>Returns end scrum summary card activity to be updated in team.</returns>
        public async Task <IActivity> GetEndScrumSummaryActivityAsync(Scrum scrum, string conversationId, string scrumMembers, ITurnContext <IMessageActivity> turnContext, CancellationToken cancellationToken)
        {
            turnContext = turnContext ?? throw new ArgumentNullException(nameof(turnContext));
            var activity = turnContext.Activity;

            if (scrum == null)
            {
                return(null);
            }

            var activityId = this.CheckUserExistsInScrumMembers(scrum.MembersActivityIdMap, activity.From.Id);

            if (string.IsNullOrEmpty(activityId))
            {
                await turnContext.SendActivityAsync(string.Format(CultureInfo.CurrentCulture, this.localizer.GetString("ErrorUserIsNotPartOfRunningScrumAndTryToEndScrum"), activity.From.Name), cancellationToken : cancellationToken);

                this.logger.LogInformation($"Member who is updating the scrum is not the part of scrum for: {conversationId}");
                return(null);
            }

            if (string.IsNullOrEmpty(scrumMembers))
            {
                this.logger.LogInformation("Scrum members detail could not be found");
                await turnContext.SendActivityAsync(this.localizer.GetString("ErrorMessage"), cancellationToken : cancellationToken);

                return(null);
            }

            var    membersActivityIdMap     = JsonConvert.DeserializeObject <Dictionary <string, string> >(scrumMembers);
            var    scrumStartCardResponseId = scrum.ScrumStartCardResponseId;
            string aadGroupId = await this.GetTeamAadGroupIdAsync(turnContext, cancellationToken);

            var scrumConfiguration = await this.scrumConfigurationStorageProvider.GetScrumConfigurationDetailByScrumTeamConfigIdAsync(scrum.ScrumTeamConfigId, aadGroupId);

            var updatedScrumSummary = await this.scrumHelper.GetScrumSummaryAsync(scrum.ScrumTeamConfigId, scrumConfiguration.AadGroupId, scrumStartCardResponseId, membersActivityIdMap);

            var scrumStartCard  = ScrumCard.GetScrumStartCard(updatedScrumSummary, membersActivityIdMap, scrum.ScrumTeamConfigId, scrum.ScrumStartActivityId, this.localizer, scrumConfiguration.TimeZone);
            var activitySummary = MessageFactory.Attachment(scrumStartCard);

            activitySummary.Id           = scrumStartCardResponseId;
            activitySummary.Conversation = activity.Conversation;
            return(activitySummary);
        }