Ejemplo n.º 1
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}");
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //绑定项目
                ProjectID.DataSource     = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll();
                ProjectID.DataTextField  = "ProjectName";
                ProjectID.DataValueField = "ID";
                ProjectID.DataBind();
                ProjectID.Items.Insert(0, new ListItem("其他项目", "其他项目"));

                //专业
                ClassName.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15);
                ClassName.DataTextField  = "ClassName";
                ClassName.DataValueField = "ClassName";
                ClassName.DataBind();
                ClassName.Items.Insert(0, new ListItem("选择专业", ""));

                WorkType.Items.Add(new ListItem("司令图工日", "司令图工日"));
                WorkType.Items.Add(new ListItem("辅助工日", "辅助工日"));
                WorkType.Items.Add(new ListItem("归档工日", "归档工日"));
                WorkType.Items.Add(new ListItem("出差工日", "出差工日"));
                WorkType.Items.Add(new ListItem("投标工日", "投标工日"));
                WorkType.Items.Add(new ListItem("初设工日", "初设工日"));
                WorkType.Items.Add(new ListItem("咨询工日", "咨询工日"));
                WorkType.Items.Add(new ListItem("其他", "其他"));

                //遍历绑定人员列表
                WebBLL.Tbl_UserManager.GetUsersByListBox(NodeUser);

                UserName.Text    = WebCommon.Public.GetUserName();
                UserName.Enabled = false;
            }
        }
        /// <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());
        }
Ejemplo n.º 4
0
        private async Task <ContractExecutionResult> RequestCSIBForProject(ProjectID request)
        {
#if RAPTOR
            if (configStore.GetValueBool("ENABLE_TREX_GATEWAY_CS") ?? false)
            {
#endif
            var siteModelId = request.ProjectUid.ToString();

            var returnedResult = await trexCompactionDataProxy.SendDataGetRequest <CSIBResult>(siteModelId, $"/projects/{siteModelId}/csib", customHeaders);

            return(returnedResult.CSIB == string.Empty
          ? new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults, $"{nameof(RequestCSIBForProject)}: result: {returnedResult}")
          : returnedResult);

#if RAPTOR
        }

        log.LogDebug($"{nameof(GetType)}::{nameof(RequestCSIBForProject)}() : {JsonConvert.SerializeObject(request)}");

        var returnResult = raptorClient.GetCSIBFile(request.ProjectId ?? VelociraptorConstants.NO_PROJECT_ID, out var csibFileStream);

        log.LogInformation($"{nameof(RequestCSIBForProject)}: result: {returnResult}");

        return(returnResult != TASNodeErrorStatus.asneOK
        ? new ContractExecutionResult((int)returnResult, $"{nameof(RequestCSIBForProject)}: result: {returnResult}")
        : new CSIBResult(Convert.ToBase64String(csibFileStream.ToArray())));
#endif
        }
        protected override void Execute(CodeActivityContext context)
        {
            var projectID   = ProjectID.Get(context);
            var modelID     = ModelID.Get(context);
            var locationID  = LocationID.Get(context);
            var bearerToken = BearerToken.Get(context);
            var content     = Content.Get(context);

            var jsonData      = String.Format("{ \"payload\": { \"textSnippet\": { \"content\": \"{0}\", \"mime_type\": \"text/plain\" } } }", content);
            var jsonDataBytes = Encoding.ASCII.GetBytes(jsonData);

            request = HttpWebRequest.CreateHttp(String.Format("https://automl.googleapis.com/v1/projects/{0}/locations/{1}/models/{2}:predict",
                                                              projectID, locationID, modelID));
            request.Method      = "POST";
            request.ContentType = "application/json";
            request.Headers.Add(HttpRequestHeader.Authorization, $"Bearer {bearerToken}");

            using (var req_stream = request.GetRequestStream())
            {
                req_stream.Write(jsonDataBytes, 0, jsonDataBytes.Length);
                req_stream.Close();
            }

            var response = request.GetResponse();
        }
 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));
 }
