Beispiel #1
0
 /// <summary>
 /// Creates the new status.
 /// </summary>
 /// <param name="projectId">The project id.</param>
 /// <param name="statusName">Name of the status.</param>
 /// <param name="imageUrl">The image URL.</param>
 /// <returns></returns>
 public static Status CreateNewStatus(int projectId, string statusName, string imageUrl)
 {
     Status newStatus = new Status(projectId, statusName, imageUrl, false);
         if (newStatus.Save() == true)
             return newStatus;
         else
             return null;
 }
        /// <summary>
        /// Adds the status.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void AddStatus(Object s, EventArgs e)
        {
            string newName = txtName.Text.Trim();

            if (newName == String.Empty)
                return;

            Status newStatus = new Status(ProjectId, newName, lstImages.SelectedValue,chkClosedState.Checked);
            if (newStatus.Save())
            {
                txtName.Text = "";
                BindStatus();
                lstImages.SelectedValue = String.Empty;
                chkClosedState.Checked = false;
            }
            else
            {
                lblError.Text = Logging.GetErrorMessageResource("SaveStatusError");
            }
        }