Questions tagged as 'c#'

2
answers

How to change focus from one TextBox to the next?

I'm trying to change the focus of the field after the user types 2 digits. Validation is ok, but I have not yet found a method to get focus shifted. NOTE: This is a dynamic method used for multiple fields, so I can not specify on the hand whi...
asked by 09.10.2015 / 14:44
1
answer

Problem with null variable

I'm developing C # software with the MVVM template , and with Visual Studio. It is software to manage the members of a university. We also have to use a database with Code First. My problem is that it gives me the following error:  ...
asked by 09.11.2016 / 16:37
2
answers

System modulation

I'm developing a C # system with WinForms of Livestock Control for a farm, and will communicate with a scale to improve the weighing process. Some of the features are (Invoice entry, vaccination, casualties, transfers, purchases, stock). I...
asked by 26.10.2016 / 16:09
2
answers

Should the Domain layer depend on Infrastructure?

I'm reading the Evans book on DDD and I came across the following quote:    The Infra layer does not perform any action on the domain layer, because it is below it, because it is below it should not have specific knowledge about the domain it...
asked by 08.07.2015 / 02:43
2
answers

How to catch Exception generated by a method whose access is not authorized by a given user profile

How can I send the user a message that the operation he wants to do is not allowed? I have in my View a button that calls a Javascript function <button id="btninicio" onclick="salvaApontamento();">Inicio</button> This sal...
asked by 13.07.2015 / 16:09
2
answers

Could not load file or assembly 'WebGrease, Version = 1.3.0.0, Culture = neutral

I'm just opening a new project based on MVC 5, framework 4.0, C #, and after opening the project for the first time and compiling, the error occurs Não foi possível carregar arquivo ou assembly 'WebGrease, Version=1.3.0.0, Culture=neutral, Pub...
asked by 31.07.2015 / 16:00
2
answers

How to capture the alert message using the web browser controler?

I'm developing a robot using Asp.Net C # web browser controler. In this robot I need to identify some messages that appear in Javascript Alert. The site that Robot is manipulating is not mine, so there's no way I can make any changes in th...
asked by 09.07.2015 / 15:08
1
answer

Why can not I access a field but the method succeeds?

I have the following code in C #: namespace ConsoleApplication4 { public class BaseClass { public BaseClass() { System.Console.WriteLine("BaseClass::BaseClass();"); } } public class DerivedCl...
asked by 18.03.2015 / 06:34
3
answers

Formatting Strings for RG

How can I format this String : 12345678x for this: 12.345.678-X? I tried to use String.Format but I could not. Resolved: public string RgFormat(object rg) { string strRg = rg.ToString(); return strRg.Substring(0, 2) + "."...
asked by 19.03.2015 / 19:49
2
answers

How to get IIS information via C #?

How do I get some information from IIS like Version and some settings like Roles and Services in C #. * Note: My application is not Web.     
asked by 23.03.2015 / 20:28