public void User_Insert(UserModelData data, Action result)
 {
     manager.client.Collection("User",
         (err, collection) =>
         {
             collection.Insert(data);
             result();
         });
 }
Ejemplo n.º 2
0
 public static UserToDisplay ToDisplay(this UserModelData user)
 => new UserToDisplay
 {
     Id       = user.Id,
     Name     = user.Name,
     Email    = user.Email,
     Dateborn = user.Dateborn,
     Gender   = user.Gender,
     Admin    = user.Admin
 };
Ejemplo n.º 3
0
        internal async Task <ReturnRepository> Update(UserModelData user)
        {
            try
            {
                _context.Entry(user).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(ReturnRepository.Create(false, string.Format("Usuário {0} salvo com sucesso!", user)));
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return(ReturnRepository.Create(true, string.Format("Erro ao salvar o estabelecimento {0}!\n Analise o erro: {1}", user.Email, ex.Message)));
            }
        }
Ejemplo n.º 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline... adds middleware components
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();

            UserModelData.Initialize(app);
            StudentRegisterationsData.Initialize(app);
            UserData.Initialize(app);
            RegisteredUserData.Initialize(app);
        }