Questions tagged as 'c#'

1
answer

V10 - Sales Editor - BeforeRemoveLine

I have this little code to hit a sum in a CDU when a line is removed from the editor. However, when I have several rows and for example I remove the second line, the variable i always takes the value of the last line and hits the sum with...
asked by 19.10.2018 / 19:18
1
answer

Upload Image, and Create a thumb of the same Image Asp.Net Mvc?

I have a class named image, where I have two attributes, UrlDaImagem , and UrlDoThumb , I can save the image, normal only I would like to create a Thumb for that same image, without having to make a new upload. Class: public cla...
asked by 05.11.2018 / 19:55
2
answers

Variable remains zero in a mathematical expression

My program looks like this: public void CalculaProporção() { decimal contagemSubida = 0 , contagemDescida = 0; int cSubida = 6, cDescida = 4, range = 10; contagemSubida += Convert.ToDecimal(cSubida*range/100...
asked by 01.11.2018 / 15:54
1
answer

List C # losing what has already been added

I'm a beginner and I'm developing a shopping cart. The routine I thought was: Every click on the add button, the product is sent to the controller via ajax request. There I already have a list created. So, I add the product in the list and save...
asked by 07.05.2018 / 20:13
1
answer

Name of a Role with an accent in the Identity database

The need to create a Role with accent in the Roles table of Identity in the database: "Technical". Myquestioniswhetherthiscanleadtofurtherproblems,perhapswhencheckingforsomethinglikeUser.IsInRole("Técnico") or if the...
asked by 11.05.2018 / 14:57
1
answer

List existing folders / subfolders and folders in a specific root folder

Is it possible via code to list the existing folders / files in a specific folder? Example And play this list on a grid / table on the WEB for the user to know if the folder he wants to create already exists?     
asked by 03.05.2018 / 15:18
1
answer

How to inhibit textbox but display ID data

I would like the TextBox ID to be inhibited (I do not want to be invisible) but to display ID data that is autoincrement in the database. I'm using Visual Studio 2015 Community. Example: I register a client without putting the ID, but when...
asked by 05.02.2018 / 18:10
1
answer

Instantiating the database context in the controller

Hello, I have a question related to the instancing mode DbContext the controller. What's the difference between the two methods below instantiation? 1. private ApplicationDbContext _db; public ApplicationDbContext db { g...
asked by 07.02.2018 / 14:21
1
answer

Rollback SqlServer on writing two different tables

Premise: I'm using EntityFramework6 for data persistence in SQLServer. At some point I need to write data in two different tables, but the second table has dependency on the first example. try{ MetodoPersisteNaTabelaA(); MetodoP...
asked by 08.02.2018 / 12:36
2
answers

How to use Distinct () or GroupBy () in a list that returns an anonymous type?

I'm doing a select in the bank to bring the IdNavio and Navio , but I do not want to bring the repeats. I am trying to use the Distinct() and GroupBy() methods, but they are not working, I am using the names...
asked by 09.02.2018 / 12:38