Ejemplo n.º 7
0
 public virtual BudgetKeyTuple GetBudgetKey()
 {
     return(new BudgetKeyTuple(ProjectID.GetValueOrDefault(),
                               ProjectTaskID.GetValueOrDefault(),
                               AccountGroupID.GetValueOrDefault(),
                               InventoryID.GetValueOrDefault(PMInventorySelectorAttribute.EmptyInventoryID),
                               CostCodeID.GetValueOrDefault(CostCodeAttribute.GetDefaultCostCode())));
 }
 protected void ProjectType_SelectedIndexChanged(object sender, EventArgs e)
 {
     ProjectID.DataSource     = WebBLL.Tbl_ProjectManager.GetTbl_ProjectByProjectTypes(this.ProjectType.SelectedValue);
     ProjectID.DataTextField  = "ProjectName";
     ProjectID.DataValueField = "ID";
     ProjectID.DataBind();
     ProjectID.Items.Insert(0, "选择项目");
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Sends a DELETE request to Production Data Server (PDS) client.
        /// </summary>
        /// <param name="item">DELETE request description.</param>
        /// <param name="surveyedSurfaces">Returned list of Surveyed Surfaces.</param>
        /// <returns>True if the processed request from PDS was successful, false - otherwise.</returns>
        ///
        protected override bool SendRequestToPdsClient(object item, out TSurveyedSurfaceDetails[] surveyedSurfaces)
        {
            surveyedSurfaces = null;

            ProjectID projectId         = (item as Tuple <ProjectID, DataID>).Item1;
            DataID    surveyedSurfaceId = (item as Tuple <ProjectID, DataID>).Item2;

            return(raptorClient.DiscardGroundSurfaceFileDetails(projectId.ProjectId ?? VelociraptorConstants.NO_PROJECT_ID, surveyedSurfaceId.dataId));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Serialize the request ignoring the Data property so not to overwhelm the logs.
 /// </summary>
 public static string SerializeObjectIgnoringProperties(ProjectID request, params string[] properties)
 {
     return(JsonConvert.SerializeObject(
                request,
                Formatting.None,
                new JsonSerializerSettings {
         ContractResolver = new JsonContractPropertyResolver(properties)
     }));
 }
Ejemplo n.º 11
0
        public async Task <CoordinateSystemSettings> Get([FromRoute] long projectId)
        {
            var projectUid = await((RaptorPrincipal)User).GetProjectUid(projectId);
            var request    = new ProjectID(projectId, projectUid);

            request.Validate();

            return(await RequestExecutorContainerFactory.Build <CoordinateSystemExecutorGet>(logger,
                                                                                             configStore : configStore, trexCompactionDataProxy : trexCompactionDataProxy, customHeaders : CustomHeaders).ProcessAsync(request) as CoordinateSystemSettings);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //绑定项目
         ProjectID.DataSource     = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll();
         ProjectID.DataTextField  = "ProjectName";
         ProjectID.DataValueField = "ID";
         ProjectID.DataBind();
     }
 }
Ejemplo n.º 13
0
 public override int GetHashCode()
 {
     return
         (BranchID.GetHashCode() ^
          AccountID.GetHashCode() ^
          SubID.GetHashCode() ^
          ProjectID.GetHashCode() ^
          TaskID.GetHashCode() ^
          CostCodeID.GetHashCode() ^
          InventoryID.GetHashCode());
 }
Ejemplo n.º 14
0
 public override int GetHashCode()
 {
     if (ProjectID != null)
     {
         return(ProjectID.GetHashCode());
     }
     else
     {
         return(base.GetHashCode());
     }
 }
Ejemplo n.º 15
0
        public SurveyedSurfaceResult Get([FromRoute] long projectId)
        {
            ProjectID request = new ProjectID(projectId);

            request.Validate();
#if RAPTOR
            return(RequestExecutorContainerFactory.Build <SurveyedSurfaceExecutorGet>(logger, raptorClient).Process(request) as SurveyedSurfaceResult);
#else
            throw new ServiceException(HttpStatusCode.BadRequest,
                                       new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, "TRex unsupported request"));
#endif
        }
