public IHttpActionResult Delete(int id)
        {
            ProjectBLL projectBLL = new ProjectBLL();

            projectBLL.DeleteProject(id);
            return(Ok());
        }
    protected void DeleteProject_Click(object sender, EventArgs e)
    {
        String projectId = ((Label)DetailsView2.FindControl("LBLProjectID")).Text;

        projectBLL.DeleteProject(Int32.Parse(projectId));
        Response.Redirect("map.aspx?delete=1");
    }
Exemplo n.º 3
0
        public void DeleteProject()
        {
            ProjectBLL projectBLL = new ProjectBLL();

            projectBLL.DeleteProject(6);
            var proj = projectBLL.Get(6);

            Assert.IsNull(proj);
        }
Exemplo n.º 4
0
        private void btnDeleteProject_Click(object sender, EventArgs e)
        {
            int ID = (int)grvProject.GetDataRow(grvProject.GetSelectedRows()[0]).ItemArray[0];

            DialogResult = MessageBox.Show("Are you sure ?", "Notification", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            if (DialogResult == DialogResult.OK)
            {
                load();
            }
            projectBLL.DeleteProject(ID);
            load();
        }
Exemplo n.º 5
0
        private void btnProjectDeleteMenu_Click(object sender, EventArgs e)
        {
            DialogResult dialog = new DialogResult();

            dialog = MessageBox.Show("This Project Will Delete...", "Are You Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialog == DialogResult.Yes)
            {
                ToolStripDropDownItem toolStripDropDownItem = sender as ToolStripDropDownItem;
                ProjectBLL            projectBll            = new ProjectBLL();

                projectBll.DeleteProject(Convert.ToInt32(toolStripDropDownItem.Name));
                LoadProjectsToFlowLayout();
            }
        }
Exemplo n.º 6
0
        public string Delete(string[] ids)
        {
            if (ids == null || ids.Length <= 0)
            {
                return("{ 'result' : false }");
            }

            foreach (var id in ids)
            {
                var project = bll.Find(id);
                if (project != null)
                {
                    bll.DeleteProject(project);
                }
            }

            return("{ 'result':true }");
        }
Exemplo n.º 7
0
    protected void ProjectsRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        int projectId = 0;

        try
        {
            projectId = Convert.ToInt32(e.CommandArgument);
        }
        catch (Exception ex)
        {
            log.Error("Error getting object id", ex);
        }
        if (projectId <= 0)
        {
            SystemMessages.DisplaySystemErrorMessage(Resources.Organization.MessageNoComplete);
            return;
        }

        if (e.CommandName == "EditProject")
        {
            Session["ProjectId"]  = projectId;
            Session["ParentPage"] = "~/Project/ProjectList.aspx";
            Response.Redirect("~/Project/ProjectForm.aspx");
            return;
        }

        if (e.CommandName == "ViewProject")
        {
            Session["ProjectId"] = projectId;
            Response.Redirect("~/Project/ProjectDetails.aspx");
            return;
        }

        if (e.CommandName == "DeleteProject")
        {
            try
            {
                ProjectBLL.DeleteProject(projectId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }

            SystemMessages.DisplaySystemMessage(Resources.Organization.MessageDeleteProjectOK);
            ProjectsRepeater.DataBind();
            return;
        }
        if (e.CommandName == "ViewActivities")
        {
            Session["SEARCH_PARAMETER"] = "@projectID " + projectId.ToString();
            Response.Redirect("~/Activity/ActivitiesList.aspx");
            return;
        }
        if (e.CommandName == "ViewKPIs")
        {
            Session["SEARCH_PARAMETER"] = "@projectID " + projectId.ToString();
            Response.Redirect("~/Kpi/KpiList.aspx");
            return;
        }
        if (e.CommandName == "ViewOrganization")
        {
            Session["SEARCH_PARAMETER"] = "@organizationID " + projectId.ToString();
            Response.Redirect("~/Organization/ListOrganizations.aspx");
            return;
        }
        if (e.CommandName == "ViewArea")
        {
            Session["OrganizationId"] = projectId.ToString();
            Response.Redirect("~/Organization/EditOrganization.aspx");
            return;
        }
        if (e.CommandName.Equals("ShareProject"))
        {
            Session["PROJECTID"] = projectId.ToString();
            Response.Redirect("~/Project/ShareProject.aspx");
        }
    }