예제 #1
0
 protected void AddNewProject_Click(object sender, EventArgs e)
 {
     if (projectModule.AddNewProject(this.NewProject.Text, this.Session["EmpNr"] as string))
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Project has been successfully added');", true);
         this.Session["GridTable"] = null;
         this.BindGrid();
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Unable to add project to the repository');", true);
     }
 }
예제 #2
0
 public string AddNewProject(string projectName)
 {
     return(projectModule.AddNewProject(projectName, Thread.CurrentPrincipal.Identity.Name)
   ? $"Successfully added Project {projectName} to your time log."
   : $"Unable to add Project {projectName} to your time log.");
 }