1_Click (object sender, EventArgs e)
{= DateTime.Now; (Convert.ToString (DropDownList1.SelectedValue), Convert.ToString (DropDownList3.SelectedValue), TextBox1.Text, Convert.ToString (Calendar1.SelectedDate), TextBox2.Text) ; .Text= raquo ;;. Text= raquo ;;
} Button2_Click (object sender, EventArgs e)
{. Text= raquo ;;. Text= raquo ;;
}
}
}System;.Collections.Generic;.Linq;.Web;.Web.UI;.Web.UI.WebControls;.Data;.Data.SqlClient;Monitoring
{_ ingener: System.Web.UI.Page
{_ Load (object sender, EventArgs e)
{(! IsPostBack)
{( raquo ;, , raquo ;, );
}
} Button2_Click (object sender, EventArgs e)
{( raquo ;, raquo ;, Convert.ToString (DropDownList1.SelectedValue), Convert.ToString (DropDownList2.SelectedValue));
} ()
{System.Configuration.ConfigurationManager.ConnectionStrings[laquo;MonitoringConnectionStringraquo;].ConnectionString;
}
# region Bind GridView (stringsortExp, stringsortDir, string par1, string par2)
{= newDataTable (); connection=newSqlConnection (GetConnectionString ());
{. Open ();=string.Empty; (par1!=string.Empty amp; amp; par2!=string.Empty)
{= SELECT * FROM Норми Where КодДеталі=@ par1 and КодМатеріала=@ par2 raquo ;;
}= SELECT * FROM Норми raquo ;;=newSqlCommand (sqlStatement, connection);=newSqlDataAdapter (cmd) ;. Parameters.AddWithValue ( @ par1 raquo ;, par1) ;. Parameters.AddWithValue ( @ par2 raquo ;, par2) ;. CommandType=CommandType.Text; .ExecuteNonQuery () ;. Fill (dt); (dt.Rows.Count gt; 0)
{= newDataView ();=dt.DefaultView; (sortExp!=string.Empty)
{
//myDataView.Sort=string.Format ( {0} {1} raquo ;, sortExp, sortDir);
}. DataSource=myDataView; .DataBind ();
}
} (SqlException ex)
{= Fetch Error: raquo ;; +=ex.Message; (msg);
}
{. Close ();
}
}
# endregion
# region Insert New or Update Record (string par1, string par2, string par3, string par4, string par5, string par6, string par7, string par8, string par9, boolisUpdate)
{connection=newSqlConnection (GetConnectionString ());=string.Empty; (! isUpdate)
{= INSERT INTO Норми +
(КодНорми, Найменування, ЧістийВес, Норма, Ширина, Довжина, Висота, КодДеталі, КодМатеріала) +
VALUES (@ par1, @ par2, @ par3, @ par4, @ par5, @ par6, @ par7, @ par8, @ par9) raquo ;;
}
{= UPDATE Співробітники +
SET КодНорми=@ par1, Найменування=@ par2, ЧістийВес=@ par3, Норма=@ par4, Ширина=@ par5, Довжина=@ par6, Висота=@ par7, КодДеталі=@ par8 , КодМатеріала=@ par9 +
WHEREКодНорми=@ par1 raquo ;;
}
try
{
connection.Open ();
SqlCommandcmd=newSqlCommand (sqlStatement, connection) ;. Parameters.AddWithValue ( @ par1 raquo ;, par1) ;. Parameters.AddWithValue ( @ par2 raquo ;, par2) ;. Parameters.AddWithValue ( @ par3 raquo ;, par3) ;. Parameters.AddWithValue ( @ par4 raquo ;, par4) ;. Parameters.AddWithValue ( @ par5 raquo ;, par5) ;. Parameters.AddWithValue ( @ par6 raquo ;, par6) ; .Parameters.AddWithValue ( @ par7 raquo ;, par7) ;. Parameters.AddWithValue ( @ par8 raquo ;, par8) ;. Parameters.AddWithValue ( @ par9 raquo ;, par9) ;. CommandType=CommandType.Text;.ExecuteNonQuery ();
} (SqlException ex)
{= Insert/Update Error: raquo ;; +=ex.Message; (msg);
}
{. Close ();
}
}
# endregion
# region Delete Record (string ID)
{connection=newSqlConnection (GetConnectionString ());= DELETE FROM Норма WHERE КодНорми=@ ID raquo ;;
{. Open ();=newSqlCommand (sqlStatement, connection) ;. Parameters.AddWithValue ( @ ID raquo ;, ID) ;. CommandType=CommandType.Text; .ExecuteNonQuery ();
} (SqlException ex)
{= Deletion Error: raquo ...