protected void ValidateAndUpdateProjectToDb(object sender, EventArgs e) { try { var projectName = projupdatenametxt.Value; var projectId = Utility.GenerateProjectId(projectName); var oldProjId = (string)Session[SessionConstants.OldProjectId]; var projectDaoImpl = new ProjectDAOImpl(); var builderId = projectDaoImpl.GetBuilderinfo(oldProjId).BuilderId; Project project = null; if (!projectName.Trim().Equals(Session[SessionConstants.OldProjectName])) { project = new Project(projectName, projectId) { PbiReportName = projreporttxt.Value }; if (projectDaoImpl.IsProjectNameForBuilderPresent(builderId, projectName)) { ClientScript.RegisterStartupScript(this.GetType(), "javascript", "projectNameExists();", true); return; } } project = new Project(projectName, oldProjId) { PbiReportName = projreporttxt.Value }; projectDaoImpl.UpdateProjectToDb(oldProjId, project); UpdateProjectDiv.Visible = false; disbaleBackDiv.Visible = false; ClientScript.RegisterStartupScript(this.GetType(), "javascript", "projectUpdated();", true); } catch (Exception ex) { var exStr = string.Format(ex.Message + "\\nRoot Cause :\\n" + ex.GetBaseException().Message); ClientScript.RegisterStartupScript(this.GetType(), "javascript", "errorFunc(\"" + exStr + "\");", true); } }
private ProjectBuilderInfo GetProjectBuilderInfo(string projectId) { try { var projectDaoImpl = new ProjectDAOImpl(); return(projectDaoImpl.GetBuilderinfo(projectId)); } catch (Exception ex) { var exStr = string.Format(ex.Message + "\\nRoot Cause :\\n" + ex.GetBaseException().Message); ClientScript.RegisterStartupScript(this.GetType(), "javascript", "errorFunc(\"" + exStr + "\");", true); } return(null); }