protected void gdvOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = this.gdvOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform morder = Border.GetModel(ID); morder.IsDelete = 1; Border.Update(morder); gdvOrder.DataSource = databind(); gdvOrder.DataBind(); }
protected void btnCreate_Click(object sender, EventArgs e) { try { //转换为整数 int ID = Convert.ToInt32(orderid); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform order = Border.GetModel(ID); order.Beveragecost = Convert.ToDecimal(txfBeverageCost.Text); if (Border.Update(order)) { Response.Write("<script>alert('订单修改成功!')</script>"); Response.Write("<script>window.close()</script>"); } } catch (Exception ex) { Response.Write("<script>alert('订单修改失败!')</script>"); } }
protected void gdvOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { //得到单位编号 string rowToDelete = this.gdvOrder.DataKeys[e.RowIndex].Values[0].ToString(); //转换为整数 int ID = Convert.ToInt32(rowToDelete); QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform(); QPS.NEW.Model.Orderform morder = Border.GetModel(ID); morder.IsDelete = 1; Border.Update(morder); gdvOrder.DataSource= databind(); gdvOrder.DataBind(); }