Exemple #1
0
 public bool Signup(UserAdministration user)
 {
     user.Password = BCrypt.Net.BCrypt.HashPassword(user.Password);
     _dbContext.UserAdministrations.Add(user);
     _dbContext.SaveChanges();
     return true;
 }
Exemple #2
0
        public string Insert(Invoice invoice)
        {
            _context.Invoices
            .Add(invoice);

            _context.SaveChanges();

            return(invoice.InvoiceId);
        }
        public string Insert(Company company)
        {
            bool   isExists  = true;
            string companyId = string.Empty;

            do
            {
                companyId = GenerateCompanyId().ToUpper();
                isExists  = _context.Companies.Any(c => c.CompanyId.Equals(companyId));
            } while (isExists);

            company.CompanyId = companyId;

            _context.Companies
            .Add(company);

            _context.SaveChanges();

            return(companyId);
        }
Exemple #4
0
 public int Complete()
 {
     return(_context.SaveChanges());
 }
Exemple #5
0
 public void SaveChanges()
 {
     _context.SaveChanges();
 }