Esempio n. 1
0
        public bool CadastrarAtendente(ViewModelCadastroAtendente vm_cadastro_atendente)
        {
            bool retorno = false;

            try
            {
                this.connection.Open();

                this.command.CommandText = string.Format(@"INSERT INTO atendente 
                                           (id_funcionario,
                                            nome) 
                                           VALUES 
                                           ('{0}', '{1}')",
                                                         vm_cadastro_atendente.cadastro_atendente_id_funcionario,
                                                         vm_cadastro_atendente.cadastro_atendente_nome
                                                         );
                int insert_retorno = command.ExecuteNonQuery();

                if (insert_retorno > 0)
                {
                    retorno = true;
                }


                this.connection.Close();
            }
            catch (Exception ex)
            {
                if (this.connection.State == System.Data.ConnectionState.Open)
                {
                    this.connection.Close();
                }
            }

            return(retorno);
        }
Esempio n. 2
0
        public JsonResult <bool> Cadastrar(ViewModelCadastroAtendente vm_cadastro_atendente)
        {
            AtendenteBusiness atendente_business = new AtendenteBusiness();

            return(Json(atendente_business.CadastrarAtendente(vm_cadastro_atendente)));
        }