protected void btnCreateProject_Click(object sender, EventArgs e) { string project_name = txtProjectName.Text; project new_project = ProjectsDB.GetProject(project_name); if (new_project != null) { ltlMessage.Text = String.Format("<span class='error-message'>A project with name {0} already exists</span>", project_name); } else { new_project = new project(); new_project.name = project_name; new_project.description = txtProjectDescription.Text; new_project = ProjectsDB.AddEditProject(new_project); if (new_project != null) { ltlMessage.Text = "<span class='success-message'>New Project Created</span>"; txtProjectName.Text = string.Empty; txtProjectDescription.Text = string.Empty; txtProjectName.Focus(); } } }
public static bool SaveProjectDescr(string project_descr) { bool updated = false; object obj = HttpContext.Current.Request.QueryString["id"]; try { project this_project = ProjectsDB.GetProject(project_id); this_project.description = project_descr; this_project = ProjectsDB.AddEditProject(this_project); if (this_project != null) { updated = true; } } catch (Exception ex) { LogsDB.AddLog("Error updating project description", LogsDB.GetLogType("error").id, project_id, ex); } return(updated); }