grid列表多选编辑
来源:互联网 发布:汕头网络 编辑:程序博客网 时间:2024/06/05 03:12
protected void checkBtn_Click(object sender, EventArgs e)
{
if (grdMain.SelectedRowIndexArray.Length > 0)
{
string ids = "";
foreach (var row in grdMain.SelectedRowIndexArray)
{
ids += grdMain.Rows[row].Cells.FromKey("id").ToString() + ",";
}
var id = ids.TrimEnd(',');
CommonMethod.ExecuteFunc(_broker=> {
var updateSql = $@"update sup_purchase_order set status=1 where is_deleted=0 and id in ({id})";
_broker.ExecuteSQL(updateSql);
CheerUI.Alert.Show("提交成功!",CheerUI.MessageBoxIcon.Success);
BindGrid();
},ex=> {
CheerUI.Alert.Show(ex.Message);
});
}
else
{
ShowAlert("请选择需要提交审批的数据");
}
}
{
if (grdMain.SelectedRowIndexArray.Length > 0)
{
string ids = "";
foreach (var row in grdMain.SelectedRowIndexArray)
{
ids += grdMain.Rows[row].Cells.FromKey("id").ToString() + ",";
}
var id = ids.TrimEnd(',');
CommonMethod.ExecuteFunc(_broker=> {
var updateSql = $@"update sup_purchase_order set status=1 where is_deleted=0 and id in ({id})";
_broker.ExecuteSQL(updateSql);
CheerUI.Alert.Show("提交成功!",CheerUI.MessageBoxIcon.Success);
BindGrid();
},ex=> {
CheerUI.Alert.Show(ex.Message);
});
}
else
{
ShowAlert("请选择需要提交审批的数据");
}
}
阅读全文