Ejemplo n.º 1
0
    private void LoadActivityData()
    {
        int activityId = ActivityId;

        if (activityId <= 0)
        {
            return;
        }

        Activity theClass = null;

        try
        {
            theClass = ActivityBLL.GetActivityById(activityId);
        }
        catch
        {
            SystemMessages.DisplaySystemErrorMessage(Resources.Activity.MessageGetActivity);
            return;
        }

        if (theClass != null)
        {
            PermissionObject theUser = new PermissionObject();
            try
            {
                theUser = PermissionObjectBLL.GetPermissionsByUser(PermissionObject.ObjectType.ACTIVITY.ToString(), activityId);
            }
            catch (Exception exc)
            {
                SystemMessages.DisplaySystemErrorMessage(exc.Message);
                Response.Redirect("~/Organization/ListOrganizations.aspx");
            }

            bool readOnly = false;

            if (theUser == null || !theUser.TheActionList.Exists(i => i.ObjectActionID.Equals("OWN") ||
                                                                 i.ObjectActionID.Equals("MANAGE_PROJECT") ||
                                                                 i.ObjectActionID.Equals("MAN_ACTIVITY")))
            {
                readOnly = true;
            }

            AddDataControl.ReadOnly = readOnly;

            TitleLiteral.Text             = theClass.Name;
            ActivityNameTextBox.Text      = theClass.Name;
            AddDataControl.OrganizationId = theClass.OrganizationID;
            AddDataControl.AreaId         = theClass.AreaID;
            AddDataControl.ProjectId      = theClass.ProjectID;

            ActivityNameTextBox.Enabled = !readOnly;
            RequiredLabel.Visible       = !readOnly;
        }
    }
Ejemplo n.º 2
0
 private void LoadActivity()
 {
     if (ActivityId > 0)
     {
         Activity theData = null;
         try
         {
             theData = ActivityBLL.GetActivityById(ActivityId);
         }
         catch (Exception exc)
         {
             SystemMessages.DisplaySystemErrorMessage(exc.Message);
         }
         if (theData != null)
         {
             OrganizationId = theData.OrganizationID;
             AreaId         = theData.AreaID;
             ProjectId      = theData.ProjectID;
         }
     }
 }
Ejemplo n.º 3
0
    private void LoadData()
    {
        //-- verify is user is OWNER
        //PermissionObject theUser = new PermissionObject();
        //try
        //{
        //    theUser = PermissionObjectBLL.GetPermissionsByUser(PermissionObject.ObjectType.ACTIVITY.ToString(), Convert.ToInt32(ActivityIdHiddenField.Value));
        //}
        //catch (Exception exc)
        //{
        //    SystemMessages.DisplaySystemErrorMessage(exc.Message);
        //    Response.Redirect("~/Activity/ActivitiesList.aspx");
        //}

        //if (theUser == null || !theUser.TheActionList.Exists(i => i.ObjectActionID.Equals("OWN")))
        //{
        //    SystemMessages.DisplaySystemWarningMessage(Resources.DataDetails.UserNotOwner);
        //    Response.Redirect("~/Activity/ActivitiesList.aspx");
        //}

        //-- show Data
        Activity theData = null;

        try
        {
            theData = ActivityBLL.GetActivityById(Convert.ToInt32(ActivityIdHiddenField.Value));
        }
        catch (Exception exc)
        {
            log.Error(exc.Message);
            SystemMessages.DisplaySystemErrorMessage(Resources.DataDetails.MessageErrorGetActivity);
            Response.Redirect("~/Activity/ActivitiesList.aspx");
        }

        if (theData != null)
        {
            TitleLabel.Text = theData.Name;
        }
    }
Ejemplo n.º 4
0
    private void LoadActivity()
    {
        if (ActivityId > 0)
        {
            Activity theData = null;
            try
            {
                theData = ActivityBLL.GetActivityById(ActivityId);
            }
            catch (Exception exc)
            {
                SystemMessages.DisplaySystemErrorMessage(exc.Message);
            }
            if (theData != null)
            {
                if (DataTypeHiddenField.Value.Equals("KPI"))
                {
                    pnlAddActivity.Style["display"] = "none";
                    pnlKPIActivity.Style["display"] = "inline";
                    KPIActivityText.Text            = theData.Name;
                    KPIActivityText.Enabled         = !ReadOnly;
                    RemoveActivityButton.Visible    = !ReadOnly;

                    pnlAddProject.Style["display"] = "none";
                    pnlAddPeople.Style["display"]  = "none";
                    pnlKPIPeople.Style["display"]  = "none";

                    pnlKPIData.Style["display"] = "block";
                    pnlKPI.Style["display"]     = "none";
                }

                OrganizationId = theData.OrganizationID;
                AreaId         = theData.AreaID;
                ProjectId      = theData.ProjectID;
            }
        }
    }