private void BindToolbar() { secHeader.AddText(LocRM.GetString("ToDoResources")); if ((incidentId > 0 && ToDo.CanUpdateIncidentTodo(ToDoID, incidentId)) || (documentId > 0 && ToDo.CanUpdateDocumentTodo(ToDoID, documentId)) || (taskId > 0 && ToDo.CanUpdate(ToDoID, taskId)) || ToDo.CanUpdate(ToDoID)) { #region Resource Utilization if (dgMembers.Items.Count > 0 && !Security.CurrentUser.IsExternal) { string text = String.Format(CultureInfo.InvariantCulture, "<img alt='' src='{0}'/> {1}", Page.ResolveUrl("~/Layouts/Images/ResUtil.png"), LocRM2.GetString("Utilization")); string link = String.Format(CultureInfo.InvariantCulture, "javascript:OpenPopUpNoScrollWindow('{0}?users={1}&ObjectId={2}&ObjectTypeId={3}',750,300)", Page.ResolveUrl("~/Common/ResourceUtilGraphForObject.aspx"), users, ToDoID, (int)ObjectTypes.ToDo); secHeader.AddRightLink(text, link); } #endregion CommandManager cm = CommandManager.GetCurrent(this.Page); CommandParameters cp = new CommandParameters("MC_PM_ToDoResEdit"); string cmd = cm.AddCommand("ToDo", "", "ToDoView", cp); cmd = cmd.Replace("\"", """); if (secHeaderExternal != null && dgMembers.Items.Count == 0) { secHeaderExternal.AddLinkAt(0, "<img alt='' src='../Layouts/Images/icons/newgroup.gif' title='" + LocRM.GetString("Add") + "'/>", "javascript:" + cmd); secHeaderExternal.AddSeparatorAt(1); } else { secHeader.AddRightLink("<img alt='' src='../Layouts/Images/icons/editgroup.gif'/> " + LocRM.GetString("Modify"), "javascript:" + cmd); } } if (hideifempty && dgMembers.Items.Count == 0) { this.Visible = false; } else { this.Visible = true; } }
public static void UpdateDocumentToDo(int todoId, int documentId, int managerId, string title, string description, DateTime startDate, DateTime finishDate, int priorityId, int activationTypeId, int completionTypeId, bool mustBeConfirmed, bool completeDocument, int taskTime, ArrayList categories, PrimaryKeyId contactUid, PrimaryKeyId orgUid) { if (!ToDo.CanUpdateDocumentTodo(todoId, documentId)) { throw new AccessDeniedException(); } using (DbTransaction tran = DbTransaction.Begin()) { UpdateGeneralInfo(todoId, title, description, false); UpdateTimeline(todoId, startDate, finishDate, taskTime); UpdatePriority(todoId, priorityId, false); UpdateCategories(ListAction.Set, todoId, categories, false); UpdateConfigurationInfo(todoId, activationTypeId, completionTypeId, mustBeConfirmed, false); UpdateClient(todoId, contactUid, orgUid, false); UpdateManager(todoId, managerId, false); DBToDo.AddDocumentToDo(documentId, todoId, completeDocument); tran.Commit(); } }