protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DropDownList dropZL = (DropDownList)e.Item.FindControl("dropZL"); Literal ltlC_VDEF1 = (Literal)e.Item.FindControl("ltlC_VDEF1"); LinkButton lbtDel = (LinkButton)e.Item.FindControl("lbtDel"); Literal ltlyorderno = (Literal)e.Item.FindControl("ltlyorderno"); Literal ltlywgt = (Literal)e.Item.FindControl("ltlywgt"); Literal ltlylxnum = (Literal)e.Item.FindControl("ltlylxnum"); Literal ltldlxnum = (Literal)e.Item.FindControl("ltldlxnum"); Literal ltlmatcode = (Literal)e.Item.FindControl("ltlmatcode"); Literal ltlN_TYPE = (Literal)e.Item.FindControl("ltlN_TYPE"); TextBox txtWgt = (TextBox)e.Item.FindControl("txtWgt"); #region //判断当前状态 bool res = ltlN_CON_STATUS.Text == "-1" ? !tmo_order.Exists_OrderPlan(ltlyorderno.Text) : false; lbtDel.Visible = res; txtWgt.Enabled = res; #endregion #region //质量等级 DataTable dtzl = tqb_checkstate.GetCheckState("").Tables[0]; if (dtzl.Rows.Count > 0) { dropZL.DataSource = dtzl; dropZL.DataTextField = "C_CHECKSTATE_NAME"; dropZL.DataValueField = "C_ID"; dropZL.DataBind(); dropZL.SelectedIndex = dropZL.Items.IndexOf(dropZL.Items.FindByValue(ltlC_VDEF1.Text)); } #endregion #region //原合同已履行量/待履行量 decimal exenum = 0; decimal wgt = 0; if (!string.IsNullOrEmpty(ltlyorderno.Text)) { DataRow dr = tmo_order.GetOrderExeNum(ltlmatcode.Text, ltlyorderno.Text, Convert.ToInt32(ltlN_TYPE.Text)); if (dr != null) { exenum = Convert.ToDecimal(dr["YLXNUM"].ToString());//原合同履行量 } ltlywgt.Text = tmo_order.GetOrderWgt(ltlyorderno.Text);//原合同数量 wgt = Convert.ToDecimal(ltlywgt.Text); } ltlylxnum.Text = exenum.ToString(); //已履行量 ltldlxnum.Text = Convert.ToString(wgt - exenum); //待履行量 #endregion }