Questions tagged as 'c#'

1
answer

DbEntityEntry.State vs DbPropertyEntry.IsModified

I have a question about these two ways of specifying whether an entity has been modified. I usually use DbEntityEntry.State with EntityState.Modified when I make a very big change in the model and I want all of them to be per...
asked by 14.02.2016 / 21:54
1
answer

How to call and display a WPF window that is in a dll

I have a DLL containing a WPF window, created through a project of type WPF User Control Library . How do I display this window from another project? Window's XAML (DLL project): <Window x:Class="UmaJanelaComUmBotao.Window1"...
asked by 23.09.2016 / 16:45
1
answer

WPF documentation with pure C # code

WPF is the "new" one for development, not only desktop but also mobile. However, almost all of the material that is available on WPF is fully tied to the use of IDE and XAML. But XAML is an intermediate language, it is compiled into C # code,...
asked by 22.09.2016 / 17:13
3
answers

Printing text file on thermal printer with PrintDocument?

I'm developing a system in WinForms with C # and now I need to generate a sales receipt coupon and print to a thermal printer. I've been reading about PrintDocument but I can not find examples of how to generate coupon using this print API. I do...
asked by 25.09.2016 / 23:05
1
answer

Change the row color of the DataGridView

I would like to know how to change the color of a whole line of DataGridView . I have a code below, but it only changes the color of a particular column, and I would like it to change the color of all the columns of the same row. DataGri...
asked by 02.10.2016 / 02:32
1
answer

Validate data from an object with DataAnnotations C # Winforms

Good afternoon, I have the following Entity class marked by Data Annotations: public class Cargo { [Key] [Display(Name ="Código")] public int Codigo { get; set; } [Required(AllowEmptyStrings =false, ErrorMessage = "A descrição...
asked by 29.10.2016 / 16:58
1
answer

Updating values of an object from a collection via Binding WPF, MVVM

Following the MVVM model, I am not able to update the values of a variable of an object in a collection, display them on the screen or the user type and this value is passed to the variable. In my case, I have a customer registration screen a...
asked by 26.10.2016 / 15:38
2
answers

Inserting Single Quotes Null Field

I created a very simple application to simulate a small register of clients, but when testing the data manipulation by the application I could see in the database that the fields that are null in the register are inserted into the database with...
asked by 28.04.2016 / 23:04
1
answer

Store ListMenu In Memory or in Cookie

Good afternoon. I have an application that has a whole level of permission management for page access and a number of other settings. Always when a user authenticates, I mount a list with all the menus (links / pages) that this user can ac...
asked by 11.04.2016 / 20:36
1
answer

Entity Framework - Data Access Tips

I'm working on a project using EF6 with C #, in one of my classes I have to save a file, example below: public partial class Arquivo { [Key] public int ArquivoID { get; set; } public string Nome { get; set; }...
asked by 25.02.2016 / 21:47