示例#1
0
 public EncomendaController(JJMSContext context, FornecedorController fController, UtilizadorController uController, CartaoController caController)
 {
     _context      = context;
     _fController  = fController;
     _uController  = uController;
     _caController = caController;
 }
示例#2
0
 public FuncionarioController(JJMSContext context, UtilizadorController uController, EncomendaController eController, FornecedorController fController)
 {
     _context     = context;
     _uController = uController;
     _eController = eController;
     _fController = fController;
 }
示例#3
0
 public MenuClienteController(JJMSContext context, EncomendaController eController, UtilizadorController uController, ClienteController cController, FuncionarioController fController)
 {
     _context     = context;
     _uController = uController;
     _eController = eController;
     _cController = cController;
     _fController = fController;
 }
 public MenuFuncionarioController(JJMSContext context, EncomendaController eController, FuncionarioController fController, ClienteController cController, FornecedorController fornController, UtilizadorController uController)
 {
     this._context        = context;
     this._eController    = eController;
     this._fController    = fController;
     this._cController    = cController;
     this._fornController = fornController;
     this._uController    = uController;
 }
示例#5
0
        /// <summary>
        /// Checks input and if all is right, save the Cliente to the DataBase
        /// </summary>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <param name="email"></param>
        /// <param name="morada"></param>
        /// <param name="telefone"></param>
        /// <returns>returns the correspondent Action</returns>
        public ActionResult Registar(string user, string password, string email, string morada, string telefone)
        {
            if (_uController.emailAssociado(email))
            {
                return(EmailEmUso());
            }
            if (this.telefoneValido(telefone) == false)
            {
                return(TelefoneInvalido());
            }
            if (this.passwordSegura(password) == false)
            {
                return(PasswordInsegura());
            }

            Cliente nCliente = _context.newCliente(user, UtilizadorController.hashFunction(password), email, morada, telefone);

            _context.Clientes.Add(nCliente);
            _context.SaveChanges();

            return(Sucesso());
        }
示例#6
0
 public ClienteController(JJMSContext context, UtilizadorController uController)
 {
     _context     = context;
     _uController = uController;
 }