/// <summary>
        /// This method get called when the submit button initates a postback to our server with data to insert a new record into our projects table.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_submit_Click(object sender, EventArgs e)
        {
            // check that value in box is not empty, if so return.
            if (Tbox_ProjectDescription.Text.Length < 1 | Tbox_ProjectDescription.Text.Length > 255)
            {
                return;
            }

            // check that value is not larger than 255, if so return.
            if (Tbox_ProjectDescription.Text.Contains(";"))
            {
                return;
            }

            // make our Ordered dictionary
            OrderedDictionary OD = new OrderedDictionary();

            OD.Add("project_description", Tbox_ProjectDescription.Text);

            // make sure that the text entered into project goals is a number
            try
            {
                OD.Add("investment_goal", Convert.ToInt32(Tbox_InvestmentGoal.Text));
            }
            catch (Exception error)
            {
                return;
            }

            // call method that will insert our new project into our table in our database
            create_project(UserID, EntrepreneurID, OD);

            // now take the client to the project account just made
            Response.Redirect("ViewProject/" + ProjectID.ToString());
        }
Пример #2
0
        public string GetAuditDescriptionString()
        {
            var projectStatusProjectStatusDisplayName = ProjectStatus != null ? ProjectStatus.ProjectStatusDisplayName : "NO PROJECT STATUS FOUND";
            var projectProjectName = ProjectID.ToString();

            return($"Project Status Update: Project Status - {projectStatusProjectStatusDisplayName}, Project - {projectProjectName}");
        }
 public override string ToString()
 {
     return(!HasProcessor
         ? ProjectID.ToString(CultureInfo.InvariantCulture)
         : HasThreads
             ? String.Format(CultureInfo.InvariantCulture, "{0} {1}:{2}", ProjectID, Processor, Threads)
             : String.Format(CultureInfo.InvariantCulture, "{0} {1}", ProjectID, Processor));
 }
Пример #4
0
/*====================================================*/

	public cDataObjectList Get_TopLevel_Categories() {
		cXMLDoc aXmlDoc;
		XmlNode aDataObjectNode, aFiltersNode, aArgNode;

		aXmlDoc = this.DataObjectFactory.CreateDataObjectNode("BudgetCategory", out aDataObjectNode, out aFiltersNode);
        aArgNode = aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data",
												"ProjectID", ProjectID.ToString()));
        aArgNode = aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data",
												"ParentID", 0.ToString(), "And"));
		
		return this.DataObjectFactory.GetDataObjectList(aDataObjectNode);
	}
 protected void linkbtnSave_Click(object sender, EventArgs e)
 {
     if (IsNewUpdate)
     {
         SaveNewUpdate();
     }
     else
     {
         UpdateItemDetails();
     }
     Response.Redirect("~/Updates.aspx?ProjectID=" + ProjectID.ToString());
 }