Ejemplo n.º 16
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);
	}
Ejemplo n.º 17
0
 protected void linkbtnSave_Click(object sender, EventArgs e)
 {
     if (IsNewUpdate)
     {
         SaveNewUpdate();
     }
     else
     {
         UpdateItemDetails();
     }
     Response.Redirect("~/Updates.aspx?ProjectID=" + ProjectID.ToString());
 }
Ejemplo n.º 18
0
        public CSIBResult GetCSIB([FromRoute] Guid projectUid)
        {
            Log.LogInformation($"{nameof(GetCSIB)}: {Request.QueryString}");

            var request = new ProjectID(null, projectUid);

            request.Validate();

            return(WithServiceExceptionTryExecute(() =>
                                                  RequestExecutorContainer
                                                  .Build <CSIBExecutor>(ConfigStore, LoggerFactory, ServiceExceptionHandler)
                                                  .Process(request) as CSIBResult));
        }
Ejemplo n.º 19
0
        public Task <ContractExecutionResult> GetCoordinateSystem([FromRoute] Guid projectUid)
        {
            Log.LogInformation($"{nameof(GetCoordinateSystem)}: {Request.QueryString}");

            var request = new ProjectID(null, projectUid);

            request.Validate();

            return(WithServiceExceptionTryExecuteAsync(() =>
                                                       RequestExecutorContainer
                                                       .Build <CoordinateSystemGetExecutor>(ConfigStore, LoggerFactory, ServiceExceptionHandler)
                                                       .ProcessAsync(request)));
        }
Ejemplo n.º 20
0
        public async Task <SurveyedSurfaceResult> Get([FromRoute] Guid projectUid)
        {
            long projectId = await((RaptorPrincipal)User).GetLegacyProjectId(projectUid);
            var  request   = new ProjectID(projectId, projectUid);

            request.Validate();
#if RAPTOR
            return(RequestExecutorContainerFactory.Build <SurveyedSurfaceExecutorGet>(logger, raptorClient).Process(request) as SurveyedSurfaceResult);
#else
            throw new ServiceException(HttpStatusCode.BadRequest,
                                       new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, "TRex unsupported request"));
#endif
        }
Ejemplo n.º 21
0
        public override int GetHashCode()
        {
            int hashCode = -1422345826;

            hashCode = hashCode * -1521134295 + ID.GetHashCode();
            hashCode = hashCode * -1521134295 + ProjectID.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Detail);

            hashCode = hashCode * -1521134295 + Status.GetHashCode();
            hashCode = hashCode * -1521134295 + AssignedToUserID.GetHashCode();
            hashCode = hashCode * -1521134295 + CreatedOn.GetHashCode();
            return(hashCode);
        }
Ejemplo n.º 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //项目ID
         ProjectID.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56);
         ProjectID.DataTextField  = "ClassName";
         ProjectID.DataValueField = "ClassName";
         ProjectID.DataBind();
         ProjectID.Items.Insert(0, new ListItem("选择项目类别", ""));
         ProjectName.Items.Insert(0, new ListItem("选择项目", ""));
         ChangeTime.Value = DateTime.Now.ToString("yyyy-MM-dd");
     }
 }
        public int CompareTo(ProteinBenchmarkIdentifier other)
        {
            var projectIDComparison = ProjectID.CompareTo(other.ProjectID);

            if (projectIDComparison != 0)
            {
                return(projectIDComparison);
            }
            var processorComparison = string.Compare(Processor, other.Processor, StringComparison.Ordinal);

            if (processorComparison != 0)
            {
                return(processorComparison);
            }
            return(Threads.CompareTo(other.Threads));
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //绑定项目
         ProjectID.DataSource     = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll();
         ProjectID.DataTextField  = "ProjectName";
         ProjectID.DataValueField = "ID";
         ProjectID.DataBind();
         ProjectID.Items.Insert(0, new ListItem("选择项目", ""));
         //供应单位
         POC_Name.DataSource     = WebBLL.Tbl_ProjectBuilderManager.GetTbl_ProjectBuilderAll();
         POC_Name.DataTextField  = "POC_Name";
         POC_Name.DataValueField = "POC_Name";
         POC_Name.DataBind();
         POC_Name.Items.Insert(0, new ListItem("选择供应单位", ""));
     }
 }
