public SrvClients() { if (clientDataBase == null) { clientDataBase = new ClientDataBase(); clientDataBase.Add(new Client(0, "Test", "Test")); clientDataBase.Add(new Client(1, "Test2", "Test2")); } }
/* * Сохраняет методанные документа в бд */ private bool AddDataBase() { bool isError; do { try { incomeDocument.Id = dataBase.Add(incomeDocument); isError = false; } catch (DataBaseException ex) { Log.WriteError(ex); isError = true; } lock (IsRunLocker) { if (IsRun == false) { return(false); } } } while (isError == true); return(true); }
public IActionResult Post([FromBody] Server value) { _dataBase.Add(value); if (_dataBase.GetById(value.Id) != null) { return(Ok(value)); } return(StatusCode(500)); }
public void PersistIfFinished(IDataBase db) { if (_MemoryData.State == State.Processing && _MemoryData.RemainingNumbers == 0) { UpdateState(State.Finished); db.Add(_MemoryData.Numbers); db.Commit(); } }
public void AddVote(int surveyId, int userId) { var userVote = new VotingLIstTable { IdSurvey = surveyId, IdUser = userId, VoteTime = IsraelTimeZone.Now() }; _service.Add(userVote); }
protected virtual void Add(TDto entity) { try { var mapper = Mapper.Map(entity) as TTable; DataBase.Add(mapper); } catch (Exception ex) { throw new Exception(ex.Message + " BaseRepository"); } }
public bool SignUp(IDataBase dataBase, string firstName, string lastName, string email, string password) { bool success = loginParametersValidator.AreValidParameters(firstName, lastName, email, password); if (!success) { return(false); } UserData userData = new UserData(firstName, lastName, email, password); dataBase.Add(userData); return(true); }
public void AddTempalte(EmailTemplate template) { var oldTemplate = GetTemplate(template.Name); if (oldTemplate != null) { UpdateTemplate(template); } else { _dataBase.Add(template); } }
public IActionResult Post(Object value) { var json = value.ToString(); FlightPlan flightPlan = JsonConvert.DeserializeObject <FlightPlan>(json); try { _dataBase.Add(flightPlan); } catch (NullReferenceException) { return(BadRequest("Please Check Input File!")); } return(Ok("Flight Plan With ID " + flightPlan.HashId() + " Has Been Added To DataBase")); }
public void Add() { _database.Add(); }
public void IsLoggedInAfterSignInWhenInDataBase(string firstName, string lastName, string email, string password) { mockDataBase.Add(new UserData(firstName, lastName, email, password)); authenticator.SignIn(email, password); Assert.IsTrue(authenticator.IsLoggedIn); }
public bool AddVinyl(VinylDTO newVinyl) { vinylsDataBase.Add(DTOMapper.Map(newVinyl)); OnRefreshVinyls?.Invoke(); return(true); }
public void Add <T>(T model) { DataBase.Add(model); }