Пример #6
0
        public Feature MakePointFeatureWithRelevantProperties(DbGeometry projectLocationPoint
                                                              , bool addProjectProperties
                                                              , bool useDetailedCustomPopup
                                                              , string organizationFieldDefinitionLabelSingle
                                                              , string organizationFieldDefinitionLabelPluralized
                                                              , Dictionary <int, List <ProjectGrantAllocationExpenditure> > projectGrantAllocationExpenditureDict)
        {
            var feature = DbGeometryToGeoJsonHelper.FromDbGeometry(projectLocationPoint);

            feature.Properties.Add("TaxonomyTrunkID",
                                   ProjectType.TaxonomyBranch.TaxonomyTrunkID.ToString(CultureInfo.InvariantCulture));
            feature.Properties.Add("ProjectStageID", ProjectStageID.ToString(CultureInfo.InvariantCulture));
            if (ProjectStage != null)
            {
                feature.Properties.Add("ProjectStageColor", ProjectStage.ProjectStageColor);
            }

            feature.Properties.Add("Info", DisplayName);
            if (addProjectProperties)
            {
                feature.Properties.Add("ProjectID", ProjectID.ToString(CultureInfo.InvariantCulture));
                feature.Properties.Add("TaxonomyBranchID",
                                       ProjectType.TaxonomyBranchID.ToString(CultureInfo.InvariantCulture));
                feature.Properties.Add("ProjectTypeID", ProjectTypeID.ToString(CultureInfo.InvariantCulture));
                feature.Properties.Add("ClassificationID",
                                       string.Join(",", ProjectClassifications.Select(x => x.ClassificationID)));
                var associatedOrganizations = this.GetAssociatedOrganizations(organizationFieldDefinitionLabelSingle, organizationFieldDefinitionLabelPluralized, projectGrantAllocationExpenditureDict);
                foreach (var relationshipTypeGroup in associatedOrganizations.GroupBy(x => x.RelationshipType.RelationshipTypeName))
                {
                    feature.Properties.Add($"{relationshipTypeGroup.First().RelationshipType.RelationshipTypeName}ID",
                                           relationshipTypeGroup.Select(z => z.Organization.OrganizationID).ToList());
                }

                if (useDetailedCustomPopup)
                {
                    feature.Properties.Add("PopupUrl", this.GetProjectMapPopupUrl());
                }
                else
                {
                    feature.Properties.Add("PopupUrl", this.GetProjectSimpleMapPopupUrl());
                }
                feature.Properties.Add("ProgramID", string.Join(",", ProjectPrograms.Select(x => x.ProgramID)));
                feature.Properties.Add("LeadImplementerID", this.ProjectOrganizations.SingleOrDefault(x => x.RelationshipTypeID == RelationshipType.LeadImplementerID)?.OrganizationID.ToString(CultureInfo.InvariantCulture) ?? (-1).ToString(CultureInfo.InvariantCulture));
            }

            return(feature);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        string ProjectName         = string.Empty;
        string OrgConnectionString = GetClientDBConnectionString();

        if (OrgConnectionString.Length == 0)
        {
            MessageLabel.Visible = true;
            MainPanel.Visible    = false;
            return;
        }

        if (!IsPostBack)
        {
            ProjectView oProjectView = new ProjectView();
            oProjectView.ConnectionString         = OrgConnectionString;
            oProjectView.Where.ProjectID.Value    = ProjectID;
            oProjectView.Where.ProjectID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
            oProjectView.Query.Load();

            if (oProjectView.RowCount == 0)
            {
                MessageLabel.Visible = true;
                MainPanel.Visible    = false;
                return;
            }
            else
            {
                this.ViewState["ProjectName"] = oProjectView.Name;
            }

            hlSubscribe.NavigateUrl = string.Format("{0}?ProjectID={1}&OrganizationID={2}", Global.SubscribePageURL, ProjectID.ToString(), OrganizationID.ToString());

            DL_WEB.DAL.Client.ImpactLevel oImpactLevel = new DL_WEB.DAL.Client.ImpactLevel(OrgConnectionString);
            foreach (DataRow row in oImpactLevel.LoadAllImpactLevel().Table.Rows)
            {
                ddlImpactLevel.Items.Add(new ListItem(row["Name"].ToString(), row["ImpactLevelID"].ToString()));
            }
        }

        if (this.ViewState["ProjectName"] != null)
        {
            ProjectName = this.ViewState["ProjectName"].ToString();
        }

        this.Title = string.Format("Deployment Log for '{0}' Project", ProjectName);

        if (0 != ImpactLevel)
        {
            divImpactLevel.Visible = false;
        }

        ProductionUpdates oProductionUpdates = new ProductionUpdates(OrgConnectionString);

        oProductionUpdates.Where.ProjectID.Value    = ProjectID;
        oProductionUpdates.Where.ProjectID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
        oProductionUpdates.Query.Load();
        oProductionUpdates.Sort = ProductionUpdates.ColumnNames.BuildDate + " DESC";

        if (oProductionUpdates.RowCount > 0)
        {
            do
            {
                TableRow  tr = new TableRow();
                TableCell tc = new TableCell();

                tc.Text       = string.Format("<br/><div class=\"project_name\">{0}</div> &nbsp;{1}", ProjectName, oProductionUpdates.IsColumnNull(ProductionUpdates.ColumnNames.BuildNumber) ? "v " + oProductionUpdates.BuildNumber : "") + "&nbsp; - &nbsp;" + oProductionUpdates.BuildDate.Month + "/" + oProductionUpdates.BuildDate.Day + "/" + oProductionUpdates.BuildDate.Year + "<br/><br/>";
                tc.ColumnSpan = 4;
                tr.Cells.Add(tc);

                tblHistory.Rows.Add(tr);

                ProductionLogEntries oProductionLogEntries = new ProductionLogEntries(OrgConnectionString);
                oProductionLogEntries.Where.UpdateID.Value    = oProductionUpdates.UpdateID;
                oProductionLogEntries.Where.UpdateID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                if (ddlImpactLevel.SelectedValue != "0")
                {
                    oProductionLogEntries.Where.ImpactLevelID.Value    = ddlImpactLevel.SelectedValue;
                    oProductionLogEntries.Where.ImpactLevelID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.LessThanOrEqual;
                }
                oProductionLogEntries.Query.Load();

                if (oProductionLogEntries.RowCount > 0)
                {
                    do
                    {
                        tr          = new TableRow();
                        tc          = new TableCell();
                        tc.CssClass = "log_entry_image";
                        Image img = new Image();
                        img.ImageUrl      = oProductionLogEntries.IconPath;
                        img.AlternateText = oProductionLogEntries.TypeName;
                        tc.Controls.Add(img);
                        tc.Width = 30;
                        tr.Cells.Add(tc);

                        tc          = new TableCell();
                        tc.CssClass = "log_entry_section";
                        tc.Text     = string.Format("{0} :", oProductionLogEntries.ProjectSectionName);
                        tr.Cells.Add(tc);

                        tc          = new TableCell();
                        tc.CssClass = "log_entry_name";
                        tc.Text     = oProductionLogEntries.PublicHeader;
                        tr.Cells.Add(tc);

                        tc          = new TableCell();
                        tc.CssClass = "log_entry_description";
                        tc.Text     = oProductionLogEntries.PublicDescription;
                        tr.Cells.Add(tc);

                        tblHistory.Rows.Add(tr);
                    } while (oProductionLogEntries.MoveNext());
                }
                else
                {
                    tr = new TableRow();

                    tc            = new TableCell();
                    tc.Text       = "<i>There were no changes</i>";
                    tc.ColumnSpan = 3;

                    tr.Cells.Add(tc);
                    tblHistory.Rows.Add(tr);
                }
            } while (oProductionUpdates.MoveNext());
        }
    }
