Posts by novic • 35,673 points
1,265 posts
-
0
votes2
answers227
viewsA: Function in jquery disabled button
I made an example where it shows both button status: function divOnButton() { if ($('#btn1').prop('disabled')) { $('#div1').show(); } else { $('#div1').hide(); } } function statusOnButton() {…
-
0
votes1
answer1480
viewsA: How to do checkbox validation at the angular
I made a very simple example, in this example create a function where, will analyze the data of array and if he finds an item with the property selecionado true (true) he releases the button submit.…
-
0
votes1
answer962
viewsA: Passing Javascript Parameters to [Webmethod] C#
If you’re passing one object which in this case is filtros just specify in the Framework the names and their respective types that the architecture take charge of loading the information and in the…
-
3
votes1
answer914
viewsA: Copy lines from one table to another with jQuery
Each line item in this example should contain an identification, in case I put a data-index and this number will be used to include and exclude the table 2 as per the checkbox is selected or not.…
-
1
votes1
answer348
viewsA: Make replace case insensitive in Classic ASP (Vbscript)
The syntax of Replace of ASP VBScript is the following: Replace(string,find,replacewith[,start[,count[,compare]]]) where the last parameter compare must be placed 1 which is the text search…
-
1
votes1
answer367
viewsA: How to save a foreign key in Laravel 5.3?
Alter $request->id for $request->nome_cat, name that is configured in select of your form: (<select id="nome_cat" name="nome_cat" class="form-control">), example: public function…
-
3
votes2
answers1884
viewsA: What are model and model variables for in a View?
Are related, where @model defines the type of Model, in your code you set the List<Estabelecimento> and used Model to access the positions of this establishment list. It is worth remembering…
-
1
votes1
answer1131
viewsA: Problems listing data from related tables in Laravel 5.3?
In the model, as it was not default the key name, so you have to configure your model to receive this key in the configuration: namespace App; use Illuminate\Database\Eloquent\Model; class categ…
-
1
votes1
answer308
viewsA: Relationship Many to Many with select multiplo in Laravel
Some changes to your code: Controller public function edit($id) { $tags = Tag::all(); $this->post = Post::with(['photos','tags'])->find($id); $photos = $this->post->photos; if…
-
2
votes1
answer91
viewsA: Laravel SQL returning with interrogation?
Yes really, the eloquent uses Preparedstatements, this means that the value is replaced by the positioning (placeholders) and following an order that is established in the development. If by chance…
-
0
votes2
answers212
viewsA: Issues with Laravel Resources 5.4 within Groups
To routes resources follow a nomenclature like this: First parameter is route name and the second to class controller, in your case if you put a bar, ie the root of the site, is conflicting and also…
-
2
votes2
answers49
viewsA: Json with C# with node numbered
I would advise the creation of two classes public class Items: Dictionary<string, Item> { } public class Item { [Newtonsoft.Json.JsonProperty("id")] public int Id{ get; set; }…
-
1
votes1
answer828
viewsA: Angular parameters not mandatory on the route
The default for an optional parameter is to add at the end the ?, example: .state('app.logistica.requisicoes', { url: '/requisicoes/:id?', templateUrl: 'views/logistica-requisicoes.html', References…
-
2
votes1
answer644
viewsA: C#, Returning an Sql Server query in Data Grid View
You have to change your class so that the fields id_gerente and ativo can receive the value null: public class Funcionario : Pessoa { public int id_Func { get; set; } public string funcao { get;…
-
1
votes1
answer337
viewsA: Error when connecting to Sqlserver C# Web.config database
Your ConnectionString has the name of the key wrong: change: public SqlConnection sqlConn = new SqlConnection(ConfigurationManager .ConnectionStrings["connectionStrings"] .ConnectionString);…
-
0
votes1
answer892
viewsA: C# - Can’t map HERITAGE with Entity Framework Core - Code First?
Created classes is only set in context in the method OnModelCreating or even by Dataannotations, this minimum example is configured by the method OnModelCreating: public class Pessoa { public int…
-
4
votes1
answer422
viewsA: Format date in PHP English and Spanish?
Just follow the same line, placing the parameters according to the region, example: Spaniard: setlocale(LC_ALL, 'es_ES', 'es_ES.utf-8', 'es_ES.utf-8', 'esp');…
-
4
votes2
answers145
viewsA: Recovering string JSON value
Utilize json_decode to turn into a array associative, example: <?php $cep = $_POST['cep']; $token = ''; $url = 'http://www.cepaberto.com/api/v2/ceps.json?cep=' . $cep; $ch = curl_init();…
-
1
votes2
answers5057
viewsA: Date angle filter with mask 'dd/MM/yyyy HH:mm:ss'
I’d trade the ui-mask for the Mask Plugin due to the loss of the model, minimal example: To apply filter on date and time would be as follows: $(document).ready(function() {…
-
1
votes1
answer330
viewsA: Mass Attribution in Laravel
Already indicating a problem, which is to rewrite a method that already exists to make a certain operation that is moreover paramount, the method create has the purpose to create new records and…
-
0
votes1
answer1181
viewsA: How popular dropdown 2 based on dropdown 1 with angular
To build a select what filter the next, is like this, minimal example: var app = angular.module("app", []); app.controller("ctrl", function($scope, $filter) { $scope.dropItens1 = [{ 'value': 1,…
-
3
votes1
answer397
viewsA: Xml Treatment with ASPNET MVC Core?
In the new development model ASP.NET Core, whether to use the Interface Iformfile who has the responsibility to work with the input of the kind file. The problem that is happening is that the value…
-
1
votes2
answers1554
viewsA: Date mask with time
Use the ui-Mask, and always configure ng-model not to end up with a strange error on the screen, minimal example: var app = angular.module('app',['ui.mask']); app.controller('ctrl', function($scope)…
-
2
votes1
answer614
viewsA: Codeigniter Administrative Area Controller
Do the following, inside the folder application/controllers (using the concept of controls in sub-directories via documentation) create a folder named after admin, example…
-
1
votes2
answers851
viewsA: Sort items from a Collection from a preset value
With the method sort and its rule has no way, what must be done is a where and then a union excluding: $sort = $categorias->where('slug', 'solicitacoes') ->sortBy('descricao')…
-
2
votes1
answer360
viewsA: Codeigniter with Blade, huh?
The problem is change of version, the file blade.php created in the folder application\libraries shall contain the following code by configuration obtained on its own github: Xiaoler/Lade, different…
-
0
votes1
answer504
viewsA: Set a checkbox, analyzing an already marked checkbox. Jquery
Seeing the code jQuery seems correct, but, faltou put the html, The example below is an example of what it would be like to interface to your code: $("#button").click(function() { if…
-
1
votes1
answer244
viewsA: Laravel 5.4 - Display all phones of each result
Use the method with as follows: public function busca(Request $request) { $title = 'Busca'; $cidades = Cidade::pluck('nomeCidade', 'id')->all(); $servicos = Servico::pluck('nomeServ',…
-
2
votes1
answer272
viewsA: Is it correct to use List with Viewmodel?
I see no problem making one foreach to fill a ViewModel, the problem with your code is you don’t have to do this foreach, is unnecessary, thus leaving a example: public class Crm_AnaliseViewModel {…
-
4
votes1
answer2247
viewsA: Dynamic table with angular
To solve this problem a filter by the name of range and at the time of typing use ng-repeat to build rows and columns, example basic: var app = angular.module("app", []); app.filter('range',…
-
5
votes1
answer1819
viewsA: Error: Entitytype<T> has no key defined. Define the key for this Entitytype
You have mistakenly placed the configuration class in place of the entity class. It’s like this: public virtual DbSet<ApostaEstadoMap> ApostaEstado { get; set; } Switch to: public virtual…
-
1
votes1
answer3105
viewsA: How to make an input increment or decrement numbers with javascript
numero = 0; function less() { numero--; setValue(numero); } function more() { numero++; setValue(numero); } function setValue(value) { document.getElementById('num').value = value; }…
-
1
votes1
answer414
viewsA: Deserialize JSON with Restsharp and Javascriptserializer
When you have a key, and within it others, the best way in my view is to make the same layout of classes following the premise of names and with that extracting in a standard way what was returned…
-
1
votes2
answers940
viewsA: Laravel eloquent returning array of array
To group the data by day and month and count, you need to work with groupBy method of eloquent to group and count lines all this in commands sql that will bring the result without the expected…
-
2
votes1
answer671
viewsA: Consultations with Laravel
I will propose a minimal example, actually if your relationship stated in the comment is correct (I believe that the informed keys are outside the standard and need then be configured) I’ll tell you…
-
0
votes1
answer455
viewsA: Consultation in Related Tables | Laravel 5.4
With whereNotIn, and the countryside employee_id table users when it has no relationship, that is to say, NULL to work: Example: Employee::whereNotIn('id', function($q) {…
-
2
votes1
answer49
viewsA: How to make the Mapper module in EF?
I understood your relationship differently, it wouldn’t be aggregation on Entity Framework, if yes it is so: public class Cliente { public int ClienteId { get; set; } public string Nome { get; set;…
entity-frameworkanswered novic 35,673 -
0
votes1
answer414
viewsA: Save in two tables with dynamic inputs (one-to-Many) Laravel
I believe that already resolves: $diaria = Diaria::create($request->all()); $tr = $request->all(); foreach($tr['tr'] as $values) { $diaria->trechos()->create($values); }…
-
0
votes1
answer6086
viewsA: Create Boot using Document.createelement()
To create a button with document.createElement, follow suit: Button function createButton() { var btn = document.createElement('BUTTON'); var lbl = document.createTextNode("CLICK ME");…
-
1
votes1
answer499
viewsA: It cannot be assigned as it is read-only after doing a "Join"
It only converts the value that comes from the user to the equal value of the bank with Convert.ToDecimal for example: [HttpPost] public ActionResult Listar_Json() { var id = 5; var search =…
-
1
votes1
answer1107
views -
4
votes2
answers7000
viewsA: Laravel, call Action from a Controller from a View?
There’s nothing ready for what I can verify, but there are ways to execute: Minimal example Controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class SortController…
-
1
votes3
answers560
viewsA: Bootstrap tab panel - How to go to a specific tab?
Send the information you need tab is the default at the time of loading: Code $tab = 2; return view('PesquisaView') ->with('clientes',$resultadoClientes) ->with('advs',$resultadoAdvs)…
-
1
votes1
answer58
viewsA: How do I store 2 SQL queries in a single variable?
Makes a UNION in the eloquent since by your code the returned fields are the same and the two queries would be with these changes: $usuarios1 = DB::table('users') ->join('user_municipios',…
-
3
votes1
answer5846
viewsA: Scroll through all rows of an Html table and hide if any column 5 is empty
A minimal example is to create a function that I can read tr of this table and find in the column specifies if it has no value. function ocultar() { var table = $('table.grid'); var i = 0;…
-
1
votes1
answer62
viewsA: Parse data from a C#database?
The error is as it is sent the information in the parameter, it does not need simple quotes in the SQL, is like this: cmd.CommandText = "select Id, Email, Name, Login FROM [vw_usuarios] WHERE Login…
-
2
votes1
answer2964
viewsA: Does Poser autoload not work?
The autoload of composer.phar works as follows, when installing the packages and or configuring some class there is a file that is required its declaration at the top of the script to have access to…
-
1
votes1
answer353
viewsA: How to perform mock in a class?
It lacked calling the method ->getMock();, as specified in this tutorial link. Example: $opc = "string"; $this->opc = $this->getMockBuilder('operacao') ->setConstructorArgs([$opc])…
-
1
votes2
answers185
viewsA: Entity Framework - rename Foreignkey
Well, as far as I can make out, you did the same scheme as in your question and the migration generated the field names by their default form on their own (Migration has its default way of…
-
1
votes2
answers976
viewsA: Result field name instead of id on Laravel 5?
The relationships of 1 for many in those two Models and the nomenclature to function would: Class Evento <?php namespace App; use Illuminate\Database\Eloquent\Model; class Evento extends Model {…