/// **************************************************************************** /// <summary> /// 数据加载 /// </summary> /// **************************************************************************** private void LoadData(bool Flag) { RmsPM.BLL.BiddingManage bm = new RmsPM.BLL.BiddingManage(); RmsPM.BLL.BiddingReturn cBiddingReturn = new RmsPM.BLL.BiddingReturn(); if (this.ApplicationCode != "") { cBiddingReturn.BiddingEmitCode = this.ApplicationCode; RmsPM.BLL.BiddingEmit cBiddingEmit = new RmsPM.BLL.BiddingEmit(); cBiddingEmit.BiddingEmitCode = cBiddingReturn.BiddingEmitCode; this.BiddingCode = cBiddingEmit.BiddingCode; } else { bm.BiddingCode = this.BiddingCode; this.ApplicationCode = bm.GetLastBiddingEmitCode(); cBiddingReturn.BiddingEmitCode = this.ApplicationCode; } //主体信息 RmsPM.BLL.Bidding cBidding = new RmsPM.BLL.Bidding(); cBidding.BiddingCode = this.BiddingCode; string LinkUrl = "<a onclick=OpenLargeWindow('../BiddingManage/biddingmodify.aspx?BiddingCode=" + cBidding.BiddingCode + "&State=edit&ProjectCode=" + cBidding.ProjectCode + "')>" + cBidding.Title + "</a>"; this.tdBiddingTitleTop.InnerHtml = LinkUrl; this.ApplicationTitle = cBidding.Title; this.tdProjectNameTop.InnerHtml = RmsPM.BLL.ProjectRule.GetProjectName(cBidding.ProjectCode) + " "; this.tdContractNemberTop.InnerHtml = BiddingSystem.GetContractNemberByBiddingCode(this.BiddingCode) + " "; //if (this.State == ModuleState.Operable) //{ // this.trOperple.Visible = true; // this.txtMeetingContent.Text = cBidding.ContentMeeting.Replace("\n", "<br>").Replace("\r", " "); //} //else //{ // this.trEyeable.Visible = true; // this.tdMeetingContent.InnerHtml = cBidding.ContentMeeting.Replace("\n", "<br>").Replace("\r", " "); //} this.ViewState["Money"] = cBidding.Money; this.ViewState["mostly"] = cBidding.Accessory; this.ViewState["BiddingType"] = cBidding.Type; this.ProjectCode = bm.ProjectCode; DataTable dt = cBiddingReturn.GetBiddingReturns(); //获取最后的压价信息 dt = RmsPM.BLL.BiddingSystem.GetAuditingMessage(dt, this.BiddingCode, this.ApplicationCode); DataView dv1 = new DataView(dt); //按价格排 DataView dv2 = new DataView(dt); dv2.Sort = "BiddingDtlCode,Money"; int le = dv1.Table.Rows.Count; //DataRow dr dv1.Table.Columns.Add("myState", System.Type.GetType("System.String")); int j = 0; int k = 0; foreach (DataRowView drv2 in dv2) { j++; foreach (DataRowView drv1 in dv1) { if (drv2["BiddingReturnCode"] == drv1["BiddingReturnCode"] && drv2["BiddingDtlCode"] == drv1["BiddingDtlCode"]) { drv1["myState"] = drv2["State"]; break; } } } j = 0; k = 0; decimal tempMoney = 0; foreach (DataRowView drv2 in dv2) { j++; foreach (DataRowView drv1 in dv1) { if (drv2["BiddingReturnCode"] == drv1["BiddingReturnCode"] && drv2["BiddingDtlCode"] == drv1["BiddingDtlCode"]) { drv1["myState"] = drv2["State"]; if (System.Convert.ToDecimal(drv1["Money"]) > tempMoney) { this.ViewState["MaxMoney"] = drv1["Money"].ToString(); tempMoney = System.Convert.ToDecimal(drv1["Money"]); } break; } } } this.Repeater1.DataSource = dv1; this.Repeater1.DataBind(); for (int i = 0; i < this.Repeater1.Items.Count; i++) { if (this.SupplierState == ModuleState.Operable) { ((HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkAuditing")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanAuditing")).Visible = false; ((HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkAuditing")).Checked = (dt.Rows[i]["Flag"].ToString() == "1"); } else { ((HtmlInputCheckBox)this.Repeater1.Items[i].FindControl("chkAuditing")).Visible = false; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanAuditing")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanAuditing")).InnerHtml = this.SpanText("1", dt.Rows[i]["Flag"].ToString()); } if (this.State1 == ModuleState.Operable) { for (k = 0; k < ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).Items.Count; k++) { ListItem ud_Item = ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).Items[k]; if (ud_Item.Value == dt.Rows[i]["Design"].ToString()) { ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).Items[k].Selected = true; break; } } // ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).SelectedValue = dt.Rows[i]["Design"].ToString(); ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanDesign")).Visible = false; } else { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanDesign")).InnerHtml = this.SpanText("2", dt.Rows[i]["Design"].ToString()); ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioDesign")).Visible = false; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanDesign")).Visible = true; } if (this.State2 == ModuleState.Operable) { for (k = 0; k < ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioProject")).Items.Count; k++) { ListItem ud_Item = ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioProject")).Items[k]; if (ud_Item.Value == dt.Rows[i]["Design"].ToString()) { ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioProject")).Items[k].Selected = true; break; } } ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioProject")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanProject")).Visible = false; } else { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanProject")).InnerHtml = this.SpanText("2", dt.Rows[i]["Project"].ToString()); ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioProject")).Visible = false; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanProject")).Visible = true; } if (this.State3 == ModuleState.Operable) { for (k = 0; k < ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioConsultant")).Items.Count; k++) { ListItem ud_Item = ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioConsultant")).Items[k]; if (ud_Item.Value == dt.Rows[i]["Design"].ToString()) { ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioConsultant")).Items[k].Selected = true; break; } } ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioConsultant")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanConsultant")).Visible = false; } else { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanConsultant")).InnerHtml = this.SpanText("2", dt.Rows[i]["Consultant"].ToString()); ((RadioButtonList)this.Repeater1.Items[i].FindControl("RadioConsultant")).Visible = false; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanConsultant")).Visible = true; } if (this.State4 == ModuleState.Operable) { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("txtState")).Visible = true; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanState")).Visible = false; } else { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("txtState")).Visible = false; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanState")).Visible = true; } //商务标报价是否显示 if (this.State5 == ModuleState.Sightless) { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("txtState")).InnerHtml = " "; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanState")).InnerHtml = " "; ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spMoney")).InnerHtml = " "; } //显示评选结果 if (this.SetAgreementMessage == ModuleState.Sightless) { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanDesign")).Visible = false; } if (this.SetProjectMessage == ModuleState.Sightless) { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanProject")).Visible = false; } if (this.SetAdviserMessage == ModuleState.Sightless) { ((HtmlGenericControl)this.Repeater1.Items[i].FindControl("spanConsultant")).Visible = false; } } dt.Dispose(); }
/// **************************************************************************** /// <summary> /// 数据加载 /// </summary> /// **************************************************************************** private void LoadData(bool Flag) { this.ViewState["BiddingReturnCodeStr"] = ""; if (this.ApplicationCode != "") { RmsPM.BLL.BiddingMessage cBiddingMessage = new RmsPM.BLL.BiddingMessage(); cBiddingMessage.BiddingMessageCode = this.ApplicationCode; this.BiddingCode = cBiddingMessage.BiddingCode; this.ProjectCode = cBiddingMessage.ProjectCode; this.SupplierCode = cBiddingMessage.Supplier; this.ProjectCode = cBiddingMessage.ProjectCode; RmsPM.BLL.Bidding bidding = new RmsPM.BLL.Bidding(); bidding.BiddingCode = cBiddingMessage.BiddingCode; this.ViewState["Money"] = bidding.Money; this.ViewState["mostly"] = bidding.Accessory; this.ViewState["BiddingType"] = bidding.Type; if (Flag) { this.txtProjectCode.InnerHtml = " " + RmsPM.BLL.ProjectRule.GetProjectName(cBiddingMessage.ProjectCode); this.txtContractNember.Value = cBiddingMessage.ContractNember; this.txtContractName.Value = cBiddingMessage.ContractName; this.txtContractType.InnerHtml = " " + RmsPM.BLL.ContractRule.GetContractTypeName(cBiddingMessage.ContractType); this.txtContractDate.Value = cBiddingMessage.ContractDate; //this.TxtRemark.Value = cBiddingMessage.Remark; //this.SelectName.Value = cBiddingMessage.AttachUser; DataTable dt = bidding.GetBiddingReturnNoMessage(); foreach (DataRow dr in dt.Select()) { ListItem li = new ListItem(RmsPM.BLL.ProjectRule.GetSupplierName(dr["SupplierCode"].ToString()), dr["SupplierCode"].ToString()); if (!DropSupplier.Items.Contains(li)) { this.DropSupplier.Items.Add(li); } } ListItem lis = new ListItem(RmsPM.BLL.ProjectRule.GetSupplierName(cBiddingMessage.Supplier), cBiddingMessage.Supplier); this.DropSupplier.Items.Add(lis); this.DropSupplier.SelectedIndex = this.DropSupplier.Items.IndexOf(this.DropSupplier.Items.FindByValue(cBiddingMessage.Supplier)); BoundBiddingDtl(cBiddingMessage.BiddingReturnCode); this.ViewState["BiddingReturnCodeStr"] = cBiddingMessage.BiddingReturnCode; } else { this.tdProjectCode.InnerHtml = " " + RmsPM.BLL.ProjectRule.GetProjectName(cBiddingMessage.ProjectCode); this.tdContractNember.InnerHtml = " " + cBiddingMessage.ContractNember; this.tdContractName.InnerHtml = " " + cBiddingMessage.ContractName; this.tdContractType.InnerHtml = " " + RmsPM.BLL.ContractRule.GetContractTypeName(cBiddingMessage.ContractType); this.tdSupplier.InnerHtml = " " + RmsPM.BLL.ProjectRule.GetSupplierName(cBiddingMessage.Supplier); this.tdBiddingDtl.InnerHtml = this.GetBiddingDtlListStr(cBiddingMessage.BiddingReturnCode, cBiddingMessage.Supplier); this.tdContractDate.InnerHtml = " " + cBiddingMessage.ContractDate; //this.tdUserNames.InnerHtml = " " + cBiddingMessage.AttachUser; //this.tdRemark.InnerHtml = " " + cBiddingMessage.Remark.Replace("\n", "<br>"); } } else { RmsPM.BLL.Bidding bidding = new RmsPM.BLL.Bidding(); bidding.BiddingCode = this.BiddingCode; this.ViewState["Money"] = bidding.Money; this.ViewState["mostly"] = bidding.Accessory; this.ViewState["BiddingType"] = bidding.Type; //this.tdbiddingContent.InnerHtml = bidding.Content.Replace("\n", "<br>")+" "; this.txtProjectCode.InnerHtml = " " + RmsPM.BLL.ProjectRule.GetProjectName(bidding.ProjectCode); this.txtContractType.InnerHtml = " " + RmsPM.BLL.ContractRule.GetContractTypeName(bidding.Type); this.ProjectCode = bidding.ProjectCode; DataTable dt = bidding.GetBiddingReturnNoMessage(); foreach (DataRow dr in dt.Select()) { ListItem li = new ListItem(RmsPM.BLL.ProjectRule.GetSupplierName(dr["SupplierCode"].ToString()), dr["SupplierCode"].ToString()); if (!DropSupplier.Items.Contains(li)) { this.DropSupplier.Items.Add(li); } } BoundBiddingDtl(""); this.txtContractName.Value = bidding.Title; } //构建编号 RmsPM.BLL.BiddingMessage biddingMessage = new RmsPM.BLL.BiddingMessage(); biddingMessage.BiddingCode = this.BiddingCode; System.Data.DataTable BiddingMessagedt = biddingMessage.GetBiddingMessages() as System.Data.DataTable; string CNnum = "0"; if (BiddingMessagedt != null) { CNnum = BiddingMessagedt.Rows.Count.ToString(); } RmsPM.BLL.BiddingPrejudication bp = new RmsPM.BLL.BiddingPrejudication(); bp.BiddingCode = this.BiddingCode; DataTable dtp = bp.GetBiddingPrejudications(); DataRow[] drw = dtp.Select("", "CreateDate desc"); if (drw.Length > 0) { this.ContractNember = drw[0]["Number"].ToString() + "-" + CNnum; } /****************最后报价*****************/ RmsPM.BLL.BiddingManage bm = new RmsPM.BLL.BiddingManage(); RmsPM.BLL.BiddingReturn cBiddingReturn = new RmsPM.BLL.BiddingReturn(); bm.BiddingCode = this.BiddingCode; string BiddingEmitCode = bm.GetLastBiddingEmitCode(); cBiddingReturn.BiddingEmitCode = BiddingEmitCode; DataTable dtReturn = cBiddingReturn.GetBiddingReturns(); decimal tempMoney = 0; foreach (DataRow drReturnSupplier in RmsPM.BLL.ConvertRule.GetDistinct(dtReturn, "BiddingDtlCode", "").Select()) { decimal Money = 0; foreach (DataRow drReturnAll in dtReturn.Select()) { if (drReturnSupplier["BiddingDtlCode"].ToString() == drReturnAll["BiddingDtlCode"].ToString()) { if (System.Convert.ToDecimal(drReturnAll["Money"]) > Money) { Money = System.Convert.ToDecimal(drReturnAll["Money"]); } } } tempMoney += Money; } this.ViewState["MaxMoney"] = tempMoney; /***************************************/ }