public bool Post(M.ParametroPutFile parametroPutFile)
        {
            bool state = false;

            try
            {
                O.MediaPerson mediaPerson = BD.MediaPersons.FirstOrDefault(x => x.Id == parametroPutFile.Id);
                mediaPerson.FileName     = parametroPutFile.FileName;
                mediaPerson.DownloadLink = parametroPutFile.DownloadURL;
                BD.SaveChanges();
                state = true;
            }
            catch { state = false; }
            return(state);
        }
示例#2
0
        public string Post(int idMediaPerson)
        {
            string R = "";

            try
            {
                O.MediaPerson BDMediaPerson = BD.MediaPersons.FirstOrDefault(x => x.Id == idMediaPerson);
                BD.MediaPersons.Remove(BDMediaPerson);
                BD.SaveChanges();
                R = BDMediaPerson.FileName;
            }

            catch {}

            return(R);
        }
示例#3
0
        /* Obtiene los archivos de un Investigador Privado */

        public long Post(M.MediaPerson mediaPerson)
        {
            O.MediaPerson BDMediaPerson = new O.MediaPerson
            {
                FileName     = "",
                DownloadLink = "",
                LoadDate     = System.DateTime.Now.ToString("g"),
                LoadHourZone = System.TimeZoneInfo.Local.ToString(),
                IdPerson     = mediaPerson.IdPerson
            };

            BD.MediaPersons.Add(BDMediaPerson);
            BD.SaveChanges();

            return(BDMediaPerson.Id);
        }