WebReference News Ottobre 30th, 2008
This week we discuss the details of how ASP.NET applications are compiled. This information isn’t vital to your success as an ASP.NET developer, but understanding the architecture of your development environment makes you a better developer. By Jim Cheshire. 1027
CodeKeep C# Feed Ottobre 30th, 2008
->
Description: Chiamata Form Comuni
Link: http://www.codekeep.net/snippets/d9993e35-7dfd-4d7d-8104-7ad9e5b2cc18.aspx
RicComune f = new RicComune();
f.Comune = cOMUNEtextBox.Text;
f.Provincia = "";
f.SoloStatiEsteri = false;
f.SoloValidi = false;
f.ShowDialog();
if (f.Selezione == true)
{
cOMUNELabel2.Text = f.CodCat;
cOMUNEtextBox.Text = f.Comune;
cAPTextBox.Text = f.Cap;
}

CodeKeep C# Feed Ottobre 29th, 2008
CodeKeep C# Feed Ottobre 29th, 2008
CodeKeep C# Feed Ottobre 29th, 2008
CodeKeep C# Feed Ottobre 29th, 2008
CodeKeep C# Feed Ottobre 29th, 2008
Description: Ritorna Comune
Link: http://www.codekeep.net/snippets/0c349dbb-2598-4698-a7a2-cd905f648a7f.aspx
private string RitornaComune(string CodCat, string NomeDB)
{
string conn = StringaConnessione.GetStringaConnessione(NomeDB);
SqlConnection connection = new SqlConnection(conn);
SqlDataAdapter adapter = new SqlDataAdapter();
String StrSql = "SELECT COMUNE FROM COMUNI WHERE " +
"CODCAT='" + CodCat + "'";
adapter.SelectCommand = new SqlCommand(StrSql, connection);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
connection.Open();
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, "COMUNI");
string DesComune = dataSet.Tables["COMUNI"].Rows[0]["COMUNE"].ToString();
connection.Close();
return DesComune;
}

CodeKeep C# Feed Ottobre 29th, 2008
Description: Controllo Campi Obbligatori
Link: http://www.codekeep.net/snippets/5c57e134-5114-4476-95e8-248cdf5db150.aspx
public bool ControlloCampiObbligatori()
{
bool Valida = true;
Cfiscale cf = new Cfiscale();
if (!cf.Validate(cFISCALEAMMTextBox.Text, "DB0000"))
{
MessageBox.Show("Codice Fiscale Amministratore Errato!",
"Errore di digitazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
cFISCALEAMMTextBox.Focus();
Valida = false;
}
if (!cf.Validate(cFISCALERESTextBox.Text, "DB0000"))
{
MessageBox.Show("Codice Fiscale Amministratore Errato!",
"Errore di digitazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
cFISCALERESTextBox.Focus();
Valida = false;
}
if (!cf.Validate(cFISCALEPRESTextBox.Text, "DB0000"))
{
MessageBox.Show("Codice Fiscale Presidente Errato!",
"Errore di digitazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
cFISCALEPRESTextBox.Focus();
Valida = false;
}
if (!cf.Validate(cFISCALEPSTextBox.Text, "DB0000"))
{
MessageBox.Show("Codice Fiscale Pruduttore Software!",
"Errore di digitazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
cFISCALEPSTextBox.Focus();
Valida = false;
}
return Valida;

CodeKeep C# Feed Ottobre 29th, 2008
CodeKeep C# Feed Ottobre 29th, 2008
Description: Impostazione di una datagrid a runtime
Link: http://www.codekeep.net/snippets/efbdce51-50f0-4666-abeb-dfeac8685c74.aspx
System.Windows.Forms.DataGridViewCellStyle DgVs2 = new System.Windows.Forms.DataGridViewCellStyle();
dataGridView1.Columns[2].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
DgVs2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
DgVs2.Format = "C2";
DgVs2.ForeColor = System.Drawing.Color.Red;
dataGridView1.Columns[2].DefaultCellStyle = DgVs2;
dataGridView1.Columns[2].HeaderText = "Dare";
dataGridView1.Columns[2].ReadOnly = true;
dataGridView1.Columns[2].Width = 58;
