예제 #1
0
    /// <summary>
    // Processes the form - saves the data.
    /// </summary>
    private void Process()
    {
        // Validate the form
        if (Validate())
        {
            // Ensure the info object
            if (this.ProjectstatusObj == null)
            {
                this.ProjectstatusObj             = new ProjectStatusInfo();
                this.ProjectstatusObj.StatusOrder = ProjectStatusInfoProvider.GetStatusCount(false) + 1;
            }

            // Initialize object
            this.ProjectstatusObj.StatusName         = this.txtStatusName.Text.Trim();
            this.ProjectstatusObj.StatusDisplayName  = this.txtStatusDisplayName.Text.Trim();
            this.ProjectstatusObj.StatusColor        = this.colorPicker.SelectedColor;
            this.ProjectstatusObj.StatusIcon         = this.txtStatusIcon.Text.Trim();
            this.ProjectstatusObj.StatusIsFinished   = this.chkStatusIsFinished.Checked;
            this.ProjectstatusObj.StatusIsNotStarted = this.chkStatusIsNotStarted.Checked;
            this.ProjectstatusObj.StatusEnabled      = this.chkStatusEnabled.Checked;

            // Save object data to database
            ProjectStatusInfoProvider.SetProjectStatusInfo(this.ProjectstatusObj);

            this.ItemID = this.ProjectstatusObj.StatusID;
            this.RaiseOnSaved();

            // Set the info message
            this.lblInfo.Text = GetString("general.changessaved");
        }
    }
예제 #2
0
    /// <summary>
    // Processes the form - saves the data.
    /// </summary>
    private void Process()
    {
        // Validate the form
        if (Validate())
        {
            // Ensure the info object
            if (ProjectstatusObj == null)
            {
                ProjectstatusObj             = new ProjectStatusInfo();
                ProjectstatusObj.StatusOrder = ProjectStatusInfoProvider.GetStatusCount(false) + 1;
            }

            // Initialize object
            ProjectstatusObj.StatusName         = txtStatusName.Text.Trim();
            ProjectstatusObj.StatusDisplayName  = txtStatusDisplayName.Text.Trim();
            ProjectstatusObj.StatusColor        = colorPicker.SelectedColor;
            ProjectstatusObj.StatusIcon         = txtStatusIcon.Text.Trim();
            ProjectstatusObj.StatusIsFinished   = chkStatusIsFinished.Checked;
            ProjectstatusObj.StatusIsNotStarted = chkStatusIsNotStarted.Checked;
            ProjectstatusObj.StatusEnabled      = chkStatusEnabled.Checked;

            // Save object data to database
            ProjectStatusInfoProvider.SetProjectStatusInfo(ProjectstatusObj);

            ItemID = ProjectstatusObj.StatusID;
            RaiseOnSaved();

            // Show confirmation
            ShowChangesSaved();
        }
    }
예제 #3
0
    /// <summary>
    /// Handles UniGrid's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of the action which should be performed</param>
    /// <param name="actionArgument">ID of the item the action should be performed with</param>
    protected void gridElem_OnAction(string actionName, object actionArgument)
    {
        int projectstatusId = ValidationHelper.GetInteger(actionArgument, 0);

        if (projectstatusId > 0)
        {
            switch (actionName.ToLowerCSafe())
            {
            case "edit":
                SelectedItemID = projectstatusId;
                RaiseOnEdit();
                break;

            case "delete":
                if (!ProjectStatusInfoProvider.CheckDependencies(projectstatusId))
                {
                    ShowError(GetString("pm.projectstatus.removedenied"));
                    return;
                }

                if (ProjectStatusInfoProvider.GetStatusCount() <= 1)
                {
                    ltlInfo.Text = ScriptHelper.GetScript("alert('" + GetString("pm.projectstatus.deletealert") + "');");
                    return;
                }

                // Delete the object
                ProjectStatusInfoProvider.DeleteProjectStatusInfo(projectstatusId);
                RaiseOnDelete();

                // Reload data
                gridElem.ReloadData();
                break;

            case "up":
                ProjectStatusInfoProvider.MoveStatusUp(projectstatusId);
                break;

            case "down":
                ProjectStatusInfoProvider.MoveStatusDown(projectstatusId);
                break;
            }
        }
    }