Exemplo n.º 1
0
 public SrvClients()
 {
     if (clientDataBase == null)
     {
         clientDataBase = new ClientDataBase();
         clientDataBase.Add(new Client(0, "Test", "Test"));
         clientDataBase.Add(new Client(1, "Test2", "Test2"));
     }
 }
Exemplo n.º 2
0
        /*
         * Сохраняет методанные документа в бд
         */
        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);
        }
Exemplo n.º 3
0
 public IActionResult Post([FromBody] Server value)
 {
     _dataBase.Add(value);
     if (_dataBase.GetById(value.Id) != null)
     {
         return(Ok(value));
     }
     return(StatusCode(500));
 }
Exemplo n.º 4
0
 public void PersistIfFinished(IDataBase db)
 {
     if (_MemoryData.State == State.Processing &&
         _MemoryData.RemainingNumbers == 0)
     {
         UpdateState(State.Finished);
         db.Add(_MemoryData.Numbers);
         db.Commit();
     }
 }
Exemplo n.º 5
0
        public void AddVote(int surveyId, int userId)
        {
            var userVote = new VotingLIstTable
            {
                IdSurvey = surveyId,
                IdUser   = userId,
                VoteTime = IsraelTimeZone.Now()
            };

            _service.Add(userVote);
        }
Exemplo n.º 6
0
 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);
        }
Exemplo n.º 8
0
        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"));
        }
Exemplo n.º 10
0
 public void Add()
 {
     _database.Add();
 }
Exemplo n.º 11
0
 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);
 }
Exemplo n.º 12
0
 public bool AddVinyl(VinylDTO newVinyl)
 {
     vinylsDataBase.Add(DTOMapper.Map(newVinyl));
     OnRefreshVinyls?.Invoke();
     return(true);
 }
Exemplo n.º 13
0
 public void Add <T>(T model)
 {
     DataBase.Add(model);
 }