/// <summary> /// Adds the milestone. /// </summary> /// <param name="s">The s.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void AddMilestone(Object s, EventArgs e) { var newName = txtName.Text.Trim(); if (newName == String.Empty) { return; } var newMilestone = new Milestone { ProjectId = ProjectId, Name = newName, ImageUrl = lstImages.SelectedValue, DueDate = DueDate.SelectedValue, ReleaseDate = ReleaseDate.SelectedValue, IsCompleted = chkCompletedMilestone.Checked, Notes = txtMilestoneNotes.Text }; if (MilestoneManager.SaveOrUpdate(newMilestone)) { txtMilestoneNotes.Text = string.Empty; txtName.Text = string.Empty; DueDate.SelectedValue = null; chkCompletedMilestone.Checked = false; ReleaseDate.SelectedValue = null; BindMilestones(); lstImages.SelectedValue = String.Empty; } else { ActionMessage.ShowErrorMessage(LoggingManager.GetErrorMessageResource("SaveMilestoneError")); } }
/// <summary> /// Handles the ItemCommand event of the grdMilestones control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param> protected void grdMilestones_ItemCommand(object sender, DataGridCommandEventArgs e) { Milestone m; var itemIndex = e.Item.ItemIndex; switch (e.CommandName) { case "up": //move row up if (itemIndex == 0) { return; } m = MilestoneManager.GetById(Convert.ToInt32(e.CommandArgument)); m.SortOrder -= 1; MilestoneManager.SaveOrUpdate(m); break; case "down": //move row down if (itemIndex == grdMilestones.Items.Count - 1) { return; } m = MilestoneManager.GetById(Convert.ToInt32(e.CommandArgument)); m.SortOrder += 1; MilestoneManager.SaveOrUpdate(m); break; } BindMilestones(); }
public void AssignData() { titleUI.text = milestone.objectiveText; switch (milestone.type) { case MilestoneScriptableObject.MilestoneType.Score: CheckScoreType(); break; case MilestoneScriptableObject.MilestoneType.EnemiesKilled: CheckEnemiesKilledType(); break; case MilestoneScriptableObject.MilestoneType.TowersPlaced: CheckTowersPlacedType(); break; case MilestoneScriptableObject.MilestoneType.TimesEscaped: CheckTimesEscapedType(); break; case MilestoneScriptableObject.MilestoneType.GemsCollected: CheckGemsCollectedType(); break; default: break; } MilestoneManager.Get().allMilestones.Add(this); MilestoneManager.Get().currentMilestonesTotal++; }
protected void Page_Load(object sender, EventArgs e) { Literal1.Text = GetLocalResourceObject("Page.Title").ToString(); if (!IsPostBack) { ProjectId = Request.Get("pid", Globals.NEW_ID); MilestoneId = Request.Get("m", Globals.NEW_ID); // If don't know project or issue then redirect to something missing page if (ProjectId == 0 || MilestoneId == 0) { ErrorRedirector.TransferToSomethingMissingPage(Page); return; } var p = ProjectManager.GetById(ProjectId); if (p == null || p.Disabled) { ErrorRedirector.TransferToSomethingMissingPage(Page); return; } litMilestone.Text = MilestoneManager.GetById(MilestoneId).Name; litProject.Text = ProjectManager.GetById(ProjectId).Name; } rptReleaseNotes.DataSource = IssueTypeManager.GetByProjectId(ProjectId); rptReleaseNotes.DataBind(); Output.Text = string.Format("<h1>{2} - {0} - {1}</h1>", litProject.Text, litMilestone.Text, GetLocalResourceObject("Page.Title")); Output.Text += RenderControl(rptReleaseNotes); }
/// <summary> /// Handles the Update event of the grdMilestones control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param> protected void grdMilestones_Update(object sender, DataGridCommandEventArgs e) { var txtMilestoneName = (TextBox)e.Item.FindControl("txtMilestoneName"); if (txtMilestoneName.Text.Trim() == "") { throw new ArgumentNullException("Milestone Name is empty"); } var pickimg = (PickImage)e.Item.FindControl("lstEditImages"); var milestoneDueDate = (PickDate)e.Item.FindControl("MilestoneDueDate"); var milestoneReleaseDate = (PickDate)e.Item.FindControl("MilestoneReleaseDate"); var isCompletedMilestone = (CheckBox)e.Item.FindControl("chkEditCompletedMilestone"); var milestoneNotes = (TextBox)e.Item.FindControl("txtMilestoneNotes"); var m = MilestoneManager.GetById(Convert.ToInt32(grdMilestones.DataKeys[e.Item.ItemIndex])); m.Name = txtMilestoneName.Text.Trim(); m.ImageUrl = pickimg.SelectedValue; m.DueDate = milestoneDueDate.SelectedValue; m.ReleaseDate = milestoneReleaseDate.SelectedValue; m.IsCompleted = isCompletedMilestone.Checked; m.Notes = milestoneNotes.Text; MilestoneManager.SaveOrUpdate(m); grdMilestones.EditItemIndex = -1; BindMilestones(); }
private void Start() { this.manager = GameObject.FindObjectOfType <MilestoneManager>(); if (this.manager == null) { Debug.LogWarning("No MilestoneManager Component could be found"); } }
public void ForcedChangeScene() { if (SceneManager.GetActiveScene().name == "Gameplay") { Destroy(GameManager.Get().gameObject); Destroy(WaveSystem.Get().gameObject); Destroy(TurretSpawner.Get().gameObject); Destroy(Highscore.Get().gameObject); Destroy(MilestoneManager.Get().gameObject); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } } else if (SceneManager.GetActiveScene().name == "Upgrade Screen") { AkSoundEngine.StopAll(); } if (sceneName == "Gameplay") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } LoaderManager.Get().LoadScene(sceneName); UILoadingScreen.Get().SetVisible(true); } else if (sceneName == "Upgrade Screen") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } SceneManager.LoadScene(sceneName); } else { SceneManager.LoadScene(sceneName); } Time.timeScale = 1; }
/// <summary> /// Binds the project summary. /// </summary> private void BindChangeLog() { var ascending = SortMilestonesAscending ? "" : " desc"; var milestones = MilestoneManager.GetByProjectId(ProjectId).Sort("SortOrder" + ascending).ToList(); ChangeLogRepeater.DataSource = ViewMode == 1 ? milestones.Take(5) : milestones; ChangeLogRepeater.DataBind(); }
/// <summary> /// Deletes the milestone. /// </summary> /// <param name="s">The s.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param> protected void grdMilestones_Delete(Object s, DataGridCommandEventArgs e) { var id = (int)grdMilestones.DataKeys[e.Item.ItemIndex]; string cannotDeleteMessage; if (!MilestoneManager.Delete(id, out cannotDeleteMessage)) { ActionMessage.ShowErrorMessage(cannotDeleteMessage); return; } BindMilestones(); }
/// <summary> /// Binds the options. /// </summary> private void BindOptions() { List <ITUser> users = UserManager.GetUsersByProjectId(ProjectId, true); //Get Type DropIssueType.DataSource = IssueTypeManager.GetByProjectId(ProjectId); DropIssueType.DataBind(); //Get Priority DropPriority.DataSource = PriorityManager.GetByProjectId(ProjectId); DropPriority.DataBind(); //Get Resolutions DropResolution.DataSource = ResolutionManager.GetByProjectId(ProjectId); DropResolution.DataBind(); //Get categories var categories = new CategoryTree(); DropCategory.DataSource = categories.GetCategoryTreeByProjectId(ProjectId); DropCategory.DataBind(); //Get milestones DropMilestone.DataSource = MilestoneManager.GetByProjectId(ProjectId); DropMilestone.DataBind(); DropAffectedMilestone.DataSource = MilestoneManager.GetByProjectId(ProjectId); DropAffectedMilestone.DataBind(); //Get Users DropAssignedTo.DataSource = users; DropAssignedTo.DataBind(); DropOwned.DataSource = users; DropOwned.DataBind(); DropStatus.DataSource = StatusManager.GetByProjectId(ProjectId); DropStatus.DataBind(); lblDateCreated.Text = DateTime.Now.ToString("f"); lblLastModified.Text = DateTime.Now.ToString("f"); if (!User.Identity.IsAuthenticated) { return; } lblReporter.Text = Security.GetDisplayName(); lblLastUpdateUser.Text = Security.GetDisplayName(); }
public String[] GetMilestones(int ProjectId) { if (ProjectManager.GetById(ProjectId).AccessType == Common.ProjectAccessType.Private && !ProjectManager.IsUserProjectMember(UserName, ProjectId)) { throw new UnauthorizedAccessException(string.Format(LoggingManager.GetErrorMessageResource("ProjectAccessDenied"), UserName)); } List <Milestone> milestones = MilestoneManager.GetByProjectId(ProjectId); List <String> returnval = new List <String>(); foreach (Milestone item in milestones) { returnval.Add(item.Name.ToString()); } return(returnval.ToArray()); }
/// <summary> /// Binds the milestones. /// </summary> private void BindMilestones() { grdMilestones.Columns[1].HeaderText = GetGlobalResourceObject("SharedResources", "Milestone").ToString(); grdMilestones.Columns[2].HeaderText = GetGlobalResourceObject("SharedResources", "Image").ToString(); grdMilestones.Columns[3].HeaderText = GetGlobalResourceObject("SharedResources", "DueDate").ToString(); grdMilestones.Columns[4].HeaderText = GetGlobalResourceObject("SharedResources", "ReleaseDate").ToString(); grdMilestones.Columns[5].HeaderText = GetLocalResourceObject("IsCompletedMilestone.Text").ToString(); grdMilestones.Columns[6].HeaderText = GetGlobalResourceObject("SharedResources", "Notes").ToString(); grdMilestones.Columns[7].HeaderText = GetGlobalResourceObject("SharedResources", "Order").ToString(); grdMilestones.DataSource = MilestoneManager.GetByProjectId(ProjectId); grdMilestones.DataKeyField = "Id"; grdMilestones.DataBind(); grdMilestones.Visible = grdMilestones.Items.Count != 0; }
public void RepeatScene() { if (SceneManager.GetActiveScene().name == "Gameplay") { Destroy(GameManager.Get().gameObject); Destroy(WaveSystem.Get().gameObject); Destroy(TurretSpawner.Get().gameObject); Destroy(Highscore.Get().gameObject); Destroy(MilestoneManager.Get().gameObject); } SceneManager.LoadScene(SceneManager.GetActiveScene().name); Time.timeScale = 1; UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } }
/// <summary> /// Binds the options. /// </summary> private void BindOptions() { List <ITUser> users = UserManager.GetUsersByProjectId(ProjectId, true); //Get Type DropIssueType.DataSource = IssueTypeManager.GetByProjectId(ProjectId); DropIssueType.DataBind(); //Get Priority DropPriority.DataSource = PriorityManager.GetByProjectId(ProjectId); DropPriority.DataBind(); //Get Resolutions DropResolution.DataSource = ResolutionManager.GetByProjectId(ProjectId); DropResolution.DataBind(); //Get categories var categories = new CategoryTree(); DropCategory.DataSource = categories.GetCategoryTreeByProjectId(ProjectId); DropCategory.DataBind(); //Get milestones DropMilestone.DataSource = MilestoneManager.GetByProjectId(ProjectId, false); DropMilestone.DataBind(); DropAffectedMilestone.DataSource = MilestoneManager.GetByProjectId(ProjectId); DropAffectedMilestone.DataBind(); //Get Users DropAssignedTo.DataSource = users; DropAssignedTo.DataBind(); DropOwned.DataSource = users; DropOwned.DataBind(); DropOwned.SelectedValue = User.Identity.Name; DropStatus.DataSource = StatusManager.GetByProjectId(ProjectId); DropStatus.DataBind(); }
/// <summary> /// When the user changes the selected field type, show the corresponding list /// of possible values. /// </summary> /// <param name="s">The s.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void dropFieldSelectedIndexChanged(Object s, EventArgs e) { dropValue.Items.Clear(); dropValue.Visible = false; txtValue.Visible = false; DateValue.Visible = false; switch (dropField.SelectedValue) { case "IssueId": case "IssueTitle": case "IssueDescription": case "IssueVotes": case "IssueProgress": case "IssueEstimation": case "TimeLogged": txtValue.Visible = true; break; case "IssuePriorityId": dropValue.Visible = true; dropValue.DataSource = PriorityManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueTypeId": dropValue.Visible = true; dropValue.DataSource = IssueTypeManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueMilestoneId": dropValue.Visible = true; dropValue.DataSource = MilestoneManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueAffectedMilestoneId": dropValue.Visible = true; dropValue.DataSource = MilestoneManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueResolutionId": dropValue.Visible = true; dropValue.DataSource = ResolutionManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueCategoryId": dropValue.Visible = true; var objCats = new CategoryTree(); dropValue.DataSource = objCats.GetCategoryTreeByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueStatusId": dropValue.Visible = true; dropValue.DataSource = StatusManager.GetByProjectId(ProjectId); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Id"; break; case "IssueAssignedUserId": dropValue.Visible = true; dropValue.DataSource = UserManager.GetUsersByProjectId(ProjectId); dropValue.DataTextField = "DisplayName"; dropValue.DataValueField = "Id"; break; case "IssueOwnerUserId": dropValue.Visible = true; txtValue.Visible = false; dropValue.DataSource = UserManager.GetUsersByProjectId(ProjectId); dropValue.DataTextField = "DisplayName"; dropValue.DataValueField = "Id"; break; case "IssueCreatorUserId": dropValue.Visible = true; dropValue.DataSource = UserManager.GetUsersByProjectId(ProjectId); dropValue.DataTextField = "DisplayName"; dropValue.DataValueField = "Id"; break; case "DateCreatedAsDate": case "LastUpdateAsDate": case "IssueDueDate": DateValue.Visible = true; break; case "CustomFieldName": dropValue.Visible = false; txtValue.Visible = true; //show the text value field. Not needed. CustomFieldSelected = true; if (CustomFieldManager.GetByProjectId(ProjectId).Count > 0) { dropField.DataSource = CustomFieldManager.GetByProjectId(ProjectId); dropField.DataTextField = "Name"; dropField.DataValueField = "Name"; dropField.DataBind(); // bind to the new data source. dropField.Items.Add(GetGlobalResourceObject("SharedResources", "DropDown_ResetFields").ToString()); dropField.Items.Insert(0, new ListItem(GetGlobalResourceObject("SharedResources", "DropDown_SelectCustomField").ToString(), "0")); } break; default: if (dropField.SelectedItem.Text.Equals(GetGlobalResourceObject("SharedResources", "DropDown_SelectCustomField").ToString())) { return; } // The user decides to reset the fields if (dropField.SelectedItem.Text.Equals(GetGlobalResourceObject("SharedResources", "DropDown_ResetFields").ToString())) { dropField.DataSource = null; dropField.DataSource = RequiredFieldManager.GetRequiredFields(); dropField.DataTextField = "Name"; dropField.DataValueField = "Value"; dropField.DataBind(); } //RW Once the list is populated with any varying type of name, //we just default to this case, because we know it is not a standard field. else { //check the type of this custom field and load the appropriate values. var cf = CustomFieldManager.GetByProjectId(ProjectId).Find(c => c.Name == dropField.SelectedValue); if (cf == null) { return; } CustomFieldSelected = true; CustomFieldId = cf.Id; CustomFieldDataType = cf.DataType; switch (cf.FieldType) { case CustomFieldType.DropDownList: dropValue.Visible = true; dropValue.DataSource = CustomFieldSelectionManager.GetByCustomFieldId(cf.Id); dropValue.DataTextField = "Name"; dropValue.DataValueField = "Value"; break; case CustomFieldType.Date: DateValue.Visible = true; break; case CustomFieldType.YesNo: dropValue.Visible = true; dropValue.Items.Add(new ListItem(GetGlobalResourceObject("SharedResources", "DropDown_SelectOne").ToString())); dropValue.Items.Add(new ListItem(GetGlobalResourceObject("SharedResources", "Yes").ToString(), Boolean.TrueString)); dropValue.Items.Add(new ListItem(GetGlobalResourceObject("SharedResources", "No").ToString(), Boolean.FalseString)); break; default: txtValue.Visible = true; break; } } break; } try { dropValue.DataBind(); } catch { } }
/// <summary> /// Handles the DayRender event of the prjCalendar control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DayRenderEventArgs"/> instance containing the event data.</param> protected void prjCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { if (e.Day.IsToday) { //TODO: If issues are due today in 7 days or less then create as red, else use blue? } List <QueryClause> queryClauses = new List <QueryClause>(); switch (dropView.SelectedValue) { case "IssueDueDates": QueryClause q = new QueryClause("AND", "iv.[IssueDueDate]", "=", e.Day.Date.ToShortDateString(), SqlDbType.DateTime); queryClauses.Add(q); q = new QueryClause("AND", "iv.[Disabled]", "=", "false", SqlDbType.Bit); queryClauses.Add(q); List <Issue> issues = IssueManager.PerformQuery(queryClauses, ProjectId); foreach (Issue issue in issues) { if (issue.Visibility == (int)IssueVisibility.Private && issue.AssignedDisplayName != Security.GetUserName() && issue.CreatorDisplayName != Security.GetUserName() && (!UserManager.IsSuperUser() || !UserManager.IsInRole(issue.ProjectId, Globals.ProjectAdminRole))) { continue; } string cssClass = string.Empty; if (issue.DueDate <= DateTime.Today) { cssClass = "calIssuePastDue"; } else { cssClass = "calIssue"; } if (issue.Visibility == (int)IssueVisibility.Private) { cssClass += " calIssuePrivate"; } string title = string.Format(@"<div id=""issue"" class=""{3}""><a href=""{4}{2}"">{0} - {1}</a></div>", issue.FullId.ToUpper(), issue.Title, issue.Id, cssClass, Page.ResolveUrl("~/Issues/IssueDetail.aspx?id=")); e.Cell.Controls.Add(new LiteralControl(title)); } break; case "MilestoneDueDates": List <Milestone> milestones = MilestoneManager.GetByProjectId(ProjectId).FindAll(m => m.DueDate == e.Day.Date); foreach (Milestone m in milestones) { string cssClass = string.Empty; if (m.DueDate <= DateTime.Today) { cssClass = "calIssuePastDue"; } else { cssClass = "calIssue"; } string projectName = ProjectManager.GetById(ProjectId).Name; string title = string.Format(@"<div id=""issue"" class=""{4}""><a href=""{6}{2}&m={3}"">{1} - {0} </a><br/>{5}</div>", m.Name, projectName, m.ProjectId, m.Id, cssClass, m.Notes, Page.ResolveUrl("~/Issues/IssueDetail.aspx?pid=")); e.Cell.Controls.Add(new LiteralControl(title)); } break; } //Set the calendar to week mode only showing the selected week. if (dropCalendarView.SelectedValue == "Week") { if (Week(e.Day.Date) != Week(prjCalendar.VisibleDate)) { e.Cell.Visible = false; } e.Cell.Height = new Unit("300px"); } else { //e.Cell.Height = new Unit("80px"); //e.Cell.Width = new Unit("80px"); } }
/// <summary> /// Binds a data source to the invoked server control and all its child controls. /// </summary> public new void DataBind() { //Private issue check DataSource = IssueManager.StripPrivateIssuesForRequestor(DataSource, Security.GetUserName()).ToList(); if (DataSource.Count > 0) { gvIssues.Visible = true; pager.Visible = true; ScrollPanel.Visible = true; OptionsContainerPanel.Visible = true; var pId = Request.QueryString.Get("pid", -1); //get custom fields for project if (pId > Globals.NEW_ID) { var customFields = CustomFieldManager.GetByProjectId(pId); var nrColumns = FIXED_COLUMNS; //checks if its initial load to add custom controls and checkboxes if (gvIssues.Columns.Count <= nrColumns + 1) { var firstIssue = DataSource[0]; //if there is custom fields add them if (firstIssue.IssueCustomFields.Count > 0) { foreach (var value in firstIssue.IssueCustomFields) { //increments nr of columns nrColumns++; //create checkbox item var lstValue = new ListItem(value.FieldName, nrColumns.ToString()); //find custom controls that has been checked and check them var selected = Array.IndexOf(_arrIssueColumns, nrColumns.ToString()) >= 0; if (selected) { lstValue.Selected = true; } //add item to checkbox list lstIssueColumns.Items.Add(lstValue); //create column for custom control var tf = new TemplateField { HeaderText = value.FieldName, SortExpression = value.DatabaseFieldName.Replace(" ", "[]") }; tf.HeaderStyle.Wrap = false; gvIssues.Columns.Add(tf); } } } } DisplayColumns(); SelectColumnsPanel.Visible = true; lblResults.Visible = false; if (ShowProjectColumn) { gvIssues.Columns[0].Visible = false; LeftButtonContainerPanel.Visible = false; } else { gvIssues.Columns[4].Visible = false; lstIssueColumns.Items.Remove(lstIssueColumns.Items.FindByValue("4")); var projectId = _dataSource[0].ProjectId; //hide votes column if issue voting is disabled if (!ProjectManager.GetById(projectId).AllowIssueVoting) { gvIssues.Columns[4].Visible = false; lstIssueColumns.Items.Remove(lstIssueColumns.Items.FindByValue("4")); } if (Page.User.Identity.IsAuthenticated && UserManager.HasPermission(projectId, Common.Permission.EditIssue.ToString())) { LeftButtonContainerPanel.Visible = true; // performance enhancement // WRH 2012-04-06 // only load these if the user has permission to do so var categories = new CategoryTree(); dropCategory.DataSource = categories.GetCategoryTreeByProjectId(projectId); dropCategory.DataBind(); dropMilestone.DataSource = MilestoneManager.GetByProjectId(projectId); dropMilestone.DataBind(); dropAffectedMilestone.DataSource = dropMilestone.DataSource; dropAffectedMilestone.DataBind(); dropOwner.DataSource = UserManager.GetUsersByProjectId(projectId); dropOwner.DataBind(); dropPriority.DataSource = PriorityManager.GetByProjectId(projectId); dropPriority.DataBind(); dropStatus.DataSource = StatusManager.GetByProjectId(projectId); dropStatus.DataBind(); dropType.DataSource = IssueTypeManager.GetByProjectId(projectId); dropType.DataBind(); dropAssigned.DataSource = UserManager.GetUsersByProjectId(projectId); dropAssigned.DataBind(); dropResolution.DataSource = ResolutionManager.GetByProjectId(projectId); dropResolution.DataBind(); chkDueDateReset.Checked = false; } else { //hide selection column for unauthenticated users gvIssues.Columns[0].Visible = false; LeftButtonContainerPanel.Visible = false; } } foreach (var item in _arrIssueColumns.Select(colIndex => lstIssueColumns.Items.FindByValue(colIndex)).Where(item => item != null)) { item.Selected = true; } gvIssues.DataSource = DataSource; gvIssues.DataBind(); } else { ScrollPanel.Visible = false; OptionsContainerPanel.Visible = false; lblResults.Visible = true; gvIssues.Visible = false; pager.Visible = false; } }
/// <summary> /// Returns a valid project Milestone. /// </summary> /// <param name="p">A Project</param> /// <returns>Random Milestone</returns> public Milestone GetMilestone() { List <Milestone> miles = MilestoneManager.GetByProjectId(p.Id); return(miles[rng.Next(0, miles.Count)]); }
/// <summary> /// Binds the roadmap. /// </summary> private void BindRoadmap() { RoadmapRepeater.DataSource = MilestoneManager.GetByProjectId(ProjectId, false); RoadmapRepeater.DataBind(); }
// Update is called once per frame private void Update() { if (milestone.isActive) { if (!milestone.isDone) { switch (milestone.type) { case MilestoneScriptableObject.MilestoneType.Score: CheckScoreType(); break; case MilestoneScriptableObject.MilestoneType.EnemiesKilled: CheckEnemiesKilledType(); break; case MilestoneScriptableObject.MilestoneType.TowersPlaced: CheckTowersPlacedType(); break; case MilestoneScriptableObject.MilestoneType.TimesEscaped: CheckTimesEscapedType(); break; case MilestoneScriptableObject.MilestoneType.GemsCollected: CheckGemsCollectedType(); break; case MilestoneScriptableObject.MilestoneType.WavesSurvived: CheckWavesSurvivedType(); break; case MilestoneScriptableObject.MilestoneType.DistanceTravelled: CheckDistanceTravelledType(); break; default: break; } } else { if (!doOnce) { MilestoneManager.Get().milestonesToMove.Add(this); MilestoneManager.Get().canSwitch = true; if (!milestone.hasGivenReward) { GameManager.Get().upgradePointsCurrentMatch += milestone.rewardPoints; milestone.hasGivenReward = true; if (OnMilestoneDone != null) { OnMilestoneDone(); } } progressTextUI.text = "Done!"; progressBar.value = 1; doOnce = true; } } } }
/// <summary> /// Handles the ItemDataBound event of the rptProject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> private void rptProject_ItemDataBound(object sender, RepeaterItemEventArgs e) { //check permissions if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Project p = (Project)e.Item.DataItem; if (!Context.User.Identity.IsAuthenticated || !UserManager.HasPermission(p.Id, Common.Permission.AddIssue.ToString())) { e.Item.FindControl("ReportIssue").Visible = false; } if (!Context.User.Identity.IsAuthenticated || !UserManager.HasPermission(p.Id, Common.Permission.AdminEditProject.ToString())) { e.Item.FindControl("Settings").Visible = false; } Image ProjectImage = (Image)e.Item.FindControl("ProjectImage"); ProjectImage.ImageUrl = string.Format("~/DownloadAttachment.axd?id={0}&mode=project", p.Id); Label OpenIssuesLink = (Label)e.Item.FindControl("OpenIssues"); Label NextMilestoneDue = (Label)e.Item.FindControl("NextMilestoneDue"); Label MilestoneComplete = (Label)e.Item.FindControl("MilestoneComplete"); string milestone = string.Empty; List <Milestone> milestoneList = MilestoneManager.GetByProjectId(p.Id); milestoneList = milestoneList.FindAll(m => m.DueDate.HasValue && m.IsCompleted != true); if (milestoneList.Count > 0) { List <Milestone> sortedMilestoneList = milestoneList.Sort <Milestone>("DueDate").ToList(); Milestone mileStone = sortedMilestoneList[0]; if (mileStone != null) { milestone = ((DateTime)mileStone.DueDate).ToShortDateString(); int[] progressValues = ProjectManager.GetRoadMapProgress(p.Id, mileStone.Id); if (progressValues[0] != 0 || progressValues[1] != 0) { double percent = progressValues[0] * 100 / progressValues[1]; MilestoneComplete.Text = string.Format("{0}%", percent); } else { MilestoneComplete.Text = "0%"; } } else { milestone = GetLocalResourceObject("None").ToString(); } NextMilestoneDue.Text = string.Format(GetLocalResourceObject("NextMilestoneDue").ToString(), milestone); } else { NextMilestoneDue.Text = string.Format(GetLocalResourceObject("NextMilestoneDue").ToString(), GetLocalResourceObject("NoDueDatesSet").ToString()); } var status = StatusManager.GetByProjectId(p.Id); if (status.Count > 0) { //get total open issues var queryClauses = new List <QueryClause> { new QueryClause("AND", "iv.[IsClosed]", "=", "0", SqlDbType.Int), new QueryClause("AND", "iv.[Disabled]", "=", "0", SqlDbType.Int) }; var issueList = IssueManager.PerformQuery(queryClauses, null, p.Id); OpenIssuesLink.Text = string.Format(GetLocalResourceObject("OpenIssuesCount").ToString(), issueList.Count); var closedStatus = status.FindAll(s => s.IsClosedState); if (closedStatus.Count.Equals(0)) { // No open issue statuses means there is a problem with the setup of the system. OpenIssuesLink.Text = GetLocalResourceObject("NoClosedStatus").ToString(); } } else { // Warn users of a problem OpenIssuesLink.Text = GetLocalResourceObject("NoStatusSet").ToString(); } HyperLink atu = (HyperLink)e.Item.FindControl("AssignedToUser"); Control AssignedUserFilter = e.Item.FindControl("AssignedUserFilter"); if (Context.User.Identity.IsAuthenticated && ProjectManager.IsUserProjectMember(User.Identity.Name, p.Id)) { System.Web.Security.MembershipUser user = UserManager.GetUser(User.Identity.Name); atu.NavigateUrl = string.Format("~/Issues/IssueList.aspx?pid={0}&u={1}", p.Id, user.UserName); } else { AssignedUserFilter.Visible = false; } } }
public void ChangeScene() { if (SceneManager.GetActiveScene().name == "Gameplay") { Destroy(GameManager.Get().gameObject); Destroy(WaveSystem.Get().gameObject); Destroy(TurretSpawner.Get().gameObject); Destroy(Highscore.Get().gameObject); Destroy(MilestoneManager.Get().gameObject); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } AkSoundEngine.StopAll(); } else if (SceneManager.GetActiveScene().name == "Upgrade Screen") { AkSoundEngine.StopAll(); } if (sceneName == "Upgrade Screen") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } int goToTutorial = PlayerPrefs.GetInt("isFirstTimePlaying", 1); if (goToTutorial == 1) { SceneManager.LoadScene("Tutorial"); } else if (goToTutorial == 0) { SceneManager.LoadScene(sceneName); } } else if (sceneName == "Gameplay") { AkSoundEngine.StopAll(); UpgradeSystem upgrades = UpgradeSystem.Get(); if (upgrades) { upgrades.CleanList(); } int goToTutorial = PlayerPrefs.GetInt("isFirstTimePlaying", 1); if (goToTutorial == 1) { SceneManager.LoadScene("Tutorial"); } else if (goToTutorial == 0) { LoaderManager.Get().LoadScene(sceneName); UILoadingScreen.Get().SetVisible(true); } } else { SceneManager.LoadScene(sceneName); } Time.timeScale = 1; }
/// <summary> /// Handles the Validate event of the MilestoneValidation control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.Web.UI.WebControls.ServerValidateEventArgs"/> instance containing the event data.</param> protected void MilestoneValidation_Validate(object sender, ServerValidateEventArgs e) { //validate that at least one Milestone exists. e.IsValid = MilestoneManager.GetByProjectId(ProjectId).Count > 0; }