public async Task <int> Crud_Environment(EnvironmentsModel model)
 {
     using (var _dbContext = new DataBaseContext()) {
         object[] parameters = new object[] { model.Id, model.Environment, model.HostName, model.EndPointKey, model.Username, model.Password, model.IsActive, model.Score };
         return(await _dbContext.ExecuteNonQueryAsync("sp_CRUD_Environment", parameters));
     }
 }
 public async Task<int> SaveUser(SaveUserModel model) {
     using (var _context = new DataBaseContext())
     {
         object[] parameters = new object[] { model.UserName, model.Password };
          return await _context.ExecuteNonQueryAsync("sp_SaveNewUser", parameters);
     }
 }
 public async Task <int> AddQuestion(AddQuestionModel model)
 {
     using (var _dbContext = new DataBaseContext()) {
         object[] parameters = new object[] { model.IdArea, model.Question, model.Answer, model.Type, model.IsActive };
         return(await _dbContext.ExecuteNonQueryAsync("sp_AddQuestion", parameters));
     }
 }
 public async Task <int> UpdateKnowledgeBase(KnowledgeBasesModel model)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { model.Id, model.Id_contact, model.Contact, model.LastName, model.Email, model.Id_env };
         return(await _dbContext.ExecuteNonQueryAsync("sp_UpdateKnowledgeBase", parameters));
     }
 }
 public async Task <int> UpdateStatusEnv(int IdEnv, int Status)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { IdEnv, Status };
         return(await _dbContext.ExecuteNonQueryAsync("sp_UpdateStatusEnvironment", parameters));
     }
 }
 public async Task <int> SaveAnswer(SaveAnswerModel model)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { model.question, model.answer, model.idArea };
         return(await _dbContext.ExecuteNonQueryAsync("sp_SaveAnswer", parameters));
     }
 }
 public async Task <int> UpdateAreaKeyId(AreaEndPointModel model)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { model.KeyId, model.Area };
         return(await _dbContext.ExecuteNonQueryAsync("sp_UpdatekeyIdAreaByName", parameters));
     }
 }
 public async Task <int> DeleteKnowledgeBase(int id)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { id };
         return(await _dbContext.ExecuteNonQueryAsync("sp_DeleteKnowledgeBase", parameters));
     }
 }
Exemple #9
0
 public async Task <int> SaveNewRegion(RegionsModel model)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { model.Region, model.IsActive };
         return(await _dbContext.ExecuteNonQueryAsync("sp_SaveNewRegion", parameters));
     }
 }
Exemple #10
0
 public async Task <int> registerUserArea(registerUserAreaModel userArea)
 {
     using (var _context = new DataBaseContext())
     {
         object[] parameters = new object[] { userArea.name, userArea.userName, userArea.email, userArea.idArea };
         return(await _context.ExecuteNonQueryAsync("sp_updateUserArea", parameters));
     }
 }
Exemple #11
0
 public async Task <int> updateAreaByuser(int idArea)
 {
     using (var _context = new DataBaseContext())
     {
         object[] parameters = new object[] { idArea };
         return(await _context.ExecuteNonQueryAsync("SP_UpdateEndPointTest", parameters));
     }
 }
 public async Task<int> UpdateUser(UpdateUserModel model)
 {
     using (var _context = new DataBaseContext())
     {
         object[] parameters = new object[] { model.IdUsuario, model.UserName, model.Password, model.Status };
         return await _context.ExecuteNonQueryAsync("sp_UpdateUsers", parameters);
     }
 }