protected void gvwProject_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string value = this.gvwProject.DataKeys[e.Row.RowIndex]["PrjGuid"].ToString(); string text = this.gvwProject.DataKeys[e.Row.RowIndex]["PrjState"].ToString(); e.Row.Attributes["id"] = value; e.Row.Attributes["Guid"] = value; e.Row.Attributes["state"] = text; e.Row.Attributes["flowState"] = this.gvwProject.DataKeys[e.Row.RowIndex]["GiveUpFlowState"].ToString(); if (text == ProjectParameter.Bid || text == ProjectParameter.QualificationPass) { e.Row.Cells[8].Text = ""; return; } } else { if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; System.Collections.Generic.List <int> prjState = this.GetPrjState(); decimal sumTotal = TenderInfo.GetSumTotal(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtName.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.txtTenderPrjManager.Text, 3, ProjectParameter.QualificationPass, "PftFlowState"); e.Row.Cells[6].Text = sumTotal.ToString("#0.000"); e.Row.Cells[6].Style.Add("text-align", "right"); e.Row.Cells[6].CssClass = "decimal_input"; } } }
protected void gvDataInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["id"] = this.gvDataInfo.DataKeys[e.Row.RowIndex].Value.ToString(); return; } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; System.Collections.Generic.List <int> prjState = new System.Collections.Generic.List <int> { int.Parse(ProjectParameter.Initiate), int.Parse(ProjectParameter.GiveUpState) }; System.Collections.Generic.List <int> flowState = new System.Collections.Generic.List <int> { 1 }; decimal sumTotal = TenderInfo.GetSumTotal(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, flowState, base.UserCode, this.txtName.Text, 4, ProjectParameter.Approval, null); e.Row.Cells[6].Text = sumTotal.ToString("#0.000"); e.Row.Cells[6].Style.Add("text-align", "right"); e.Row.Cells[6].CssClass = "decimal_input"; } }
private void BindData() { string text = base.Request["prjId"].ToString(); TenderInfo byId = TenderInfo.GetById(text); this.prjName.Text = byId.PrjName; this.prjCode.Text = byId.PrjCode; this.txtPrjState.Text = this.GetStateName(byId.PrjState); this.adjTime.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); this.drpDLstState.SelectedValue = byId.PrjState.ToString(); PTPrjInfoStateChange byPrjIdByOrder = this.prjInfoStatChgSev.GetByPrjIdByOrder(text, -1); if (byPrjIdByOrder != null) { this.drpDLstState.SelectedValue = byPrjIdByOrder.ChangeState.ToString(); if (!string.IsNullOrEmpty(byPrjIdByOrder.ChangeTime.ToString())) { this.adjTime.Text = byPrjIdByOrder.ChangeTime.Value.ToString("yyyy-MM-dd"); } this.adjReason.Text = byPrjIdByOrder.ChangeReason; PTyhmc byId2 = new PTYhmcService().GetById(byPrjIdByOrder.ChangeUser); if (byId2 != null) { this.hfldUserCode.Value = byId2.v_yhdm; this.txtAdjustMan.Text = byId2.v_xm; } this.remark.Text = byPrjIdByOrder.Note; this.ViewState["PrjChgStID"] = byPrjIdByOrder.Id; } this.ViewState["prjState"] = byId.PrjState.ToString(); this.ViewState["prjGuId"] = byId.PrjGuid.ToString(); }
protected void gvwProject_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["id"] = this.gvwProject.DataKeys[e.Row.RowIndex].Value.ToString(); return; } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>(); if (string.IsNullOrEmpty(this.dropPrjState.SelectedValue)) { list = new System.Collections.Generic.List <int> { int.Parse(ProjectParameter.Initiate), int.Parse(ProjectParameter.Prequalification), int.Parse(ProjectParameter.QualificationPass), int.Parse(ProjectParameter.QualificationFail) }; } else { list.Add(System.Convert.ToInt32(this.dropPrjState.SelectedValue)); } System.Collections.Generic.List <int> flowState = new System.Collections.Generic.List <int> { 1 }; decimal sumTotal = TenderInfo.GetSumTotal(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, list, flowState, base.UserCode, this.txtName.Text, 4, ProjectParameter.Initiate, "InitiateFlowState"); e.Row.Cells[6].Text = sumTotal.ToString("#0.000"); e.Row.Cells[6].Style.Add("text-align", "right"); e.Row.Cells[6].CssClass = "decimal_input"; } }
protected void gvDataInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string value = this.gvDataInfo.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["id"] = value; e.Row.Attributes["guid"] = value; e.Row.Attributes["state"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PrjState"].ToString(); e.Row.Attributes["OldState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["OldState"].ToString(); e.Row.Attributes["PftFlowState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PftFlowState"].ToString(); return; } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int> { int.Parse(ProjectParameter.Initiate), int.Parse(ProjectParameter.Prequalification) }; if (this.dropPrjState.SelectedValue != "") { list.Clear(); list.Add(int.Parse(this.dropPrjState.SelectedValue)); } System.Collections.Generic.List <int> flowState = new System.Collections.Generic.List <int> { 1 }; decimal sumTotal = TenderInfo.GetSumTotal(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, list, flowState, base.UserCode, this.txtName.Text, 4, null, "InitiateFlowState"); e.Row.Cells[6].Text = sumTotal.ToString("#0.000"); e.Row.Cells[6].Style.Add("text-align", "right"); e.Row.Cells[6].CssClass = "decimal_input"; } }
protected void gvDataInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { if (e.Row.RowType == DataControlRowType.Footer) { string selectedValue = this.dropPrjType.SelectedValue; decimal sumTotalAtChgState = TenderInfo.GetSumTotalAtChgState(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtBuildUnit.Text, selectedValue, this.txtStartTime.Text, this.txtEndTime.Text, this.GetState(2), this.GetState(1), base.UserCode, string.Empty, 3, "ChangeFlowSate"); e.Row.Cells[1].Text = "合计"; e.Row.Cells[8].Text = sumTotalAtChgState.ToString("#0.000"); e.Row.Cells[8].Style.Add("text-align", "right"); e.Row.Cells[8].CssClass = "decimal_input"; } return; } string text = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PrjGuid"].ToString(); e.Row.Attributes["id"] = text; e.Row.Attributes["guid"] = text; e.Row.Attributes["PrjState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PrjState"].ToString(); e.Row.Attributes["prjInfoState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PrjInfoState"].ToString(); e.Row.Attributes["flowState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["ChangeFlowSate"].ToString(); PTPrjInfoStateChange byPrjIdByOrder = new PTPrjInfoStateChangeService().GetByPrjIdByOrder(text, -1); if (byPrjIdByOrder != null) { e.Row.Attributes["changed"] = "1"; return; } e.Row.Attributes["changed"] = "0"; }
protected void btnSave_Click(object sender, System.EventArgs e) { string value = this.hfldPrjId.Value; if (!string.IsNullOrEmpty(value)) { System.Guid id = new System.Guid(value); PTPrjInfoZTBService pTPrjInfoZTBService = new PTPrjInfoZTBService(); PTPrjInfoZTBDetailService pTPrjInfoZTBDetailService = new PTPrjInfoZTBDetailService(); PTPrjInfoZTB byId = pTPrjInfoZTBService.GetById(id); PTPrjInfoZTBDetail byId2 = pTPrjInfoZTBDetailService.GetById(value); TenderInfo.GetById(value); System.DateTime?successBidDate = null; if (!string.IsNullOrEmpty(this.txtSuccessBidDate.Text)) { successBidDate = new System.DateTime?(System.Convert.ToDateTime(this.txtSuccessBidDate.Text.Trim())); } byId2.SuccessBidDate = successBidDate; decimal?num = null; if (!string.IsNullOrEmpty(this.txtSuccessBidPrice.Text)) { num = new decimal?(System.Convert.ToDecimal(this.txtSuccessBidPrice.Text.Trim())); } byId2.SuccessBidPrice = num; byId2.SuccessBidRemark = this.txtSuccessBidRemark.Text.Trim(); byId.PrjCost = new double?(System.Convert.ToDouble(num)); byId.PrjStateChangeTime = new System.DateTime?(System.DateTime.Now); byId.PrjState = new int?(int.Parse(ProjectParameter.WinBid)); byId.ParentTypeCode = pTPrjInfoZTBService.GetParentTypeCode(this.dropParentProject.SelectedValue); pTPrjInfoZTBService.Update(byId); pTPrjInfoZTBDetailService.Update(byId2); base.RegisterScript("top.ui.alert('中标资料保存成功!');top.ui.closeWin();top.ui.reloadTab();"); } }
public static string GetWFName(string businesscode, string instancecode) { DataTable table = SqlHelper.ExecuteQuery(CommandType.Text, " select * from WF_BusinessCode where BusinessCode='" + businesscode + "' ", new SqlParameter[0]); string str = string.Empty; try { DataTable table2 = SqlHelper.ExecuteQuery(CommandType.Text, " select " + table.Rows[0]["NameField"].ToString() + " from " + table.Rows[0]["LinkTable"].ToString() + " where " + table.Rows[0]["PrimaryField"].ToString() + " ='" + instancecode + "' ", new SqlParameter[0]); if (businesscode == "089") { if (!string.IsNullOrEmpty(table2.Rows[0][0].ToString())) { str = str + "—" + TenderInfo.GetProjectName(table2.Rows[0][0].ToString()); } return(str); } if ((businesscode == "100") || (businesscode == "106")) { if (!string.IsNullOrEmpty(table2.Rows[0][0].ToString())) { str = str + "—" + cn.justwin.PrjManager.ProjectInfo.GetProjectName(table2.Rows[0][0].ToString()); } return(str); } if (!string.IsNullOrEmpty(table2.Rows[0][0].ToString())) { str = str + "—" + table2.Rows[0][0].ToString(); } } catch { } return(str); }
protected void gvDataInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string value = this.gvDataInfo.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["id"] = value; e.Row.Attributes["flowState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["GiveUpFlowState"].ToString(); e.Row.Attributes["guid"] = value; e.Row.Attributes["PrjState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["PrjState"].ToString(); e.Row.Attributes["IsGiveUp"] = System.Convert.ToInt32(this.gvDataInfo.DataKeys[e.Row.RowIndex]["IsGiveUp"]).ToString(); return; } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; System.Collections.Generic.List <int> prjState = new System.Collections.Generic.List <int> { 1, 2, 3, 4, 14, 15, 16, 18, 19 }; decimal sumTotalAtGiveUp = TenderInfo.GetSumTotalAtGiveUp(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.txtName.Text, 4); e.Row.Cells[6].Text = sumTotalAtGiveUp.ToString("#0.000"); e.Row.Cells[6].Style.Add("text-align", "right"); e.Row.Cells[6].CssClass = "decimal_input"; } }
protected void btnExcel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <int> prjState = this.GetPrjState(); DataTable all = TenderInfo.GetAll(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtName.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.hfldTenderPrjManager.Value, false, 3, this.AspNetPager1.CurrentPageIndex, 2147483647, "", "BidFlowState"); System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); foreach (DataControlField dataControlField in this.gvwProject.Columns) { string headerText = dataControlField.HeaderText; if (headerText != "") { list.Add(headerText); } } string[] source = new string[] { "No", "StateText", "Person", "PrjCode", "PrjName", "WorkUnitName", "PrjCost", "Duration", "InputDate" }; string[] totalField = new string[] { "PrjCost" }; ExcelHelper.ExportExcel(all, list.ToArray(), source.ToArray <string>(), totalField, base.Title.Trim() + ".xls", base.Request.Browser.Browser); }
protected void gvTender_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].Text = "合计"; DataTable tenderReport = TenderInfo.GetTenderReport(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.ddlType.SelectedValue.Trim(), this.txtManager.Value.Trim(), this.txtPrjFollowPeople.Value.Trim(), this.txtPrjPeople.Value.Trim(), this.ddlPrjState.SelectedValue.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text, this.txtOwnerName.Text.Trim(), this.txtProjPeopleDep.Text, this.dropPrjProperty.SelectedValue, this.txtPrincipal.Value.Trim(), 1, this.AspNetPager1.PageSize * this.AspNetPager1.RecordCount, base.UserCode, this.txtPrjStateChangeTimeStart.Text.Trim(), this.txtPrjStateChangeTimeEnd.Text.Trim()); e.Row.Cells[8].Text = tenderReport.Compute("SUM(PrjCost)", string.Empty).ToString(); e.Row.Cells[8].Style.Add("text-align", "right"); e.Row.Cells[8].CssClass = "decimal_input"; e.Row.Cells[9].Text = tenderReport.Compute("SUM(ProfessionalCost)", string.Empty).ToString(); e.Row.Cells[9].Style.Add("text-align", "right"); e.Row.Cells[9].CssClass = "decimal_input"; e.Row.Cells[10].Text = tenderReport.Compute("SUM(SuccessBidPrice)", string.Empty).ToString(); e.Row.Cells[10].Style.Add("text-align", "right"); e.Row.Cells[10].CssClass = "decimal_input"; } return; } string text = this.gvTender.DataKeys[e.Row.RowIndex]["PrjGuid"].ToString(); e.Row.Attributes["id"] = text; PTPrjInfoStateChange byPrjIdByOrder = new PTPrjInfoStateChangeService().GetByPrjIdByOrder(text); if (byPrjIdByOrder != null) { e.Row.Attributes["changed"] = "1"; return; } e.Row.Attributes["changed"] = "0"; }
protected void gvDataInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["id"] = this.gvDataInfo.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["guid"] = this.gvDataInfo.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["WFState"] = this.gvDataInfo.DataKeys[e.Row.RowIndex]["ProjFlowSate"].ToString(); return; } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[1].Text = "合计"; System.Collections.Generic.List <int> prjState = new System.Collections.Generic.List <int> { 1, 2 }; System.Collections.Generic.List <int> flowState = new System.Collections.Generic.List <int>(); if (this.dropWFState.SelectedValue != "") { flowState = new System.Collections.Generic.List <int> { int.Parse(this.dropWFState.SelectedValue) }; } decimal sumTotal = TenderInfo.GetSumTotal(this.txtPrjName.Text.Trim(), this.txtPrjCode.Text.Trim(), this.txtOwner.Text.Trim(), this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), prjState, flowState, base.UserCode, this.txtName.Text.Trim(), 1, null, null); e.Row.Cells[8].Text = sumTotal.ToString("#0.000"); e.Row.Cells[8].Style.Add("text-align", "right"); e.Row.Cells[8].CssClass = "decimal_input"; } }
public bool Parse(TenderInfo tender) { string url = $"http://market.mosreg.ru/Trade/ViewTrade/{tender.Id}"; try { _doc = web.Load(url); HtmlNodeCollection objectWithAddress = _doc.DocumentNode.SelectNodes("//div[contains(@class,'informationAboutCustomer__informationPurchase')]/child::div//p"); tender.DeliveryAddress = objectWithAddress[5].InnerText; tender.Lots = new List <LotInfo>(); HtmlNodeCollection objects = _doc.DocumentNode.SelectNodes("//div[contains(@class,'informationAboutCustomer__resultBlock objectPurchase')]/child::div//div//div//p"); for (int i = 0; i < objects.Count; i++) { LotInfo lotInfo = new LotInfo(); lotInfo.LotName = objects[i].LastChild.InnerText.Replace("\n", "").Replace("\r", ""); lotInfo.Unit = objects[i + 3].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", ""); var amount = objects[i + 4].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", ""); lotInfo.Amount = decimal.Parse(amount); var costString = objects[i + 5].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", ""); lotInfo.CostPerOne = decimal.Parse(costString); tender.Lots.Add(lotInfo); i = i + 6; } return(true); } catch (WebException e) { Console.WriteLine("\nException Caught!"); Console.WriteLine("Message :{0} ", e.Message); return(false); } }
/// <summary> /// Make authorization payment. /// </summary> /// <param name="amount">The amount.</param> /// <param name="currency">The currency.</param> /// <param name="voiceAuthorization">The voice approval code (optional).</param> /// <param name="isManualEntry">If manual credit card entry is required.</param> /// <param name="extensionTransactionProperties">Optional extension transaction properties.</param> /// <returns>A task that can await until the authorization has completed.</returns> public async Task <PaymentInfo> AuthorizePaymentAsync(decimal amount, string currency, string voiceAuthorization, bool isManualEntry, ExtensionTransaction extensionTransactionProperties) { if (amount < this.terminalSettings.MinimumAmountAllowed) { throw new CardPaymentException(CardPaymentException.AmountLessThanMinimumLimit, "Amount does not meet minimum amount allowed."); } if (this.terminalSettings.MaximumAmountAllowed > 0 && amount > this.terminalSettings.MaximumAmountAllowed) { throw new CardPaymentException(CardPaymentException.AmountExceedsMaximumLimit, "Amount exceeds the maximum amount allowed."); } if (this.processor == null) { this.processor = CardPaymentManager.GetPaymentProcessor(this.merchantProperties, this.paymentConnectorName); } PaymentInfo paymentInfo = new PaymentInfo(); // Get tender TenderInfo maskedTenderInfo = await this.GetTenderAsync(true); if (maskedTenderInfo == null) { return(paymentInfo); } paymentInfo.CardNumberMasked = maskedTenderInfo.CardNumber; paymentInfo.CashbackAmount = maskedTenderInfo.CashBackAmount; paymentInfo.CardType = (Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardType)maskedTenderInfo.CardTypeId; if (paymentInfo.CashbackAmount > this.terminalSettings.DebitCashbackLimit) { throw new CardPaymentException(CardPaymentException.CashbackAmountExceedsLimit, "Cashback amount exceeds the maximum amount allowed."); } // Authorize Response response = CardPaymentManager.ChainedAuthorizationCall(this.processor, this.merchantProperties, this.tenderInfo, amount, currency, this.terminalSettings.Locale, this.isTestMode, this.terminalSettings.TerminalId, extensionTransactionProperties); Guid cardStorageKey = Guid.NewGuid(); CardPaymentManager.MapAuthorizeResponse(response, paymentInfo, cardStorageKey, this.terminalSettings.TerminalId); if (paymentInfo.IsApproved) { // Backup credit card number TemporaryCardMemoryStorage <string> cardStorage = new TemporaryCardMemoryStorage <string>(DateTime.UtcNow, this.tenderInfo.CardNumber); cardStorage.StorageInfo = paymentInfo.PaymentSdkData; cardCache.Add(cardStorageKey, cardStorage); // need signature? if (this.terminalSettings.SignatureCaptureMinimumAmount < paymentInfo.ApprovedAmount) { paymentInfo.SignatureData = await this.RequestTenderApprovalAsync(paymentInfo.ApprovedAmount); } } return(paymentInfo); }
/// <summary> /// Gets the private tender. /// </summary> /// <param name="request">The get private tender request.</param> /// <returns>Returns the private tender response.</returns> private GetPrivateTenderPaymentTerminalDeviceResponse GetPrivateTender(GetPrivateTenderPaymentTerminalDeviceRequest request) { ThrowIf.Null(request, nameof(request)); TenderInfo tenderInfo = Utilities.WaitAsyncTask(() => this.GetPrivateTenderAsync(request.Amount, request.Declined, request.IsSwipe)); return(new GetPrivateTenderPaymentTerminalDeviceResponse(tenderInfo)); }
private void bindGv() { System.Collections.Generic.List <int> prjState = this.GetPrjState(); int count = TenderInfo.GetCount(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtName.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.txtTenderPrjManager.Text, 3, "", "BidFlowState"); this.AspNetPager1.RecordCount = count; this.gvwProject.DataSource = TenderInfo.GetAll(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtName.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.txtTenderPrjManager.Text, false, 3, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, "", "BidFlowState"); this.gvwProject.DataBind(); }
/// <summary> /// Get all information about tender /// </summary> /// <param name="tenderInfo"></param> public void GetInfo(TenderInfo tenderInfo) { if (tenderInfo.Id == 0) { Console.WriteLine("Tender not found"); return; } Console.WriteLine("Tender information:"); Console.WriteLine($"Id: " + tenderInfo.Id); Console.WriteLine($"Current status: " + tenderInfo.TradeStateName); Console.WriteLine($"Customer name: " + tenderInfo.CustomerFullName); Console.WriteLine($"Start price: " + tenderInfo.InitialPrice); Console.WriteLine($"Publication date: " + tenderInfo.PublicationDate.ToLocalTime()); Console.WriteLine($"Filling application end date: " + tenderInfo.FillingApplicationEndDate.ToLocalTime()); if (tenderInfo.DeliveryAddress == "") { Console.WriteLine($"Delivery address: Отсутствует"); } else { Console.WriteLine($"Delivery address: " + tenderInfo.DeliveryAddress); } Console.WriteLine($"List of lot positions: "); if (tenderInfo.Lots != null) { foreach (var lot in tenderInfo.Lots) { Console.WriteLine($" Lot name: " + lot.LotName); Console.WriteLine($" Unit: " + lot.Unit); Console.WriteLine($" Amount: " + lot.Amount); Console.WriteLine($" Cost per one: " + lot.CostPerOne); Console.WriteLine(); } } else { Console.WriteLine($" Empty"); } Console.WriteLine($"Documents list:"); if (tenderInfo.Documentation != null) { foreach (var doc in tenderInfo.Documentation) { Console.WriteLine($" Document name: " + doc.FileName); Console.WriteLine($" URL: " + doc.Url); Console.WriteLine(); } } else { Console.WriteLine($" Empty"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.txtAgent.Attributes["ReadOnly"] = "true"; this.txtName.Attributes["ReadOnly"] = "true"; this.txtBusinessman.Attributes["ReadOnly"] = "true"; this.txtOwner.Attributes["ReadOnly"] = "true"; this.txtDutyPerson.Attributes["ReadOnly"] = "true"; this.hfldIsEditProjectCode.Value = this.isEditProjectCode; this.dropBind(); if (base.Request["Action"].ToString() == "Add") { this.hfldPrjGuid.Value = System.Guid.NewGuid().ToString(); this.FileUpload1.Class = "ProjectFile"; this.FileUpload1.RecordCode = this.hfldPrjGuid.Value; string str = ConfigHelper.Get("PMStatus"); if (str == "1") { this.hfldPrjState.Value = "7";//新建,状态直接为在建 } else { this.hfldPrjState.Value = "17";//待开工 } this.hfldPrjPeople.Value = base.UserCode; DataTable userInfo = TenderInfo.GetUserInfo(base.UserCode); if (userInfo.Rows.Count > 0) { this.txtName.Text = userInfo.Rows[0]["UserName"].ToString(); this.txtCorp.Text = userInfo.Rows[0]["CorpName"].ToString(); this.txtDuty.Text = userInfo.Rows[0]["Duty"].ToString(); this.txtPhone.Text = userInfo.Rows[0]["Phone"].ToString(); } IApplicationContext context = ContextRegistry.GetContext(); IProjectCode projectCode = context.GetObject("ProjectCode") as IProjectCode; this.txtPrjCode.Value = projectCode.CreateProjectCode(); } if (base.Request["Action"].ToString() == "Update") { this.hfldPrjGuid.Value = base.Request["PrjId"]; this.BindTxt(base.Request["PrjId"].ToString()); this.FileUpload1.Class = "ProjectFile"; this.FileUpload1.RecordCode = base.Request["PrjId"].ToString(); tenderBondSelect(base.Request["PrjId"]);//绑定投标保证金 return; } } else { if (!string.IsNullOrEmpty(this.dropprovince.SelectedValue)) { this.bindCity(); } } }
protected void BindGv() { int tenderReportCount = TenderInfo.GetTenderReportCount(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.ddlType.SelectedValue.Trim(), this.txtManager.Value.Trim(), this.txtPrjFollowPeople.Value.Trim(), this.txtPrjPeople.Value.Trim(), this.ddlPrjState.SelectedValue.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text, this.txtOwnerName.Text.Trim(), this.txtProjPeopleDep.Text, this.dropPrjProperty.SelectedValue, this.txtPrincipal.Value.Trim(), base.UserCode, this.txtPrjStateChangeTimeStart.Text.Trim(), this.txtPrjStateChangeTimeEnd.Text.Trim()); this.AspNetPager1.RecordCount = tenderReportCount; DataTable tenderReport = TenderInfo.GetTenderReport(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.ddlType.SelectedValue.Trim(), this.txtManager.Value.Trim(), this.txtPrjFollowPeople.Value.Trim(), this.txtPrjPeople.Value.Trim(), this.ddlPrjState.SelectedValue.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text, this.txtOwnerName.Text.Trim(), this.txtProjPeopleDep.Text, this.dropPrjProperty.SelectedValue, this.txtPrincipal.Value.Trim(), this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, base.UserCode, this.txtPrjStateChangeTimeStart.Text.Trim(), this.txtPrjStateChangeTimeEnd.Text.Trim()); this.gvTender.DataSource = tenderReport; this.gvTender.DataBind(); this.ComputSum(); }
/// <summary> /// Make refund payment. /// </summary> /// <param name="amount">The amount.</param> /// <param name="currency">The currency.</param> /// <param name="isManualEntry">If manual credit card entry is required.</param> /// <param name="extensionTransactionProperties">Optional extension transaction properties.</param> /// <returns>A task that can await until the refund has completed.</returns> public async Task <PaymentInfo> RefundPaymentAsync(decimal amount, string currency, bool isManualEntry, ExtensionTransaction extensionTransactionProperties) { if (amount < this.terminalSettings.MinimumAmountAllowed) { throw new CardPaymentException(CardPaymentException.AmountLessThanMinimumLimit, "Amount does not meet minimum amount allowed."); } if (this.terminalSettings.MaximumAmountAllowed > 0 && amount > this.terminalSettings.MaximumAmountAllowed) { throw new CardPaymentException(CardPaymentException.AmountExceedsMaximumLimit, "Amount exceeds the maximum amount allowed."); } if (this.processor == null) { this.processor = CardPaymentManager.GetPaymentProcessor(this.merchantProperties, this.paymentConnectorName); } PaymentInfo paymentInfo = new PaymentInfo(); // Get tender TenderInfo maskedTenderInfo = await this.GetTenderAsync(false); if (maskedTenderInfo == null) { return(paymentInfo); } paymentInfo.CardNumberMasked = maskedTenderInfo.CardNumber; paymentInfo.CashbackAmount = maskedTenderInfo.CashBackAmount; paymentInfo.CardType = (Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardType)maskedTenderInfo.CardTypeId; if (paymentInfo.CashbackAmount > this.terminalSettings.DebitCashbackLimit) { throw new CardPaymentException(CardPaymentException.CashbackAmountExceedsLimit, "Cashback amount exceeds the maximum amount allowed."); } // Refund Response response = CardPaymentManager.ChainedRefundCall(this.processor, this.merchantProperties, this.tenderInfo, amount, currency, this.terminalSettings.Locale, this.isTestMode, this.terminalSettings.TerminalId, extensionTransactionProperties); CardPaymentManager.MapRefundResponse(response, paymentInfo); if (paymentInfo.IsApproved) { // need signature? if (this.terminalSettings.SignatureCaptureMinimumAmount < paymentInfo.ApprovedAmount) { paymentInfo.SignatureData = await this.RequestTenderApprovalAsync(paymentInfo.ApprovedAmount); } } return(paymentInfo); }
public string CreateTenderCode() { int tenderCountToday = this.GetTenderCountToday(); string prjCode = "T" + this.CreateCode(tenderCountToday); int num2 = 0; while (TenderInfo.IsSameCode(prjCode)) { num2++; prjCode = "T" + this.CreateCode(tenderCountToday + num2); } return(prjCode); }
protected void btnExport_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <int> prjState = new System.Collections.Generic.List <int> { 1, 2, 3, 4, 14, 15, 16, 18, 19 }; DataTable allAtGiveUp = TenderInfo.GetAllAtGiveUp(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, null, base.UserCode, this.txtName.Text, false, 4, this.AspNetPager1.CurrentPageIndex, 2147483647); string[] headerName = new string[] { "序号", "项目状态", "项目跟踪人", "项目编号", "项目名称", "建设单位", "项目类型", "工程造价", "工程工期", "立项申请日期" }; string[] fieldName = new string[] { "", "StateText", "Person", "PrjCode", "PrjName", "WorkUnitName", "PrjTypeName", "PrjCost", "Duration", "InputDate" }; string[] totalField = new string[] { "PrjCost" }; ExcelHelper.ExportExcel(allAtGiveUp, headerName, fieldName, totalField, "启动项目一览.xls", base.Request.Browser.Browser); }
protected void bindGv() { System.Collections.Generic.List <int> prjState = new System.Collections.Generic.List <int> { 18 }; System.Collections.Generic.List <int> flowState = new System.Collections.Generic.List <int>(1); string text = this.txtName.Text; int count = TenderInfo.GetCount(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, flowState, base.UserCode, text, 4, null, "GiveUpFlowState"); this.AspNetPager1.RecordCount = count; this.AspNetPager1.PageSize = NBasePage.pagesize; DataTable all = TenderInfo.GetAll(this.txtPrjName.Text, this.txtPrjCode.Text, this.txtOwner.Text, this.dropPrjKindClass.SelectedValue, this.txtStartTime.Text, this.txtEndTime.Text, prjState, flowState, base.UserCode, text, false, 4, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, null, "GiveUpFlowState"); this.gvDataInfo.DataSource = all; this.gvDataInfo.DataBind(); }
private static void AuditDefined(int instanceId, string instanceCode, string businessCode, string businessClass, string lastFlowState, string tableName, string columnName) { string str2 = SelfEventAction.GetTypeName(AppDomain.CurrentDomain.BaseDirectory + "SelfEventInfo.xml", tableName, columnName); if (!string.IsNullOrWhiteSpace(str2)) { ISelfEvent event2 = (ISelfEvent)Assembly.Load("PmBusinessLogic").CreateInstance(str2); if (event2 != null) { string maxSing = FlowAuditAction.GetMaxSing(instanceId); if ((lastFlowState == "1") && (maxSing == "1")) { event2.CommitEvent(instanceCode.ToString()); } else if (lastFlowState == "-2") { event2.RefuseEvent(instanceCode.ToString()); } else if (lastFlowState == "-3") { event2.RestatedEvent(instanceCode.ToString()); } } } if (lastFlowState == "1") { if (businessCode == "089") { TenderInfo.UpdatePrjState(Guid.Parse(instanceCode), 2); } else if (businessCode == "100") { PrjMember.AddLimit(Guid.Parse(instanceCode)); } else if (businessCode == "107") { Progress.UpdateLatest(instanceCode.ToString()); } else if (businessCode == "108") { cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(instanceCode.ToString()); } MsgOrganiger(instanceId, businessCode, businessClass); } }
protected void btnexecl_Click(object sender, System.EventArgs e) { DataTable tenderReport = TenderInfo.GetTenderReport(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.ddlType.SelectedValue.Trim(), this.txtManager.Value.Trim(), this.txtPrjFollowPeople.Value.Trim(), this.txtPrjPeople.Value.Trim(), this.ddlPrjState.SelectedValue.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text, this.txtOwnerName.Text.Trim(), this.txtProjPeopleDep.Text, this.dropPrjProperty.SelectedValue, this.txtPrincipal.Value.Trim(), 1, 2147483647, base.UserCode, this.txtPrjStateChangeTimeStart.Text.Trim(), this.txtPrjStateChangeTimeEnd.Text.Trim()); if (tenderReport.Rows.Count > 0) { DataRow dataRow = tenderReport.NewRow(); dataRow["ItemName"] = "合计"; dataRow["PrjCost"] = tenderReport.Compute("sum(PrjCost)", "1>0"); dataRow["ProfessionalCost"] = tenderReport.Compute("sum(ProfessionalCost)", "1>0"); dataRow["SuccessBidPrice"] = tenderReport.Compute("sum(SuccessBidPrice)", "1>0"); tenderReport.Rows.Add(dataRow); } this.FormatTable(tenderReport); string value = this.hfldSummarizingInfo.Value; ExcelHelper.ExportFooterExcel(tenderReport, "项目市场状态一览", "项目市场状态一览", "项目市场状态一览.xls", null, null, 1, value, base.Request.Browser.Browser); }
private void SetExpirationMonthYear(string expiration, TenderInfo tenderInfo) { if (tenderInfo != null && !string.IsNullOrEmpty(expiration) && expiration.Length == 4) { string year = expiration.Substring(0, 2); int yearValue; if (int.TryParse(year, out yearValue)) { tenderInfo.ExpirationYear = yearValue + 2000; } string month = expiration.Substring(2, 2); int monthValue; if (int.TryParse(month, out monthValue)) { tenderInfo.ExpirationMonth = monthValue; } } }
/// <summary> /// 根据债权信息获取投标成功的投标信息 /// </summary> /// <param name="credId"></param> /// <returns></returns> public TenderInfo GetTenderByCredId(int credId) { string sql = "select * from dbo.TenderInfo where creditinfoid = " + credId + " and issuccess = 1"; TenderInfo info = null; using (SqlDataReader reader = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.Text, sql, null)) { if (reader.Read()) { info = new TenderInfo(); info.TenderId = credId; info.Message = reader["Message"].ToString(); info.CreditInfoId = Core.MyConvert.GetInt32(reader["CreditInfoId"].ToString()); info.TenderDate = Core.MyConvert.GetDateTime(reader["TenderDate"].ToString()); info.LayerId = Core.MyConvert.GetInt32(reader["LayerId"].ToString()); info.IsSuccess = Core.MyConvert.GetInt32(reader["IsSuccess"].ToString()); } } return info; }
protected void btnSave_Click(object sender, EventArgs e) { try { TenderInfo byId = TenderInfo.GetById(this.prjId); DateTime? projStartDate = null; if (!string.IsNullOrEmpty(this.txtProjStartDate.Text)) { projStartDate = new DateTime?(Convert.ToDateTime(this.txtProjStartDate.Text)); } byId.ProjStartDate = projStartDate; byId.ProjStartRemark = this.txtStartRemark.Text; byId.PrjDutyPerson = this.hfldPrjDutyPerson.Value; byId.PrjManager = this.txtStartManager.Text; byId.UpdatePart(byId, "3"); base.RegisterShow("系统提示", "启动成功"); } catch (Exception) { base.RegisterShow("系统提示", "启动失败"); } }
protected void bindBidData() { string text = base.Request["id"]; DataTable partTender = TenderInfo.GetPartTender(text, "4", base.UserCode); if (partTender.Rows.Count > 0) { DataRow dataRow = partTender.Rows[0]; this.dropTenderAppraiseMethod.SelectedValue = dataRow["TenderAppraiseMethod"].ToString(); this.txtTenderAnswerDate.Text = Common2.GetTime(dataRow["ProjTenderAnswerDate"]); this.txtTenderBeginDate.Text = Common2.GetTime(dataRow["ProjTenderBeginDate"]); this.txtTenderAverage.Text = dataRow["TenderAverage"].ToString(); this.txtTenderCeilingPrice.Text = dataRow["TenderCeilingPrice"].ToString(); this.txtTenderContent.Text = dataRow["ProjTenderContent"].ToString(); this.txtTenderCostContent.Text = dataRow["ProjTenderCostContent"].ToString(); this.txtTenderEarnestMoney.Text = dataRow["ProjTenderEarnestMoney"].ToString(); this.txtTenderPrjManager.Text = dataRow["PrjManagerName"].ToString(); this.hfldPrjManage.Value = dataRow["PrjManager"].ToString(); this.txtTenderQuote.Text = dataRow["TenderQuote"].ToString(); this.txtTenderRemark.Text = dataRow["ProjTenderRemark"].ToString(); this.txtTenderUnit.Text = dataRow["TenderUnit"].ToString(); this.dropTenderPayWay.SelectedValue = dataRow["ProjTenderPayWay"].ToString(); if (!string.IsNullOrEmpty(dataRow["TenderProspect"].ToString())) { this.txtTenderProspect.Text = Common2.GetTime(dataRow["TenderProspect"]); } if (!string.IsNullOrEmpty(dataRow["TenderReadOne"].ToString())) { this.hfldTenderReadOne.Value = dataRow["TenderReadOne"].ToString(); PtYhmc modelById = new PtYhmcBll().GetModelById(this.hfldTenderReadOne.Value); if (modelById != null) { this.txtTenderReadOne.Text = modelById.v_xm; } } } this.FileUpload1.Folder = ConfigurationManager.AppSettings["ProjectFile"].ToString(); this.FileUpload1.RecordCode = text + "_4"; }
private void GetProjectInfo() { if (!string.IsNullOrEmpty(this.hfldPrjId.Value)) { ProjectInfo byId = ProjectInfo.GetById(this.hfldPrjId.Value); if (byId != null) { this.lblProject.Text = byId.PrjName; Label expr_40 = this.lblProject; expr_40.Text = expr_40.Text + "(" + Common2.GetPrjState(byId.PrjState.ToString(), true) + ")"; this.hfldPrjState.Value = byId.PrjState.ToString(); return; } TenderInfo byId2 = TenderInfo.GetById(this.hfldPrjId.Value); if (byId2 != null) { this.lblProject.Text = byId2.PrjName; Label expr_BF = this.lblProject; expr_BF.Text = expr_BF.Text + "(" + Common2.GetPrjState(byId2.PrjState.ToString(), false) + ")"; this.hfldPrjState.Value = byId2.PrjState.ToString(); } } }
/// <summary> /// Fetch token for credit card. /// </summary> /// <param name="isManualEntry">The value indicating whether credit card should be entered manually.</param> /// <param name="extensionTransactionProperties">Optional extension transaction properties.</param> /// <returns>A task that can await until the token generation has completed.</returns> public async Task <PaymentInfo> FetchTokenAsync(bool isManualEntry, ExtensionTransaction extensionTransactionProperties) { PaymentInfo paymentInfo = new PaymentInfo(); // Get tender TenderInfo maskedTenderInfo = await this.GetTenderAsync(false); if (maskedTenderInfo == null) { return(paymentInfo); } if (this.processor == null) { this.processor = CardPaymentManager.GetPaymentProcessor(this.merchantProperties, this.paymentConnectorName); } paymentInfo.CardNumberMasked = maskedTenderInfo.CardNumber; paymentInfo.CashbackAmount = maskedTenderInfo.CashBackAmount; paymentInfo.CardType = (Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardType)maskedTenderInfo.CardTypeId; PaymentProperty[] defaultMerchantProperties = this.merchantProperties; if (this.merchantProperties[0].Namespace.Equals(GenericNamespace.Connector) && this.merchantProperties[0].Name.Equals(ConnectorProperties.Properties)) { defaultMerchantProperties = this.merchantProperties[0].PropertyList; } // Generate card token Request request = CardPaymentManager.GetTokenRequest(defaultMerchantProperties, this.tenderInfo, this.terminalSettings.Locale, extensionTransactionProperties); Response response = this.processor.GenerateCardToken(request, null); CardPaymentManager.MapTokenResponse(response, paymentInfo); return(paymentInfo); }
protected void btnTender_Click(object sender, EventArgs e) { int state = MyConvert.GetInt32(this.hidStae.Value); XYECOM.Model.CreditState cState = (XYECOM.Model.CreditState)state; if (cState != XYECOM.Model.CreditState.Tender) { GotoMsgBoxPageForDynamicPage("该债权信息不能进行投标!", 1, "IndexCreditList.aspx"); } XYECOM.Model.GeneralUserInfo userInfo = Business.CheckUser.UserInfo; if (userInfo == null) { GotoMsgBoxPageForDynamicPage("请登录后进行投标!", 1, "IndexCreditList.aspx"); } if (userInfo.UserType != XYECOM.Model.UserType.Layer && userInfo.UserType != XYECOM.Model.UserType.NotLayer) { GotoMsgBoxPageForDynamicPage("债权帐号不能进行投标!", 1, "IndexCreditList.aspx"); } int credId = MyConvert.GetInt32(this.hidID.Value); //检查该服务商是否已经投标 bool isCheckTender = tenderManage.CheckTenderByCredID(credId, (int)userInfo.userid); if (isCheckTender) { GotoMsgBoxPageForDynamicPage("不能重复投标,请耐心等待债权人选择!", 1, "IndexCreditList.aspx"); } TenderInfo info = new TenderInfo(); info.CreditInfoId = credId; info.IsSuccess = (int)TenderState.Tender; info.LayerId = (int)userInfo.userid; info.Message = this.txtRemark.Text.Trim(); info.TenderDate = DateTime.Now; int result = new TenderInfoManager().InsertTenderInfo(info); if (result > 0) { GotoMsgBoxPageForDynamicPage("投标成功!", 1, "CreditInfoDetail.aspx?Id=" + credId); } else { GotoMsgBoxPageForDynamicPage("投标失败!", 1, "CreditInfoDetail.aspx?Id=" + credId); } }
/// <summary> /// 根据投标编号获取投标信息 /// </summary> /// <param name="id"></param> /// <returns></returns> public TenderInfo GetTenderInfoByID(int id) { string sql = "select * from tenderInfo where TenderId=@Id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@Id",id), }; TenderInfo info = null; using (SqlDataReader reader = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.Text, sql, param)) { if (reader.Read()) { info = new TenderInfo(); info.TenderId = id; info.Message = reader["Message"].ToString(); info.CreditInfoId = Core.MyConvert.GetInt32(reader["CreditInfoId"].ToString()); info.TenderDate = Core.MyConvert.GetDateTime(reader["TenderDate"].ToString()); info.LayerId = Core.MyConvert.GetInt32(reader["LayerId"].ToString()); info.IsSuccess = Core.MyConvert.GetInt32(reader["IsSuccess"].ToString()); } } return info; }
/// <summary> /// 添加竞标信息 /// </summary> /// <param name="info"></param> /// <returns></returns> public int InsertTenderInfo(TenderInfo info) { string sql = @"Insert into TenderInfo (layerId,creditInfoId,Message,TenderDate,IsSuccess) values (@LayerId,@CreditInfoId,@Message,@TenderDate,@IsSuccess)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@LayerId",info.LayerId), new SqlParameter("@CreditInfoId",info.CreditInfoId), new SqlParameter("@Message",info.Message), new SqlParameter("@TenderDate",info.TenderDate), new SqlParameter("@IsSuccess",info.IsSuccess) }; int rowAffected = SqlHelper.ExecuteNonQuery(CommandType.Text, sql, param); return rowAffected; }
/// <summary> /// 添加竞标信息 /// </summary> /// <param name="info"></param> /// <returns></returns> public int InsertTenderInfo(TenderInfo info) { if (info == null) { return 0; } return DAL.InsertTenderInfo(info); }