protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["Guid"] = Guid.NewGuid().ToString(); } #region 创建表内容 CawParaDB p = new CawParaDB(); dvGJ = p.InitParaValueList("JZXGJ");//国际 dvNZ = p.InitParaValueList("JZXNZ");//内支 dvGN = p.InitParaValueList("JZXGN");//国内 HtmlTableRow htrGJ=GetTableBigArea("1、国际"); this.tablea.Rows.Add(htrGJ); for (int i = 0; i < dvGJ.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvGJ, i,"GJ"); this.tablea.Rows.Add(htr); } HtmlTableRow htrNZ = GetTableBigArea("2、内支"); this.tablea.Rows.Add(htrNZ); for (int i = 0; i < dvNZ.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvNZ, i,"NZ"); this.tablea.Rows.Add(htr); } HtmlTableRow htrGN = GetTableBigArea("3、国内"); this.tablea.Rows.Add(htrGN); for (int i = 0; i < dvGN.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvGN, i,"GN"); this.tablea.Rows.Add(htr); } //this.tablea.Rows.Add(tr); #endregion }
protected void Page_Load(object sender, EventArgs e) { #region 创建表内容 CawParaDB p = new CawParaDB(); dvGJ = p.InitParaValueList("JZXGJ");//国际 dvNZ = p.InitParaValueList("JZXNZ");//内支 dvGN = p.InitParaValueList("JZXGN");//国内 HtmlTableRow htrGJ = GetTableBigArea("1、国际"); this.tablea.Rows.Add(htrGJ); for (int i = 0; i < dvGJ.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvGJ, i,"GJ"); this.tablea.Rows.Add(htr); } HtmlTableRow htrNZ = GetTableBigArea("2、内支"); this.tablea.Rows.Add(htrNZ); for (int i = 0; i < dvNZ.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvNZ, i,"NZ"); this.tablea.Rows.Add(htr); } HtmlTableRow htrGN = GetTableBigArea("3、国内"); this.tablea.Rows.Add(htrGN); for (int i = 0; i < dvGN.Table.Rows.Count; i++) { HtmlTableRow htr = NewMethod(dvGN, i,"GN"); this.tablea.Rows.Add(htr); } //this.tablea.Rows.Add(tr); #endregion if (!IsPostBack) { ViewState["Guid"] = Request.QueryString["ID"]; if (!string.IsNullOrEmpty(ViewState["Guid"].ToString())) { Detail_RP_BOXMONTHYEAR bmy = RBMY.GetDetail(ViewState["Guid"] as string); this.ddlYear.SelectedValue = bmy.YEAR.ToString(); this.ddlMonth.SelectedValue = bmy.MONTH.ToString(); this.rbIsMonth.SelectedValue = bmy.ISMONTH.ToString(); this.rbInOut.SelectedValue = bmy.INOUT.ToString(); foreach (Detail_RP_BOXMONTHYEARDETAIL item in bmy.Detail_RP_BOXMONTHYEARDETAIL) { IList<string> title = GetTitle(item.LINENAME + item.LINEHAS.Substring(3)); HtmlTableRow htr = this.tablea.FindControl(item.LINENAME+item.LINEHAS.Substring(3)) as HtmlTableRow; if (htr != null) { foreach (string st in title) { #region MyRegion if (st.Contains("EmtTEU")) { (htr.FindControl(st) as NumericTextBox).Text = item.EMTTEU.ToString(); } else if (st.Contains("Emt45")) { (htr.FindControl(st) as NumericTextBox).Text = item.EMT45.ToString(); } else if (st.Contains("Emt40")) { (htr.FindControl(st) as NumericTextBox).Text = item.EMT40.ToString(); } else if (st.Contains("Emt20")) { (htr.FindControl(st) as NumericTextBox).Text = item.EMT20.ToString(); } else if (st.Contains("EmtOther")) { (htr.FindControl(st) as NumericTextBox).Text = item.EMTOTHER.ToString(); } else if (st.Contains("HAVENTEU")) { (htr.FindControl(st) as NumericTextBox).Text = item.HAVENTEU.ToString(); } else if (st.Contains("HAVEN45")) { (htr.FindControl(st) as NumericTextBox).Text = item.HAVEN45.ToString(); } else if (st.Contains("HAVEN40")) { (htr.FindControl(st) as NumericTextBox).Text = item.HAVEN40.ToString(); } else if (st.Contains("HAVEN20")) { (htr.FindControl(st) as NumericTextBox).Text = item.HAVEN20.ToString(); } else if (st.Contains("HAVENOther")) { (htr.FindControl(st) as NumericTextBox).Text = item.HAVENOTHER.ToString(); } else if (st.Contains("HavTotle")) { (htr.FindControl(st) as TextBox).Text = item.TOTALWEIGHT.ToString(); } else if (st.Contains("HavgoodsWeight")) { (htr.FindControl(st) as TextBox).Text = item.GOODSWEIGHT.ToString(); } #endregion } } } } } }