public bool Post(int id)
        {
            bool R = false;

            try
            {
                O.Business BDBusiness = BD.Businesses.FirstOrDefault(x => x.Id == id);

                if (BDBusiness.Active)
                {
                    BDBusiness.Active = false;
                    R = false;
                }

                else
                {
                    BDBusiness.Active = true;
                    R = true;
                }

                BD.SaveChanges();
            }

            catch {}
            return(R);
        }
        public long Post(M.Business negocio)
        {
            O.Business BDBusiness = new O.Business
            {
                Name                  = negocio.Name,
                Specialism            = negocio.Specialism,
                SpecialismDescription = negocio.SpecialismDescription,
                WebPage               = negocio.WebPage,
                Phone                 = negocio.Phone,
                Latitude              = negocio.Latitude,
                Longitude             = negocio.Longitude,
                Ciprin                = negocio.Ciprin,
                Active                = negocio.Active,
                CreationDate          = System.DateTime.Now,
                CreationHourZone      = System.TimeZoneInfo.Local.ToString(),
                Avatar                = negocio.Avatar,
                NameAvatar            = negocio.NameAvatar,
                IdPackage             = negocio.IdPackage
            };

            BD.Businesses.Add(BDBusiness);
            BD.SaveChanges();

            return(BDBusiness.Id);
        }
        public string Post(long idBusiness)
        {
            string S = "";

            try
            {
                O.Business BDBusiness = BD.Businesses.FirstOrDefault(x => x.Id == idBusiness);
                BD.Businesses.Remove(BDBusiness);
                BD.SaveChanges();
                S = BDBusiness.NameAvatar;
            }

            catch { }
            return(S);
        }
Exemple #4
0
        public bool Post(M.ParametrosPutAvatar parametrosPutAvatar)
        {
            bool state = false;

            try
            {
                O.Business negocio = BD.Businesses.FirstOrDefault(x => x.Id == parametrosPutAvatar.Id);
                negocio.Avatar     = parametrosPutAvatar.DownloadURL;
                negocio.NameAvatar = parametrosPutAvatar.FileName;
                BD.SaveChanges();
                state = true;
            }

            catch
            {
                state = false;
            }

            return(state);
        }