Пример #8
0
 public override string ToString()
 {
     return("ProjectName: " + ProjectName + "; ProjectID: " + ProjectID.ToString());
 }
 private void CheckReturnUrl()
 {
     if (RedirectUrl.Value.Trim().Length == 0)
     {
         RedirectUrl.Value = HttpUtility.UrlEncode("AvailableLogEntries.aspx?ProjectID=" + ProjectID.ToString());
     }
 }
Пример #10
0
        private void Initial()
        {
            SetUploadValue();//set upload value
            hd_Project.Value = ProjectID.ToString();
            TicketID         = FeedBacksEntityInfo.TicketID;
            if (IsReply)
            {
                trOthers.Visible  = false;
                trOriDesc.Visible = true;
                trOriFile.Visible = true;
                trOriDate.Visible = true;
                lblDate.InnerText = FeedBacksEntityInfo.CreatedOn.ToString("MM/dd/yyyy");
                txtOriginalContent.Attributes["readonly"] = "readonly";
                this.txtTitle.Value           = FeedBacksEntityInfo.Title.Trim().NoHTML();
                this.txtOriginalContent.Value = FeedBacksEntityInfo.Description;
                this.lblFiles.InnerHtml       = ShowImageList(FeedBacksEntityInfo.FeedBackID);

                hfPublic.Value = FeedBacksEntityInfo.IsPublic.ToString();
                if (FeedBacksEntityInfo.WaitClientFeedback == 1)
                {
                    ClientReplyFeedbackID = FeedBacksEntityInfo.FeedBackID;
                }
                if (FeedBacksEntityInfo.WaitPMFeedback == 1)
                {
                    PMReplyFeedbackID = FeedBacksEntityInfo.FeedBackID;
                }
            }
            else
            {
                if (UserInfo.Role == RolesEnum.CLIENT)
                {
                    trOthers.Visible = false;
                    hfPublic.Value   = "true";
                }
                else if (UserInfo.Role == RolesEnum.Supervisor)
                {
                    trOthers.Visible        = false;
                    this.ckIsPublic.Visible = false;
                    this.chkIsWaitClientFeedback.Visible = false;
                    this.chkIsWaitPMFeedback.Visible     = false;
                }
                else
                {
                    trOthers.Visible = true;
                    if (UserInfo.Role == RolesEnum.QA || UserInfo.Role == RolesEnum.DEV ||
                        UserInfo.Role == RolesEnum.Leader || UserInfo.Role == RolesEnum.Contactor)
                    {
                        this.ckIsPublic.Visible = false;
                        this.chkIsWaitClientFeedback.Visible = false;
                        this.chkIsWaitPMFeedback.Visible     = true;
                    }
                    else
                    {
                        this.ckIsPublic.Visible = true;
                        this.ckIsPublic.Checked = FeedBacksEntityInfo.IsPublic;
                        this.chkIsWaitClientFeedback.Visible = true;
                        this.chkIsWaitPMFeedback.Visible     = false;
                    }
                }
            }
        }
Пример #11
0
        protected void lvBDProject_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectID;

            Int64.TryParse(e.CommandArgument.ToString(), out ProjectID);

            if (ProjectID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _ProjectID = ProjectID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectEntity.FLD_NAME_ProjectID, ProjectID.ToString(), SQLMatchType.Equal);

                        BDProjectEntity bDProjectEntity = new BDProjectEntity();


                        result = FCCBDProject.GetFacadeCreate().Delete(bDProjectEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectID       = 0;
                            _BDProjectEntity = new BDProjectEntity();
                            PrepareInitialView();
                            BindBDProjectList();

                            MiscUtil.ShowMessage(lblMessage, "Project has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }