/// <summary> /// 更新一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public Model.Enum.HandleResult UpdatePlayList(Model.AMS_PlayListModel model) { try { if (playListDal.Update(model)) { return(Model.Enum.HandleResult.Successed); } else { return(Model.Enum.HandleResult.Failed); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 根据编号获取播放列表 /// </summary> /// <param name="number"></param> /// <returns></returns> public Model.AMS_PlayListModel GetPlaylistByNum(string number) { StringBuilder strWhere = new StringBuilder(); strWhere.AppendFormat(" Number='{0}'", number); try { DataSet ds = playListDal.GetList(strWhere.ToString(), null); if (ds.Tables[0].Rows.Count > 0) { AdvertManage.Model.AMS_PlayListModel model = new Model.AMS_PlayListModel(); model = AdvertManage.Model.AMS_PlayListModel.Parse(ds.Tables[0].Rows[0]["PlayList"].ToString()); model.Id = ds.Tables[0].Rows[0]["id"].ToString(); return(model); } return(null); } catch (Exception ex) { throw ex; } }
/// <summary> /// 根据Id获取播放列表 /// </summary> /// <param name="id"></param> /// <returns></returns> public AdvertManage.Model.AMS_PlayListModel GetPlaylistById(int id) { StringBuilder strWhere = new StringBuilder(); strWhere.AppendFormat(" Id={0}", id); try { DataSet ds = playListDal.GetList(strWhere.ToString(), null); if (ds.Tables[0].Rows.Count > 0) { AdvertManage.Model.AMS_PlayListModel model = new Model.AMS_PlayListModel(); model = AdvertManage.Model.AMS_PlayListModel.Parse(ds.Tables[0].Rows[0]["PlayList"].ToString()); model.Id = ds.Tables[0].Rows[0]["id"].ToString(); model.ReleaseDate = DateTime.Parse(ds.Tables[0].Rows[0]["ReleaseDate"].ToString()); return(model); } return(null); } catch (Exception ex) { throw ex; } }