Diário de Códigos
Codigos Fonte, Artigos e Dicas
Codigos Fonte, Artigos e Dicas
02/07/09
Levei um tempao resolvendo um problema idiota bem pequeno, consegui fazer… muito util…
02/07/09
Pesquisei Pesquisei e finalmente encontrei uma solução:
1. Criar as formulas @Reset e @Details
@Reset – vai ser colocada dentro de Page Header. Reseta o contador
25/06/09
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
25/06/09
private void dataGridView1_CellFormatting(object sender,DataGridViewCellFormattingEventArgs e)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.White;
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red;
}
24/06/09
private String concatenarPreco(String preco)
{
String pr = preco;
if (pr.Length == 1 || pr.Length == 2)
{
pr += ",00";
}
else
if (pr.Length == 3)
{
pr += "0";
}
23/06/09
public static class Seguranca
{
public static string CripitografaSenhaHASH(this string Senha)
{
23/06/09
//função que retorna se o serviço existe no windows ou nao
public string findService(string s)
{
string s3 = null;
try
{
ServiceController[] services;
services = ServiceController.GetServices();
for (int i = 0; i < services.Length; i++)
{
if (services[i].ServiceName == s)
{
s3 = "Found";
break;
}
}
}
catch (Exception x) { }
if (s3 == null)
return s3 = "Not Found";
else
return s3;
}
22/06/09
private void limparControles()
{
foreach (Control cItem in this.Controls)
{
//A group box is found
if (cItem is GroupBox)
{
//Loop through all the group box components
foreach (Control cSubItem in cItem.Controls)
{
if (cSubItem is GroupBox)
{
foreach (Control cSubItem3 in cSubItem.Controls)
{
if (cSubItem3 is TextBox || cSubItem3 is MaskedTextBox)
{
cSubItem3.Text = "";
}
}
}
else
{
//If its a label of text box disable it
if (cSubItem is TextBox || cSubItem is MaskedTextBox)
{
cSubItem.Text = "";
}
}
}
}
}
}
22/06/09
private DataSet gravarXML(string arq)
{
DataSet ds = new SubSonic.Select("nome", "qnt", "data_v").From("clientes").InnerJoin("vendas", "idcliente", "clientes", "idclientes").WhereExpression("data_v").IsBetweenAnd(data1, data2).OrderAsc("data_v").ExecuteDataSet();
ds.WriteXml(arq, XmlWriteMode.WriteSchema);
return ds;
}