//合同摘要 void LoasdOrder(CurrentProjectInfo projectInfo) { //if (projectInfo.BeginDate > ClientUtil.ToDateTime("2000-01-01")) //{ // txtStartDate.Value = projectInfo.BeginDate; //} //if (projectInfo.EndDate > ClientUtil.ToDateTime("2000-01-01")) //{ // txtCompleteDate.Value = projectInfo.EndDate; //} //txtQuanlityTarget.InnerText = projectInfo.QuanlityTarget;//质量目标 //txtQualityReword.InnerText = projectInfo.QualityReword;//质量奖惩 //txtSaftyTarget.InnerText = projectInfo.SaftyTarget;//安全目标 //txtSaftyReword.InnerText = projectInfo.SaftyReword;//安全奖惩 //txtProReword.InnerText = projectInfo.ProjecRewordt;//工期奖惩 txtMoneySource.InnerText = EnumUtil <EnumSourcesOfFunding> .GetDescription(projectInfo.SourcesOfFunding);//资金来源 //txtMoneyStates.SelectedIndex = projectInfo.IsFundsAvailabed;//资金到位情况 txtProjectCost.InnerText = UtilityClass.DecimalRound(projectInfo.ProjectCost / 10000, 4); //工程造价 txtRealPreMoney.InnerText = UtilityClass.DecimalRound(projectInfo.RealPerMoney / 10000, 4); //实际预算总金额 txtConstractMoney.InnerText = UtilityClass.DecimalRound(projectInfo.CivilContractMoney / 10000, 4); //土建合同金额 txtInstallOrderMoney.InnerText = UtilityClass.DecimalRound(projectInfo.InstallOrderMoney / 10000, 4); //安装合同金额 txtCollectProport.InnerText = UtilityClass.DecimalRound(projectInfo.ContractCollectRatio, 4); //合同收款比例 txtTurnProport.InnerText = UtilityClass.DecimalRound(projectInfo.ResProportion, 4); //责任上缴比例 txtGroundPrice.InnerText = UtilityClass.DecimalRound(projectInfo.BigModualGroundUpPrice, 4); txtUnderPrice.InnerText = UtilityClass.DecimalRound(projectInfo.BigModualGroundDownPrice, 4); txtExplain.InnerText = projectInfo.Descript;//备注信息(项目说明) }
public async Task Show_current_project_url() { // arrange var expectedUrl = "http://example.org/foo/bar"; var expectedMessage = $"Current Project is: " + expectedUrl; var projectInfo = new CurrentProjectInfo { Url = new Uri(expectedUrl) }; var twitchLibMessage = TwitchLibMessageBuilder.Create() .WithUsername("doesntmatterusername") .Build(); var chatMessage = ChatMessageBuilder.Create() .WithTwitchLibMessage(twitchLibMessage) .WithMessage("!currentproject") .WithChannel("doesntmatterchannel") .Build(); var request = new SayCurrentProject(chatMessage); _mockBucket.Setup(x => x.Get <CurrentProjectInfo>("currentProject")) .Returns(new FakeOperationResult <CurrentProjectInfo> { Success = true, Value = projectInfo }); // act await _handler.Handle(request, CancellationToken.None); // assert _mockTwitchClient.Verify(x => x.SendMessage(It.IsAny <string>(), expectedMessage, false), Times.Once); }
private void BindChart1Data() { ObjectQuery oq = new ObjectQuery(); oq.AddCriterion(Expression.Eq("OwnerOrg.Id", ProjectId)); IList listProject = MGWBS.GWBSSrv.ObjectQuery(typeof(CurrentProjectInfo), oq); CurrentProjectInfo projectInfo = null; if (listProject.Count > 0) { projectInfo = listProject[0] as CurrentProjectInfo; LoadProject(projectInfo); LoasdOrder(projectInfo); } }
protected void gridProject_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Text = (e.Row.RowIndex + 1).ToString(); CurrentProjectInfo project = e.Row.DataItem as CurrentProjectInfo; IList listWarningTarget = list[project]; Color warningTargetBySafeColor = (Color)listWarningTarget[0]; Color warningTargetByQualityColor = (Color)listWarningTarget[1]; Color warningTargetByDurationColor = (Color)listWarningTarget[2]; Color warningTargetByCostColor = (Color)listWarningTarget[3]; bool projectHasData = Convert.ToBoolean(listWarningTarget[11]); decimal warningTargetBySafe = decimal.Round((decimal)listWarningTarget[4], 4); decimal warningTargetByQuality = decimal.Round((decimal)listWarningTarget[5], 4); decimal warningTargetByDuration = decimal.Round((decimal)listWarningTarget[6], 4); decimal warningTargetByCostRealProfit = decimal.Round((decimal)listWarningTarget[7], 4); //成本指标:实际/平均实际利润率 decimal warningTargetByCostResTurnedOver = decimal.Round((decimal)listWarningTarget[8], 4); //成本指标:实际/平均责任上缴比率 decimal warningTargetByCostSumProfit = decimal.Round(ClientUtil.ToDecimal(listWarningTarget[17]) / 10000, 2); //利润额 = 合同收入-实际成本 decimal warningTargetByCostProfitRate = decimal.Round((decimal)listWarningTarget[18], 2); //利润率 = 利润额/合同收入 decimal warningTargetByCostSumLower = decimal.Round((decimal)(ClientUtil.ToDecimal(listWarningTarget[19]) / 10000), 2); //超成本降低额 = 责任成本-实际成本 decimal warningTargetByCostRateLower = decimal.Round((decimal)listWarningTarget[20], 2); //超成本降低率 = 超成本降低额/责任成本 e.Row.Cells[6].BackColor = warningTargetByCostColor; e.Row.Cells[6].ToolTip = ModelToolTip(3, warningTargetByCostColor) + ";" + "利润额:" + warningTargetByCostSumProfit + "万元;利润率:" + warningTargetByCostProfitRate + "%;超成本降低额:" + warningTargetByCostSumLower + "万元;超成本降低率:" + warningTargetByCostRateLower + "%"; //成本 e.Row.Cells[7].BackColor = warningTargetByDurationColor; e.Row.Cells[7].ToolTip = ModelToolTip(4, warningTargetByDurationColor) + ";" + GetWaringDesc2(4, project.OwnerOrg.OperationType, projectHasData, warningTargetByDurationColor, warningTargetByDuration, 0);;//工期 e.Row.Cells[8].BackColor = warningTargetByQualityColor; e.Row.Cells[8].ToolTip = ModelToolTip(2, warningTargetByQualityColor) + ";" + GetWaringDesc2(2, project.OwnerOrg.OperationType, projectHasData, warningTargetByQualityColor, warningTargetByQuality, 0);//质量 e.Row.Cells[9].BackColor = warningTargetBySafeColor; e.Row.Cells[9].ToolTip = ModelToolTip(1, warningTargetBySafeColor) + ";" + GetWaringDesc2(1, project.OwnerOrg.OperationType, projectHasData, warningTargetBySafeColor, warningTargetBySafe, 0);//安全 } }
//工程简介 void LoadProject(CurrentProjectInfo projectInfo) { txtProjectName.InnerText = projectInfo.Name; txtProName.InnerText = projectInfo.ManagerDepart; //txtCode.InnerText = ProjectInfo.Code; //txtProjectType.InnerText = projectInfo.ProjectType;//工程类型 //txtContractWay.InnerText = projectInfo.ContractType;//承包方式 txtProvince.InnerText = (string.IsNullOrEmpty(projectInfo.ProjectLocationProvince) ? "" : projectInfo.ProjectLocationProvince + "省") + (string.IsNullOrEmpty(projectInfo.ProjectLocationCity) ? "" : projectInfo.ProjectLocationCity + "市") + projectInfo.ProjectLocationDescript; txtContracte.InnerText = projectInfo.ContractArea; //承包范围 //txtStructType.InnerText = projectInfo.StructureType;//结构类型 txtBace.InnerText = projectInfo.BaseForm; //基础形式 txtLifeCycleState.InnerText = EnumUtil <EnumProjectLifeCycle> .GetDescription(projectInfo.ProjectLifeCycle); //生命周期状态 if (projectInfo.CreateDate > Convert.ToDateTime("2000-01-01")) { txtCreateDate.InnerText = projectInfo.CreateDate.ToShortDateString();//创建时间 } }
public async Task <Unit> Handle(SetCurrentProject request, CancellationToken cancellationToken) { var message = request.Message; // authorization - maybe this should be a separate object or an attribute or something if (message.Username != _twitchOptions.Value.Username) { return(Unit.Value); } // parse out the url from the message and make sure it's valid var stripped = message.Message.Replace("!setcurrentproject", "").Trim(); var isUri = Uri.TryCreate(stripped, UriKind.Absolute, out var uri); if (!isUri) { _twitchClient.SendMessage(message.Channel, "Sorry, I couldn't understand that URL!"); return(Unit.Value); } try { // store the current project info var currentProjectDocumentKey = "currentProject"; var info = new CurrentProjectInfo(); info.Url = uri; var bucket = await _bucketProvider.GetBucketAsync(); var collection = bucket.DefaultCollection(); await collection.UpsertAsync(currentProjectDocumentKey, info); _twitchClient.SendMessage(message.Channel, "Okay, got it!"); } catch { _twitchClient.SendMessage(message.Channel, "I was unable to store that, sorry!"); } return(default);