FineUI 官方论坛
标题:
新增数据重新绑定后出错.
[打印本页]
作者:
西门吹雪
时间:
2012-4-28 14:05
标题:
新增数据重新绑定后出错.
在窗口中新增一条数据,保存成功后重新绑定表格出现错误,请高手解答
protected void btnNew_Click(object sender, EventArgs e)
{
InwardDetail entity1 = new InwardDetail();
entity1 = BllInwardDetail.SelectModel(Convert.ToInt32(hidId.Text));
InwardTallyDetail entity = new InwardTallyDetail();
entity.InwardId = entity1.InwardId;
entity.SkuId = entity1.SkuId;
entity.InwaDId = int.Parse(hidId.Text);
entity.LocationId = ddlLoc.SelectedItem.Value;
entity.BatchNo = txtBatch.Text;
entity.LabelNo = txtLabel.Text;
entity.Memo1 = txtMemo1.Text;
entity.Memo2 = txtMemo2.Text;
entity.TallyQty = Convert.ToDecimal(txtQty.Text);
entity.TallyPcs = Convert.ToDecimal(txtPcs.Text);
entity.PurPrice = Convert.ToDecimal(lblPrice.Text);
BllInwardTallyDetail.Add(entity);
LoadData();
}
这是新增数据代码,新增完成后重新绑定的时候出错
这是绑定表格的代码,打开窗口时绑定不会有问题
protected void LoadData()
{
InwardDetail entity = new InwardDetail();
entity = BllInwardDetail.SelectModel(Convert.ToInt32(hidId.Text));
string strWhere = " inwardId=" + entity.InwardId + " and SkuId=" + entity.SkuId + " and tallyStatus=2 ";
int pageCount;
Grid1.PageSize = BaseSystemInfo.pageSize;
IList<InwardTallyDetail> list = BllInwardTallyDetail.SelectByPage(Grid1.PageIndex, out pageCount, strWhere);
Grid1.RecordCount = pageCount;
if (list == null)
{
Grid1.DataSource = "";
}
else
{
Grid1.DataSource = list;
}
Grid1.DataBind();
}
作者:
西门吹雪
时间:
2012-4-28 14:16
升级到3.1.4.1后问题解决!谢谢大家
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4