private void LoadProject() { if (ProjectId > 0) { Project theData = null; try { theData = ProjectBLL.GetProjectById(ProjectId); } catch (Exception exc) { SystemMessages.DisplaySystemErrorMessage(exc.Message); } if (theData != null) { if (!DataTypeHiddenField.Value.Equals("KPI")) { ProjectTextBox.Text = theData.Name; } OrganizationId = theData.OrganizationID; AreaId = theData.AreaID; ProjectTextBox.Enabled = !ReadOnly; } } }
protected void LoadProjectData() { OrganizationControl.DataType = UserControls_FRTWB_AddDataControl.AddType.PRJ.ToString(); if (string.IsNullOrEmpty(ProjectIdHiddenField.Value) || ProjectIdHiddenField.Value == "0") { //Insert OrganizationControl.OrganizationId = 0; } else { PermissionObject theUser = new PermissionObject(); try { theUser = PermissionObjectBLL.GetPermissionsByUser(PermissionObject.ObjectType.PROJECT.ToString(), Convert.ToInt32(ProjectIdHiddenField.Value)); } 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"))) { readOnly = true; } OrganizationControl.ReadOnly = readOnly; //Update Project theData = null; try { theData = ProjectBLL.GetProjectById(Convert.ToInt32(ProjectIdHiddenField.Value)); } catch (Exception exc) { SystemMessages.DisplaySystemErrorMessage(exc.Message); } if (theData != null) { TitleLiteral.Text = theData.Name; ProjectNameTextBox.Text = theData.Name; OrganizationControl.OrganizationId = theData.OrganizationID; OrganizationControl.AreaId = theData.AreaID; ProjectNameTextBox.Enabled = !readOnly; } SaveButton.Visible = !readOnly; RequiredLabel.Visible = !readOnly; } }
private void LoadProject() { if (ProjectId > 0) { Project theData = null; try { theData = ProjectBLL.GetProjectById(ProjectId); } catch (Exception exc) { SystemMessages.DisplaySystemErrorMessage(exc.Message); } if (theData != null) { if (DataTypeHiddenField.Value.Equals("KPI")) { pnlAddProject.Style["display"] = "none"; pnlKPIProject.Style["display"] = "inline"; KPIProjectText.Text = theData.Name; KPIProjectText.Enabled = !ReadOnly; RemoveProjectButton.Visible = !ReadOnly; pnlAddPeople.Style["display"] = "none"; pnlKPIPeople.Style["display"] = "none"; pnlKPIData.Style["display"] = "block"; } else { ProjectTextBox.Text = theData.Name; } OrganizationId = theData.OrganizationID; AreaId = theData.AreaID; ProjectTextBox.Enabled = !ReadOnly; } } }
private void LoadData() { //-- verify is user is OWNER //PermissionObject theUser = new PermissionObject(); //try //{ // theUser = PermissionObjectBLL.GetPermissionsByUser(PermissionObject.ObjectType.PROJECT.ToString(), Convert.ToInt32(ProjectIdHiddenField.Value)); //} //catch (Exception exc) //{ // SystemMessages.DisplaySystemErrorMessage(exc.Message); // Response.Redirect("~/Project/ProjectList.aspx"); //} //if (theUser == null || !theUser.TheActionList.Exists(i => i.ObjectActionID.Equals("OWN"))) //{ // SystemMessages.DisplaySystemWarningMessage(Resources.DataDetails.UserNotOwner); // Response.Redirect("~/Project/ProjectList.aspx"); //} //-- show Data Project theData = null; try { theData = ProjectBLL.GetProjectById(Convert.ToInt32(ProjectIdHiddenField.Value)); } catch (Exception exc) { log.Error(exc.Message); SystemMessages.DisplaySystemErrorMessage(Resources.DataDetails.MessageErrorGetProject); Response.Redirect("~/Project/ProjectList.aspx"); } if (theData != null) { TitleLabel.Text = theData.Name; } }