/// <summary> /// Creates the new priority. /// </summary> /// <param name="projectId">The project id.</param> /// <param name="priorityName">Name of the priority.</param> /// <param name="imageUrl">The image URL.</param> /// <returns></returns> public static Priority CreateNewPriority(int projectId, string priorityName, string imageUrl) { Priority newPriority = new Priority(projectId, priorityName, imageUrl); if (newPriority.Save() == true) return newPriority; else return null; }
/// <summary> /// Adds the priority. /// </summary> /// <param name="s">The s.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void AddPriority(Object s, EventArgs e) { string newName = txtName.Text.Trim(); if (newName == String.Empty) return; Priority newPriority = new Priority(ProjectId, newName, lstImages.SelectedValue); if (newPriority.Save()) { txtName.Text = ""; lstImages.SelectedValue = String.Empty; BindPriorities(); } else { lblError.Text = Logging.GetErrorMessageResource("SavePriorityError"); } }