/// <summary> /// 检测判定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnCheckDetail_Click(object sender, EventArgs e) { foreach (GridViewRow gvrow in this.grid.Rows) { CheckBox chkId = (CheckBox)gvrow.FindControl("chkId"); if (chkId.Checked == true) { BCheckBillBB bCheckBillBB = new BCheckBillBB(); try { vBCheckBillData data = bCheckBillBB.GetVModel(Convert.ToInt32(chkId.ValidationGroup)); if (data.instantState != "04") { this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"只有检测完成才能进行检测结果判定!\");", true); return; } else { Response.Redirect("BCheckDetailList.aspx?itemNo=" + this.itemNo + "&pTypeNo=main&id=" + data.id + "&mno=" + data.materialNo + "&cno=" + data.checkBillNo + "&ano=" + data.arriveBillNo + "&fno=" + data.financeBillNo + "&mnm=" + Server.UrlEncode(data.materialDesc)); } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } } } this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"请选择一条记录!\");", true); return; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.StrWhere = "1=1"; string id = Request.QueryString["id"]; BCheckBillBB billBB = new BCheckBillBB(); try { vBCheckBillData data = billBB.GetVModel(Convert.ToInt32(id)); lblano.Text = data.arriveBillNo; lblcno.Text = data.checkBillNo; lblfno.Text = data.financeBillNo; lblmnm.Text = data.materialDesc; lblmno.Text = data.materialNo; this.StrWhere += " and checkBillId=" + id; } finally { billBB.Dispose(); } this.BindGrid(); } }
/// <summary> /// 展示数据 /// </summary> /// <param name="id">记录Id</param> private void ShowInfo(int id) { BCheckBillBB checkBillBB = new BCheckBillBB(); SCommBB commBB = new SCommBB(); try { vBCheckBillData model = new vBCheckBillData(); DataSet ds = new DataSet(); string strSQL = ""; model = checkBillBB.GetVModel(id); this.lbCheckBillNo.Text = model.checkBillNo; this.tbArriveBillNo.Text = model.arriveBillNo; this.tbFinanceBillNo.Text = model.financeBillNo; this.hidMaterialNo.Value = model.materialNo; this.tbMaterialDesc.Text = model.materialDesc; this.tbCheckMark.Text = model.checkMark; //查找到货单明细ID strSQL = "select id,num from BArriveDetail where arriveBillNo='" + model.arriveBillNo + "' and financeBillNo='" + model.financeBillNo + "' and materialNo='" + model.materialNo + "'"; ds = commBB.Query(strSQL); if (ds != null && ds.Tables[0].Rows.Count > 0) { this.hidArriveDetailID.Value = ds.Tables[0].Rows[0]["id"].ToString(); this.tbNum.Text = ds.Tables[0].Rows[0]["num"].ToString(); } this.BindMateriel2();//绑定物料对应检测标准明细表 } finally { checkBillBB.Dispose(); } }