Ejemplo n.º 26
0
        public ContractExecutionResult GetDel([FromRoute] long projectId, [FromRoute] long surveyedSurfaceId)
        {
            ProjectID projId = new ProjectID(projectId);

            projId.Validate();

            DataID ssId = DataID.CreateDataID(surveyedSurfaceId);

            ssId.Validate();
#if RAPTOR
            return
                (RequestExecutorContainerFactory.Build <SurveyedSurfaceExecutorDelete>(logger, raptorClient)
                 .Process(new Tuple <ProjectID, DataID>(projId, ssId)));
#else
            throw new ServiceException(HttpStatusCode.BadRequest,
                                       new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, "TRex unsupported request"));
#endif
        }
Ejemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //项目类别
         ProjectID.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56);
         ProjectID.DataTextField  = "ClassName";
         ProjectID.DataValueField = "ClassName";
         ProjectID.DataBind();
         ProjectName.Items.Insert(0, new ListItem("选择项目", ""));
         //单位类型
         PBC_CompanyType.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(97);
         PBC_CompanyType.DataTextField  = "ClassName";
         PBC_CompanyType.DataValueField = "ClassName";
         PBC_CompanyType.DataBind();
         PBC_CompanyType.Items.Insert(0, new ListItem("选择单位类型", ""));
         PBC_CompanyID.Items.Insert(0, new ListItem("选择单位", ""));
     }
 }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //项目类型绑定
                ProjectID.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56);
                ProjectID.DataTextField  = "ClassName";
                ProjectID.DataValueField = "ClassName";
                ProjectID.DataBind();

                ProjectID.Items.Insert(0, new ListItem("选择项目类别", ""));
                ProjectName.Items.Insert(0, new ListItem("选择项目", ""));
                FlowWorkID.Items.Insert(0, new ListItem("选择流程", ""));
                FlowNodeID.Items.Insert(0, new ListItem("选择节点", ""));

                //遍历绑定人员列表
                WebBLL.Tbl_UserManager.GetUsersByListBox(UserName);
            }
        }
Ejemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //绑定项目
                ProjectID.DataSource     = WebBLL.Tbl_ProjectManager.GetTbl_ProjectAll();
                ProjectID.DataTextField  = "ProjectName";
                ProjectID.DataValueField = "ID";
                ProjectID.DataBind();
                ProjectID.Items.Insert(0, new ListItem("选择项目", ""));

                //专业
                ClassName.DataSource     = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15);
                ClassName.DataTextField  = "ClassName";
                ClassName.DataValueField = "ClassName";
                ClassName.DataBind();
                ClassName.Items.Insert(0, new ListItem("选择专业", ""));
            }
        }
Ejemplo n.º 30
0
        public async Task <ContractExecutionResult> GetDel([FromRoute] Guid projectUid, [FromRoute] long surveyedSurfaceId)
        {
            long projectId = await((RaptorPrincipal)User).GetLegacyProjectId(projectUid);
            var  projId    = new ProjectID(projectId, projectUid);

            projId.Validate();

            var ssId = DataID.CreateDataID(surveyedSurfaceId);

            ssId.Validate();
#if RAPTOR
            return
                (RequestExecutorContainerFactory.Build <SurveyedSurfaceExecutorDelete>(logger, raptorClient)
                 .Process(new Tuple <ProjectID, DataID>(projId, ssId)));
#else
            throw new ServiceException(HttpStatusCode.BadRequest,
                                       new ContractExecutionResult(ContractExecutionStatesEnum.ValidationError, "TRex unsupported request"));
#endif
        }