Posts by William Cézar • 1,268 points
56 posts
-
2
votes1
answer301
viewsQ: Regular expression to validate text
I am making a method that will import some data, and before the import I need to check if some fields are correctly filled, the fields should come this way: Example: Jan/Seg Fev/Ter Mar/Qui The data…
-
2
votes0
answers266
viewsQ: How to avoid Database Lock using Entityframework Transaction
I have a method where I save several classes and call another method to do an optimization on top of these classes, but I am using Transaction, in case something goes wrong in this optimization I…
-
0
votes1
answer262
viewsQ: Formgroup Required conditioning
I have a component address to which has a form, this sera requirido in some places and others not so I intend to use a variable @input required = false; to do this. I start formGroup on onInit so:…
angularasked William Cézar 1,268 -
3
votes4
answers96
viewsA: What is the best solution ? Getbyid with a non-existent id in the BD
You can use Firstordefault() or the Singleordefault() instead of Single(). Firstordefault(): Returns the first element of a sequence, or a default value if a sequence does not contain elements.…
-
0
votes0
answers127
viewsQ: Send used file @Ajax.Beginform and Xmlhttprequest
I have the following doubt: I’m doing a post with @Ajax.BeginForm, but the same does not send file, so I wanted to use the File Api, my idea was this I would do the post for @Ajax.BeginForm thus:…
-
1
votes2
answers537
viewsQ: Show error message when Modelstate is not valid
When I submit the form it recognizes that the ModelState.Valid is invalid but when it returns to View() does not show the error messages I put in Model. My Controller : [HttpPost]…
-
2
votes1
answer40
viewsQ: Remove virtual properties from Typedescriptor.Getproperties()
I did a question how to use Sqlbulkcopy, the @Virgilionovic user showed me a code that uses Reflection to save any kind of list, but I do the TypeDescriptor.GetProperties() he brings the properties…
-
4
votes2
answers1161
viewsQ: How to insert using Sqlbulkcopy with Entityframework
I have a method that adds almost 2000 records at once, I was using the Bulk Insert and it was working perfectly, but this extension is paid for. So I decided to use the Sqlbulkcopy class but I’m…
c#asked William Cézar 1,268 -
1
votes1
answer869
viewsQ: Pass an object to Modal
I have a Foreach in a table, I need as soon as the user clicks on a row, open a modal with the object data contained in that row. The Foreach: @foreach (PedidoModel pedido in @Model.Entidades) {…
-
6
votes2
answers574
viewsQ: Faster way to save multiple entities with Entityframework
I have a performance problem in one method, in addition to causing the full use of the CPU server that method takes a long time to run. internal async void NotificacaoIosTodos(string titulo, int…
-
0
votes1
answer36
viewsQ: Closure error on a variable in loop of Outer Scope
I’m developing an application where I get a list of companies and their location (latitude and longitude), so I have to plot all these locations on Google Maps, my problem and while trying to add a…
javascriptasked William Cézar 1,268 -
2
votes1
answer767
viewsQ: Label/Sticky Title - Google Maps Api
I’m working with the Google Maps Api, and need to leave the name statically appearing above/below the Marker, I wanted to put this label/title when creating the Marker, as the title, someone knows a…
-
0
votes4
answers1118
viewsA: Select input with a certain class within a form
I ended up solving right after posting the question I used the following code: $("input:text.inputPiscina").each( function() { formdata.append("Piscinas", $(this).val()); }); So I went on all inputs…
-
3
votes4
answers1118
viewsQ: Select input with a certain class within a form
I have a form and within this form I am adding a certain input dynamically via jquery using a button, these inputs go to a array in a controller C#. Currently I’m doing so: for (var j = 0; j <…
-
3
votes3
answers1491
viewsA: How to replace the number of letters of a word with a character?
You can use the string. Length to know the size of the word you have. Then you can Iterar on top of that size by writing "_" Exemplary: for(int i=0; i< string.Legth; i++) { // aqui você pode…
-
2
votes2
answers415
viewsA: Read an internet page in a variable in VB
To serialize a Json in Vb.Net Datacontractattribute. First you would have to create an object to receive this JSON, realize that your example pussui objects inside the Json own, example:…
vb.netanswered William Cézar 1,268 -
6
votes6
answers1056
viewsA: How to make a Split for when there is a letter in the string?
You could do that using the char.Isletter. would look like this: string az= "97A96D112A109X115T114H122D118Y128"; string[] novaString; foreach (char c in az) { if(char.IsLetter(c) { string[]…
-
0
votes3
answers1812
viewsA: C# - Object reference not defined for an object instance
What may be happening and that at the time your code tries to access a.Cliente.Cpf he finds his Cliente null, thus generating this exception, then you would have to instate your object Cliente. Do…
c#answered William Cézar 1,268 -
2
votes2
answers5321
viewsQ: Calling an asynchronous and synchronous method
I have a synchronous method, in it I call another method of another controller which would have to be executed asynchronous. I call this other method this way: Task.Run(() =>…
-
3
votes3
answers952
viewsA: Save date in Brazilian format in Postgresql
I know two ways to force culture on Asp.net First: In the web.config within the tag <system.web> you add the following tag <globalization culture="pt-BR" uiCulture="pt-BR" /> Second…
-
2
votes1
answer125
viewsA: Relationship 1:N with RU
In your case with a Unidade may have several Usuarios and a Usuario for having several Unidade, characterizes a relationship N:N, which in the case would have to be done with an extra table making…
-
9
votes1
answer22460
viewsQ: Non-relational Database vs Relational Database
Some time ago I was in doubt about the differences between these two models, I even looked on the Internet but I did not find anything to take away the doubt so I will ask some questions. 1 - What…
-
0
votes1
answer222
viewsA: Error installing - Nuget - Unable to connect to the remote server
I managed to resolve this error by downloading direct from Nuget and manually installing. Remembering that the Nuget Api was unstable at the time I had this problem.…
-
0
votes1
answer222
viewsQ: Error installing - Nuget - Unable to connect to the remote server
My Nuget wasn’t able to download any packages and I couldn’t see the packages installed on Manager Package, so I researched a little and decided to uninstall and install again. The problem starts…
-
3
votes1
answer85
viewsQ: How to generate Thumbnail using Mediatoolkit
I need to generate a thumbnail from a video when climbing it to my application, I would like an explanation of how to use the package Mediatoolkit to do this, I thank you already.…
-
0
votes1
answer247
viewsQ: Leave a read menu with treeview active after page re-load
I have a menu on a Sidebar using <li> and <ul>, when I click on any page is updated, because I use a link <a> in my. i am using the following javasscript to update the active menu…
-
0
votes0
answers24
viewsQ: Error 500 when trying to Upload Video with Xmlhttprequest Asp.net/C#
I have an application that uploads video using XMLHttpRequest when I uploaded a small video (386Kb) the video goes up normal, but when I try a larger video (20Mb) it does not reach the function C#…
-
0
votes1
answer436
viewsQ: Progressbar does not update according to Xmlhttprequest request - Jquery/Asp.net
I’m building an app to upload videos and photos, and I’d like to put a ProgressBar to show progress for the user, I found some questions to answer (Like this question), but I’m having a little…
-
0
votes1
answer788
viewsQ: Running a Method in the background Asp.Net/C# (Async or Thread)
What I needed to do was this Calling a Post Method Called Cadastrar Before this method finish I would call a new method called PessoaNotificacao However the method Registration would not wait for…
-
2
votes1
answer404
viewsQ: Fill a select with callback $getJson Asp.Net / Jquery
What I need to do is this, I have a select with the states, when the person changes that state I need to fill another select with the cities. This is the state select : <div…
-
0
votes1
answer137
viewsQ: .Include() does not carry child class - Lazyloading C#
I was using the DDD Model with Repositories and with 3 layers of data, (Serviço,Repositorio and Dominio), with the help of some users here I decided to change the project and now I ended up removing…
-
3
votes2
answers220
viewsQ: Inheritance problem
I have a problem with a bank search, I will try to explain in the best possible and clearest way. I have a table Pessoa and a table Cliente, the last inherits from Pessoa, I also have a table…
-
4
votes0
answers4243
viewsQ: 'The underlying Provider failed on Open' C# ASP.net
I have an application that has 4 layers, which are the following : Dominio, Infra, Servico, Web in the domain I have a folder called Poco with all my Classes/Tabelas , in the Layer Infra, to test…
-
1
votes1
answer1071
viewsQ: Injection of Depension with Ninject C#
I am developing an application that has 4 layers Dominio, Infra, Servico e Web When I have access to a route for example Home/Index he says that there is no constructor without parameters, my…
-
1
votes1
answer239
viewsQ: Bitbucket Repository with Sourcetree, Visual Studio Project
I’m creating a new project on Visual Studio 2015 , i created the repository on BitBucket, so I created the project, the problem is that when one of the project’s users Push he doesn’t update. For…
-
2
votes1
answer1196
viewsQ: Redirect to a controller in another Area
I looked for a solution to this but could not, I’m trying to redirect session errors to login, my application is inside a folder called Areas and when he saw something redirect to him I redirect so…
-
0
votes1
answer1213
viewsQ: Change date format on C# / Asp.NET server
I’m having a very boring problem, I’m picking one up DataDeCadastro of the server on DateTime when the date well it is in the United States version ("dd/MM/yyyy") I use the .ToString() to format the…
-
2
votes1
answer507
viewsQ: redirecting C#/javascript pages
I am with a question a little bit silly ( I think ), I have to make a filter for customer and need to do urgent, so I gave a "quick" solution to my problem, created a controler that does customer…
-
0
votes1
answer406
viewsQ: Viewbag for all Asp.Net MVC C#controllers
I have an application in ASP.Net MVC, after the user login need to show his name at the top of the page always, regardless of which page he is. This application is an administrative where will be…
-
0
votes1
answer102
viewsQ: Redirect users not indexed Asp.net
I have an Asp.net MVC page, using entityframework, and I have a login system : public ActionResult Index(LoginModel model) { if (ModelState.IsValid) { try { if (Membership.ValidateUser(model.Email,…
-
1
votes1
answer842
viewsQ: Customer search by Name/Phone/Cpf Javascript/C#
I have a page that lists client, and I need to do a name search, I have the method that does the problem research and how to integrate it with the front-end, I looked for examples on the internet…
-
0
votes2
answers137
viewsA: Is it possible that a class attribute is the class itself?
I came to do a similar college job, I had done a program with a structure with a pointer to the structure itself, but then I had to do one in tree and using classes. The only thing that changed is…
-
0
votes1
answer210
viewsQ: Angular ng-show , does not remove C#/Angular/Javascript code
I have the following code listing categories: <div class="row" ng-show="!TemCategoria"> <div class="container" id="categoria" style="float:right" ng-hide="TemCategoria"> <select…
-
2
votes3
answers779
viewsQ: Assigning an image(s) value to the Javascript input
I have the following input <input type="file" id="imagefiles" name="files[]" multiple accept="image/*" style="display:none;" /> This input receives up to 3 images I’m using javascript to give…
-
1
votes1
answer135
viewsQ: Upload photos with Javascript/Ajax preview
Hello, I’m making an administrative website, in this site will have the option to upload photo, the user could upload up to 3 photos. My idea was to make kind of facebook, where you click and add…
-
0
votes1
answer73
viewsQ: Post with no fronend
I’m trying to make a Post of a form info but I don’t quite know how to do. This is my C form# : @using (Html.BeginForm("Enviar", "Mensagem", FormMethod.Post, new { enctype = "multipart/form-data",…
-
1
votes1
answer851
viewsA: Passing information to a Modal
I was able to solve it this way : Modal’s call was changed instead of data-target="" was placed href="" alias has been added for as class class="openMyModal product-title" finally a Json was created…
-
3
votes1
answer851
viewsQ: Passing information to a Modal
I have this routine using the C#Razor. It lists my messages : Code: @for (int i = 0; i < 3; i++) { <div class="box-body" style="line-height:15px"> <ul class=" products-list…
-
2
votes2
answers488
viewsQ: Web Paging with C#
I’m building an administrative application, and in this application I have a message page. I am currently bringing the last 20 messages. I already have the screen ready to receive this messages, but…
-
0
votes1
answer30
viewsQ: Placeholder does not identify characters
I’m having a problem with a placeholder and a login page, <div class="group"> @Html.TextBoxFor(t => t.Email, new { required = "required" } ) <span…