/// <summary> /// 更新幼儿园信息 /// </summary> /// <param name="gardenInfo">要更改的GardenInfo</param> /// <returns>返回影响的行数</returns> public int UpdateGardenInfo(GardenInfo gardenInfo) { int rowEffected = 0; try { DBCommandWrapper dbComWrapper = db.GetStoredProcCommandWrapper("UpdateGarden_Info"); dbComWrapper.AddInParameter("@info_gardenID", DbType.String, gardenInfo.GardenID); dbComWrapper.AddInParameter("@info_gardenName", DbType.String, gardenInfo.GardenName); dbComWrapper.AddInParameter("@info_gardenRegCode", DbType.String, gardenInfo.GardenRegCode); dbComWrapper.AddInParameter("@info_gardenAddr", DbType.String, gardenInfo.GardenAddr); dbComWrapper.AddInParameter("@info_gardenContact", DbType.String, gardenInfo.GardenContact); dbComWrapper.AddInParameter("@info_gardenFeature", DbType.String, gardenInfo.GardenFeature); dbComWrapper.AddInParameter("@info_gardenGraphLocation", DbType.Binary, gardenInfo.GardenImage); dbComWrapper.AddOutParameter("@rowEffected", DbType.Int32, 4); db.ExecuteNonQuery(dbComWrapper); rowEffected = Convert.ToInt32(dbComWrapper.GetParameterValue("@rowEffected")); } catch (Exception ex) { throw ex; } return(rowEffected); }
/// <summary> /// 调用DataAccess层更新幼儿园信息 /// </summary> /// <param name="gardenInfo">要更改的GardenInfo</param> /// <returns>返回影响的行数</returns> public int UpdateGardenInfo(GardenInfo gardenInfo) { int rowsAffected = 0; using (GardenInfoDataAccess gardenInfoDataAccess = new GardenInfoDataAccess()) { rowsAffected = gardenInfoDataAccess.UpdateGardenInfo(gardenInfo); } return(rowsAffected); }
/// <summary> /// 调用BusinessRule层更新幼儿园信息 /// </summary> /// <param name="gardenInfo">要更改的GardenInfo</param> /// <returns>返回影响的行数</returns> public int UpdateGardenInfo(GardenInfo gardenInfo) { return(new GardenInfoRule().UpdateGardenInfo(gardenInfo)); }
/// <summary> /// 调用BusinessRule层插入幼儿园信息 /// </summary> /// <param name="gardenInfo">要插入的GardenInfo</param> /// <returns>返回影响的行数</returns> public int InsertGardenInfo(GardenInfo gardenInfo) { return(new GardenInfoRule().InsertGardenInfo(gardenInfo)); }