Posts by joaoeduardorf • 154 points
17 posts
-
0
votes1
answer252
viewsA: Select particular view for view - ASP. NET MVC
You can do it using Razor @HTML.Linkaction in the View and create Action in the controller. @Html.ActionLink("titulo do link", "QualActionQuer", "DeQualcontrollerQuer", new { id = "123" }, null) Ex:…
-
0
votes3
answers79
viewsA: What would the conversion of this algorithm look like from c to c#?
Expensive, very direct and without input validations and code optimizations would look like this: using System; namespace StackOverflow { class MainClass { public static void Main(string[] args) {…
-
0
votes3
answers1452
viewsA: How to create a category tree in C#
I’m not sure I understand your question, but see if the following code helps you with anything: using System; using System.Collections.Generic; namespace ArvoreDeCategoria { class MainClass { public…
-
0
votes4
answers239
viewsA: Ignore class name in XML serialization
Peter, this is the example I spoke of: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; namespace…
-
0
votes3
answers99
viewsA: Problems with View Model Implementation
Try it this way: model.ChamadoAtual = _contexto.Chamados.Include(i => i.Evolucoes).Find(id); and removes the model.Evolucoes = _contexto.Evolucoes.Where(e => e.id_chamado == id);…
-
7
votes6
answers1056
viewsA: How to make a Split for when there is a letter in the string?
Try it like this: string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string[] az = txt.Split(alphabet.ToCharArray());
-
0
votes3
answers1812
viewsA: C# - Object reference not defined for an object instance
You need to create a client object in a. a.Cliente = new CLiente();
c#answered joaoeduardorf 154 -
0
votes4
answers1003
viewsA: Problem saving a change using Entity Framework
Maybe it works that way: public virtual TEntity Atualizar(TEntity obj) { Db.Entry<TEntity>(obj).State = EntityState.Modified; Db.SaveChanges(); return obj; }…
-
0
votes2
answers533
viewsA: Create a type corresponding to a playing card
Dude, I made an example to see if it helps you and put it on Bitbucket at the following address https://bitbucket.org/joaoeduardorf/jogo-de-cartas If you have any problems to access, let me know.…
c#answered joaoeduardorf 154 -
0
votes2
answers158
viewsA: How do I correct this error, and was able to see this other table in my view?
Dude, try this. @model Sistema.Models.for @{ ViewBag.Title = "Consulta de Devedores"; } @using PagedList.Mvc; <h2>Consulta de Devedores</h2> <div id="page-wrapper"> <div…
-
0
votes3
answers1920
viewsA: Search database information by selecting a field
Dude, it’s hard to answer your question because you have very little information about how you’re doing your application and how you’re accessing the data, but I think what you want is something…
-
1
votes2
answers147
viewsA: Problem with a Count in Asp.Net MVC
Try this <table class="table table-hover"> <tr> ... Status </th> <th> Quantidade de Vagas </th> <th></th> </tr> @foreach (var item in Model) {…
-
1
votes1
answer277
viewsA: Change property structure at time of JSON serialization
Theoretically you could do so in your controller public JsonResult Pessoas() { var pessoas = db.Pessoas.Select(s => new { Codigo = s.Codigo , Estado = s.Estado.Codigo }); return Json(pessoas ,…
asp.net-mvcanswered joaoeduardorf 154 -
0
votes3
answers4902
viewsA: How to load a dropdown with a selected value
Dude, I don’t know what’s going on with your cxontroller, but I’d try that here at the controller Controller: ViewBag.PediodoId = new SelectList(db.Periodos, "Id", "Nome", curso.PeriodoId); and this…
-
-1
votes2
answers543
viewsA: How to organize the return of data in a List<T>?
I’m not sure I understand your question, but maybe if you put the following lines on the global.asax solution. var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter;…
-
0
votes2
answers160
viewsA: How to add Scroll in User Registration?
Dude, a while back I used the following example, take a look if it suits you. http://typecastexception.com/post/2014/02/13/ASPNET-MVC-5-Identity-Extending-and-Modifying-Roles.aspx…
-
2
votes1
answer77
viewsA: How to get user type in view?
Man, I believe something like this will solve your problem. @if (Request.IsAuthenticated) { @if (User.IsInRole("Admin")) { <li> @Html.ActionLink("Administrativo", "index", "Administrativo")…