Questions tagged as 'c#'

2
answers

Why ArrayList instead of Stack in the implementation of Memento pattern?

As you all know, the Memento pattern is the default that saves different states of objects and then retrieves them. The intent is not to retrieve the "last" entry and then remove it? This is a stack, right? So why do examples use ArrayL...
asked by 31.12.2014 / 12:50
2
answers

Static classes and classes with static methods

When I declare a class static , I am required to write my static methods and this class can never be instantiated. Now, I have a common class and create my methods inside it all static. Well, I even consider this static class, for consider...
asked by 27.02.2015 / 15:22
4
answers

Resize image

Well my system has an area where the user registers information about the site. So register images. The system does not restrict the size of the image. Then the site shows the images. But there are different parts on the site that carry diffe...
asked by 21.07.2014 / 14:12
2
answers

How do I make "Replace" replace all occurrences of a word regardless of case?

The Replace function replaces all occurrences of a word or expression, but is case sensitive: string str = "Hello WorLLd";//Substitui só os 'l' e não o 'L' str = str.Replace("l", "EL"); Console.WriteLine("My string: " + str); Output:...
asked by 11.09.2014 / 23:16
2
answers

Remove "/" from a DateTime.ToShortDateString ();

I'm implementing a program using C # with .NET 3.5 I have the following code: StringBuilder sb = new StringBuilder(); sb.Append(caminhoSalvarCobranca); sb.Append(@"\Boleto "); sb.Append(boleto.Sacado.Nome); sb.Append(boleto.Boleto.DataVenci...
asked by 28.05.2014 / 18:31
3
answers

How to do an ASP NET MVC dropdown

I have a DTO Class [Serializable] public class PerfilDTO { public int Codigo { get; set; } public string Descricao { get; set; } public SituacaoEnum Situacao { get; set; } public List<PerfilFuncionali...
asked by 15.05.2014 / 21:53
4
answers

How does an empty constructor work?

Definition: Creating an empty constructor If the attributes are not set, they will be set to the default type , example: int default value is zero. > Context: I use a structure that returns entities from the database and when the o...
asked by 24.04.2014 / 23:29
1
answer

Method that returns a class

I'm trying to create a method that takes a string and returns an instance of the class with the last name, eg "Calculator", will return me an instance of class "Calculator" time to determine which type it returns, because from what I researched...
asked by 07.05.2014 / 20:50
1
answer

Error while using random

I set a random number to fill a dummy table and did so: foreach (var usuario in LstUsuarios) { htmlUsuarios.AppendLine("<tr>"); htmlUsuarios.AppendLine("<td>" + usuario.Nome + "</td>"); htmlUsu...
asked by 30.05.2014 / 16:18
2
answers

Stored Procedure in the Entity Framework without model edmx

I have a project that uses the Entity Framework without a edmx template, we have registered entities manually create a class and insert it into the context. Does anyone use this format and know how to register a Stored Procedure this...
asked by 29.01.2014 / 19:02