Questions tagged as 'c#'

1
answer

How to change background of ImageBrush?

XAML: <TextBox /> <TextBox.Background> <ImageBrush x:Name="image_background" Stretch="Fill" TileMode="None" AlignmentX="Left" AlignmentY="Center" /> </TextBox.Background> </TextBox> C #: (Th...
asked by 30.12.2017 / 03:04
1
answer

Call functions from a controller in the ASP.NET MVC5 _Layout.cshtml view

I have a menu being loaded into an Action from a controller. I already configured the view of this action in _ViewStart to be the default of my project. But this view is not pulling any information from the comtroller. I have already tried by Vi...
asked by 20.10.2017 / 18:32
1
answer

View Model receiving Null values

After a query in the DB, my query returns some null values in some attributes and the time to pass the values to the model: ViewModel.Participantes.Add(new RelParticipantesInscritosAtividadeVM { RA = p.RA.Value, Nome = p.Nome, Modulo = p.Mo...
asked by 20.09.2017 / 14:05
2
answers

SRP- Principle of Single Responsibility [closed]

In the Request class, which contains the business rules for requesting a sales order, please inform which of the following options violates the principle of single responsibility (SRP)? Request.AddItem (): Order.ApplyDiscount (); Order.S...
asked by 02.04.2018 / 07:40
1
answer

The remote server returned an error: (400) Incorrect request

I have created two methods, one for authentication via certificate type A1 and A3 and another to send an xml, both of which make the request in a client apiect. In the authentication method, I send the data from my certificate to the client a...
asked by 27.04.2018 / 15:45
1
answer

How to pass data from the datagridview to the reportviwer

Good afternoon. I need to pass data from the datagridview to the reportviwer to print, but as I am new to C # I am not able to pass the datatable to the reportview form, if someone can explain me a step by step I would appreciate it. Follow my...
asked by 25.10.2017 / 17:37
1
answer

How to join two tables using auxiliary table and LINQ

I have the People and Representatives tables, where in my application the person may or may not have representative (s). public class Conta { int PessoaID; string Nome; String Documento; } public class Representante { int Rep...
asked by 05.10.2017 / 20:16
1
answer

Error attempting asynchronous connection

I am trying to do this in order not to crash the application while waiting for the server to accept the connection. I saw what you can do with async and await . But when trying to use them to wait for the connection without crashing...
asked by 09.10.2017 / 04:42
1
answer

Check for null or empty fields in an entity without consecutive use of "if-else"

In an integration between systems there are data updates on both sides, where the A-side record and the B-side record are obtained. If there are null fields in A and these exist in B then A is complemented with B the reverse is also true, it's l...
asked by 06.10.2017 / 16:00
3
answers

Check if a date is valid

I have a college job where I need to check if a date is valid but I can not use the DateTime and TimeSpan classes. With these classes I can even do it, but without being able to use them at the teacher's discretion, I can not do it. The imag...
asked by 29.09.2017 / 00:06