Posts by Pedro • 536 points
24 posts
-
1
votes2
answers338
viewsA: How to put html id tag with variable name using Razor
Basically in your view you can do: <td id="[email protected]"> Follow an example Model public class Fruta { public int FrutaId { get; set; } public string NomeFruta { get; set; } }…
-
1
votes1
answer161
viewsA: Pass array parameter by HTTPGET in ajax to Actionresult
Rafaela, I did an example in ASP.NET CORE. In your code the URL does not match the Controller you entered. An important point is to correctly define the arrays in Javascript and inform the following…
-
1
votes1
answer111
viewsA: Sum total value of each LINQ category
I made an example in Console Application to show how to get the grouped value of each category. var ListShoppingItens = new List<ShoppingItens> { new ShoppingItens { Data = DateTime.Now,…
-
1
votes1
answer43
viewsA: Checking a radiobutton
You can use a lambda expression for that. See the example below. It is worth mentioning that if you are using the Radiobuttons inside a container, you will need to inform as I do below in groupBox1.…
-
1
votes1
answer339
viewsA: Sqlite, check the exact difference between a date, time and minutes of the current date
The Sqlite does not have a standard type for storing date and time. You can find more information here: https://www.sqlite.org/datatype3.html However, internal functions allow storing this type of…
-
2
votes1
answer71
viewsA: Javascript problems in ASP.Net MVC applications - Minification failed
You are minifying Javascript files with Stylebundle. Use Scriptbundle for Javascript files
-
0
votes2
answers184
viewsA: How to call a parent window method when another daughter window is closed with WPF
In your XAML of the window Regradetailsdialog you can put <Window...Closing="Window_Closing" Closed="Window_Closed"> </Window> In the class put the code below to call Mainwindow class…
-
0
votes2
answers161
viewsA: Change the "Web Reference URL" of the Webservice added by add web
You need to create an instance of the class you want to use generated by the Webreference proxy classes. Let me give you an example using the Post Office Webservice. Can be accessed using the link…
-
1
votes2
answers1868
viewsA: Grab URL and skip to the next page
You can use Urlreferrer to get the previous url. //ASP.NET MVC 5 public ActionResult SuaAction() { string urlAnterior = System.Web.HttpContext.Current.Request.UrlReferrer.ToString();…
-
-1
votes1
answer139
viewsA: How to get string from Enum on an ASP.MVC grid
@using MeuDominio.Enums; @Enum.Getname(typeof(Regiaoenum), Regiaoenum.CENTRO)
-
6
votes2
answers141
views -
2
votes1
answer1022
viewsA: Check Read and Write Permission in folder with C#
Hello... I use the class below to check if the user has access to folders or files... In the implementation is like this: if (!CurrentUserSecurity.HasAccess(new DirectoryInfo(temp),…
-
1
votes2
answers189
viewsQ: Byte Array x Stream
I’m developing a WCF service that will convert files. I will upload and then download the files. The files are not large. What is preferable in the case of sending and receiving, returning an array…
-
3
votes1
answer380
viewsQ: Datagridviewcomboboxcolumn loses selected value
I have a Datagridview and bind it through a list. So far so good... Now I want to add a combobox (Datagridviewcomboboxcolumn) dynamically based on another list. In the first line of code I make the…
-
0
votes5
answers2046
viewsA: Compressing PDF files
It is possible to do this via Ghostscript. In the example below I am calling the executable via command line and passing these parameters. -sDEVICE=pdfwrite -dCompatibilityLevel=1.4…
-
5
votes2
answers325
viewsA: Know if the application has been completed by the task manager
It is possible to check through the Formclosingeventargs Event. See the example below. It’s working in my application. private void frmLogin_FormClosing(object sender, FormClosingEventArgs e) { if…
-
2
votes0
answers121
viewsQ: Performance when drawing an image
Currently I use the Drawimage method of the Graphics class. However, the speed of drawing in the components is very slow. How can I optimize its use ? Libraries like Monogame or Opentk can perform…
-
1
votes2
answers5572
viewsA: Connect application to Postgresql?
The connection is done similarly. In Java, you connect to the database via JDBC. Files . jar In C# the connection is made through ADO.NET. Just like in Java, you will need a mobile phone to access…
-
2
votes1
answer357
viewsA: How to manage Session with Session in C# desktop and non-web applications?
Unable to work with Session in the same way as you work on the Web. I recommend creating a static class with static properties(get and set). These properties will become available while the program…
-
2
votes2
answers544
viewsA: Grab custom tags with Html Agility Pack
I was able to extract the contents with the code below: // no html está <tag-teste>conteudo</tag-teste> var teste = html.DocumentNode.SelectNodes("//tag-teste"); foreach (var conteudo in…
-
-2
votes2
answers54
viewsA: Do not show inactive product in search of products
Change the last line of the query to: produtos.status = 0 ";
-
-1
votes1
answer114
viewsA: Convert VB6 application to C# Webforms with Entity
You can use these code conversion tools to assist with some code units in the migration process. However, in the past you didn’t have the resources you have today. The conversion tools will not give…
-
1
votes3
answers228
views -
2
votes1
answer656
viewsA: Cut an image every 300 pixels high
You can make a cut in the bitmap and then make the conversion. public Bitmap CropBitmap(Bitmap bitmap, int cropX, int cropY, int cropWidth, int cropHeight){ Rectangle rect = new Rectangle(cropX,…