예제 #1
0
		public AniDB_FileRequest(AniDB_File data)
		{
			this.Anime_GroupName = data.Anime_GroupName;
			this.Anime_GroupNameShort = data.Anime_GroupNameShort;
			this.AnimeID = data.AnimeID;
			this.CRC = data.CRC;
			this.Episode_Rating = data.Episode_Rating;
			this.Episode_Votes = data.Episode_Votes;
			this.File_AudioCodec = data.File_AudioCodec;
			this.File_Description = data.File_Description;
			this.File_FileExtension = data.File_FileExtension;
			this.File_LengthSeconds = data.File_LengthSeconds;
			this.File_ReleaseDate = data.File_ReleaseDate;
			this.File_Source = data.File_Source;
			this.File_VideoCodec = data.File_VideoCodec;
			this.File_VideoResolution = data.File_VideoResolution;
			this.FileID = data.FileID;
			this.FileName = data.FileName;
			this.FileSize = data.FileSize;
			this.GroupID = data.GroupID;
			this.Hash = data.Hash;
			this.MD5 = data.MD5;
			this.SHA1 = data.SHA1;

			this.SubtitlesRAW = data.SubtitlesRAW;
			this.LanguagesRAW = data.LanguagesRAW;
			this.EpisodesRAW = data.EpisodesRAW;
			this.EpisodesPercentRAW = data.EpisodesPercentRAW;
		}
예제 #2
0
		protected void Page_Load(object sender, EventArgs e)
		{
			Response.ContentType = "text/xml";

			try
			{
				Response.Write(Constants.ERROR_XML);
				return;

				AniDB_FileRepository rep = new AniDB_FileRepository();

				StreamReader reader = new StreamReader(this.Request.InputStream);
				String xmlData = reader.ReadToEnd();

				XmlSerializer serializer = new XmlSerializer(typeof(AniDB_FileRequest));
				XmlDocument docSearchResult = new XmlDocument();
				docSearchResult.LoadXml(xmlData);

				XmlNodeReader xmlreader = new XmlNodeReader(docSearchResult.DocumentElement);
				object obj = serializer.Deserialize(xmlreader);
				AniDB_FileRequest result = (AniDB_FileRequest)obj;


				if (result == null)
				{
					Response.Write(Constants.ERROR_XML);
					return;
				}


				AniDB_File anifile = rep.GetByFileID(result.FileID);
				if (anifile == null)
					anifile = new AniDB_File();

				anifile.Populate(result);
				rep.Save(anifile);
			}
			catch (Exception ex)
			{
				Response.Write(Constants.ERROR_XML);
			}
		}
예제 #3
0
 public void Save(AniDB_File obj)
 {
     using (var session = WebCache.SessionFactory.OpenSession())
     {
         // populate the database
         using (var transaction = session.BeginTransaction())
         {
             session.SaveOrUpdate(obj);
             transaction.Commit();
         }
     }
 }