本文整理汇总了C#中System.Web.UI.WebControls.DetailsViewUpdatedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DetailsViewUpdatedEventArgs类的具体用法?C# DetailsViewUpdatedEventArgs怎么用?C# DetailsViewUpdatedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DetailsViewUpdatedEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DetailsViewUpdatedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: societaUpdate
protected void societaUpdate(object sender, DetailsViewUpdatedEventArgs e)
{
try
{
//quando faccio update per la societa sistemo l'username per l'utente
string username = e.NewValues["email"].ToString();
SqlCommand qUp = new SqlCommand();
qUp.Connection = conn;
conn.Open();
qUp.CommandType = CommandType.StoredProcedure;
qUp.CommandText = "updateUsername";
qUp.Parameters.Add(new SqlParameter("idSocieta", idSocieta));
qUp.Parameters.Add(new SqlParameter("username", username));
qUp.ExecuteNonQuery();
result.Text = "Società aggiornata correttamente";
dettaglioUtente.DataBind();
}
catch (Exception ex)
{
result.Text = "Si è verificato un errore durante la query: " + ex.Message;
}
}
示例2: DetailsView1_ItemUpdated
protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
if (e.Exception == null || e.ExceptionHandled)
{
Response.Redirect(table.ListActionPath);
}
}
示例3: DetailsViewEditItem_ItemUpdated
protected void DetailsViewEditItem_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
if (e.Exception == null)
{
}
else
{
ShowError(e.Exception);
e.ExceptionHandled = true;
}
}
示例4: dvwWine_ItemUpdated
/// <summary>
/// Event fired after update of Wine Details View
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void dvwWine_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
CheckBoxList cblAttributes = (CheckBoxList)dvwWine.FindControl("cblAttributes");
if (cblAttributes != null)
{
ClearAttributeAssignments(Convert.ToInt32(e.Keys[0]));
SetAttributeAssignments(cblAttributes, Convert.ToInt32(e.Keys[0]));
}
//redirect to the manage wines screen
Response.Redirect("/GUI/WineDatabase/ManageWines.aspx");
}
示例5: BankAccountDetailsView_ItemUpdated
protected void BankAccountDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
UserBL userBL = new UserBL();
string accountname = userBL.GetBankAccountName();
if (accountname != null)
{
TextBox pe = (TextBox)CompanyDetailsView.FindControl("BankAccountTextBox");
pe.Text = accountname;
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "CloseModal('BodyContent_ModalPanel1');", true);
}
示例6: dvCustomerSelect_ItemUpdated
protected void dvCustomerSelect_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
if (e.Exception != null)
{
lblDbError.Visible = true;
lblDbError.Text = "A database error occured. Message: " + e.Exception.Message;
e.ExceptionHandled = true;
e.KeepInEditMode = true;
}
else if (e.AffectedRows == 0)
{
lblDbError.Visible = true;
lblDbError.Text = "Another user may have updated this entry already";
}
}
示例7: CompanyDetailsView_ItemUpdated
protected void CompanyDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
long id = 0;
string value = Convert.ToString(Session["NewCompany"]);
if (value != "")
id = int.Parse(value);
if (id > 0)
{
Label1.Text = "Success !</br> <p>Company information has been updated successfully</p>";
UpdatePanel1.Update();
}
else
{
Label1.Text = "Error !</br> <p>Company information did not save.</p>";
UpdatePanel1.Update();
}
}
示例8: DetailsView1_ItemUpdated
protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
//Update Available days for the Booking Object
//Get parameters
int BookingObjectId = Convert.ToInt32(DetailsView1.DataKey.Value);
//Delete current information
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ABSConnectionString"].ToString());
SqlCommand cmd = new SqlCommand("DELETE FROM BookingObjectWorkingDay WHERE BookingObjectId = @BookingObjectId", conn);
cmd.Parameters.AddWithValue("@BookingObjectId", BookingObjectId);
conn.Open();
cmd.ExecuteNonQuery();
GridView AvailableDays = DetailsView1.FindControl("GridView2") as GridView;
//Check Availability for each of the days and add to database
foreach (GridViewRow row in AvailableDays.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
int WorkingDayId = row.RowIndex + 1; //Set Day
if (((CheckBox)row.FindControl("AvailabilityCheck")).Checked == true)
{
SqlCommand insertCmd = new SqlCommand("INSERT INTO BookingObjectWorkingDay (BookingObjectId, WorkingDayId) VALUES (@BookingObjectId, @WorkingDayId)", conn);
insertCmd.Parameters.AddWithValue("@BookingObjectId", BookingObjectId);
insertCmd.Parameters.AddWithValue("@WorkingDayId", WorkingDayId);
insertCmd.ExecuteNonQuery();
}
}
}
conn.Close();
Server.Transfer("Manage_Rooms.aspx");
}
示例9: detailsEmployee_ItemUpdated
// now we have added the Partial class to Linq generate class,
// let's try to handle that gracefully
protected void detailsEmployee_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
if (e.Exception != null)
{
// Has to enable EnableUpdate in DetailsView, otherwise, it goes to linqException branch.
LinqDataSourceValidationException linqException = e.Exception as LinqDataSourceValidationException;
if (linqException == null)
{
lblError.Text = "Data Error";
}
else
{
// to display all the validation error
lblError.Text = "";
foreach (Exception err in linqException.InnerExceptions.Values)
lblError.Text += err.Message + "<br />";
}
e.ExceptionHandled = true;
}
else
{
gridEmployees.DataBind();
}
}
示例10: DataValidation
protected String DataValidation(DetailsViewUpdatedEventArgs e)
{
decimal testfield = 0m;
if (!(Decimal.TryParse(e.NewValues["UnitPrice"].ToString(), out testfield)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Unit Price must be numeric ";
}
if (!(Decimal.TryParse(e.NewValues["OnHand"].ToString(), out testfield)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Inventory On Hand must be numeric ";
}
int number;
if (!(Int32.TryParse(e.NewValues["OnHand"].ToString(), out number)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "On Hand field must be an Integer ";
}
return lblError.Text;
}
示例11: UpdateSparse_ItemUpdated
protected void UpdateSparse_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
// SparesGridView.DataBind();
}
示例12: DetailsView_ItemUpdated
protected void DetailsView_ItemUpdated(Object sender, DetailsViewUpdatedEventArgs e)
{
// DeviceGridView.DataBind();
}
示例13: DetailsView1_ItemUpdated
protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
}
示例14: dvArticle_ItemUpdated
protected void dvArticle_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
lblStatus.Text = "Статья успешно обновлена.";
lblStatus.Visible = true;
}
示例15: dv_ItemUpdated
protected void dv_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
this.gv.SelectedIndex = -1;
this.gv.DataBind();
}