/// <summary> /// 查询是否有重复的动画信息(新规) /// </summary> /// <param name="anime"></param> /// <returns></returns> public Animation SearchRepeatAnimeInfo(Animation anime, AnimeCommand.Command ctr) { return dao.SearchRepeatAnimeInfo(anime, ctr); }
/// <summary> /// 查询是否有重复的动画信息 /// </summary> /// <param name="anime"></param> /// <returns>重复的动画信息,如无则为null</returns> public Animation SearchRepeatAnimeInfo(Animation anime, AnimeCommand.Command ctr) { string sqlcmd = @"SELECT * FROM {0} WHERE ANIME_NO = @animeNo OR ANIME_CHN_NAME = @animeCNName OR ANIME_JPN_NAME = @animeJPName OR ANIME_NN = @nickname"; Collection<DbParameter> paras = new Collection<DbParameter>(); paras.Add(new SqlParameter("@animeNo", anime.No)); paras.Add(new SqlParameter("@animeCNName", anime.CNName)); paras.Add(new SqlParameter("@animeJPName", anime.JPName)); paras.Add(new SqlParameter("@nickname", anime.Nickname)); DataSet ds = DbCmd.DoSelect(string.Format(sqlcmd,CommonConst.TableName.T_ANIME_TBL), paras); if (ds.Tables[0].Rows.Count == 0) { return null; } if (ctr == AnimeCommand.Command.Update && ds.Tables[0].Rows[0][0].ToString().Equals(anime.No)) { return null; } Animation repeatAnime = new Animation(); repeatAnime.No = ds.Tables[0].Rows[0][0].ToString(); repeatAnime.CNName = ds.Tables[0].Rows[0][1].ToString(); repeatAnime.JPName = ds.Tables[0].Rows[0][2].ToString(); repeatAnime.Nickname = ds.Tables[0].Rows[0][3].ToString(); return repeatAnime; }