日期:2014-05-18 浏览次数:20551 次
/// <summary> /// 删除一条数据根据用户ID /// </summary> /// <param name="DelModle"></param> /// <returns></returns> public bool Delete(Modle.UserInfos DelModle) { conn.Open(); string sql = "delete * from UserInfos where UserId=@uid"; SqlCommand _cmd = new SqlCommand(sql, conn); SqlParameter delCp = new SqlParameter("@uid", SqlDbType.Int); delCp.Value = DelModle.UserId; _cmd.Parameters.Add(delCp); return _cmd.ExecuteNonQuery() > 0; conn.Close(); }
public bool BLL_Del(Modle.UserInfos mu_del) { DAL.UserService _du = new UserService(); return _du.Delete(mu_del); }
int strid = Convert.ToInt32(Request.QueryString["id"]); Modle.UserInfos mu = new Modle.UserInfos(); mu.UserId = Convert.ToInt32(strid); BLL.UBLL bu = new BLL.UBLL(); bu.BLL_Del(mu); Response.Write("删除成功!");