Exemplo n.º 1
0
        ////////////////////////////////
        // update about page content
        ///////////////////////////////

        public async Task <Boolean> updateAboutVal(BAbout bAbout, string bToChange)
        {
            // the filter
            var builderF = Builders <Business> .Filter;
            var filter   = builderF.Eq("BName", bToChange);

            // the business to update
            var builderU = Builders <Business> .Update;
            UpdateDefinition <Business> update = builderU.Set("BAbout", bAbout);
            // the query
            UpdateResult result = await _businesses.UpdateOneAsync(filter, update);

            if (result.MatchedCount == result.ModifiedCount)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
 // contructors of business
 public Business(string id        = "", string email      = "", string name = "", bool appointment = false,
                 bool gallery     = false, string[] owner = null, string[] client = null,
                 string[] blocked = null, BHome home      = null, BAbout about    = null, bool connected = false)
 {
     Id           = id;
     bMail        = email;
     bName        = name;
     bAppointment = appointment;
     bGallery     = gallery;
     if (owner == null)
     {
         owner = new string[1];
     }
     bOwner = owner;
     if (client == null)
     {
         client = new string[1];
     }
     bClient = client;
     if (blocked == null)
     {
         blocked = new string[1];
     }
     bBlockedList = blocked;
     if (home == null)
     {
         home = new BHome();
     }
     if (about == null)
     {
         about = new BAbout();
     }
     bHome          = home;
     bAbout         = about;
     ownerConnected = connected;
 }