本文整理匯總了C#中System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# ObjectDataSourceStatusEventArgs類的具體用法?C# ObjectDataSourceStatusEventArgs怎麽用?C# ObjectDataSourceStatusEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ObjectDataSourceStatusEventArgs類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了ObjectDataSourceStatusEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CategoryObjectDataSource_Deleted
protected void CategoryObjectDataSource_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
e.ExceptionHandled = true;
}
}
開發者ID:chutinhha,項目名稱:logic-university-stationery-store-inventory-system,代碼行數:7,代碼來源:Categories.aspx.cs
示例2: ods_PersonalProfile_Updated
protected void ods_PersonalProfile_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception == null)
{
//ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Your profile saved successfully.');", true);
}
}
示例3: CheckForEfExceptions
private void CheckForEfExceptions(ObjectDataSourceStatusEventArgs e, string function)
{
if (e.Exception.InnerException is DbUpdateConcurrencyException)
{
var concurrencyExceptionValidator = new CustomValidator
{
IsValid = false,
ErrorMessage =
"The record you attempted to edit or delete was modified by another " +
"user after you got the original value. The edit or delete operation was canceled " +
"and the other user's values have been displayed so you can " +
"determine whether you still want to edit or delete this record."
};
Page.Validators.Add(concurrencyExceptionValidator);
e.ExceptionHandled = true;
}
else if (e.Exception.InnerException is DbEntityValidationException)
{
var concurrencyExceptionValidator = new CustomValidator();
concurrencyExceptionValidator.IsValid = false;
StringBuilder errors = new StringBuilder();
foreach (var err in ((DbEntityValidationException)e.Exception.InnerException).EntityValidationErrors)
{
foreach (var msg in err.ValidationErrors)
{
var validator = new CustomValidator();
validator.IsValid = false;
validator.ErrorMessage = msg.ErrorMessage;
Page.Validators.Add(validator);
e.ExceptionHandled = true;
}
}
}
}
示例4: oTerminal_Updated
protected void oTerminal_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception == null)
{
Response.Redirect("~/Terminales/MantenimientoTerminal/ConsultarTerminal.aspx");
}
}
示例5: dsProtocolo_Inserted
protected void dsProtocolo_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception == null)
{
Response.Redirect("~/Comunicacion/MantenimientoProtocolo/ConsultarProtocolo.aspx");
}
}
示例6: ObjectDataSourceEx_Selected
private void ObjectDataSourceEx_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (this.SelectAllCountMethodExecuted)
{
this.Count = (int) e.ReturnValue;
}
}
示例7: CallDetailsObjectDataSource_Updated
protected void CallDetailsObjectDataSource_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
var customValidator = new CustomValidator();
customValidator.IsValid = false;
customValidator.ErrorMessage = "Update failed: " + e.Exception.InnerException.Message;
customValidator.ValidationGroup = "sum";
Page.Validators.Add(customValidator);
e.ExceptionHandled = true;
}
else
{
CallListUpdatePanel.Update();
MiniDetailBasicUpdatePanel.Update();
CallDetailsView.DataBind();
this.CallListGridView.DataBind();
this.CallListGridView.SelectedIndex = -1;
this.CallMiniDetailFormView.DataBind();
this.CallMiniMoreDetailsView.DataBind();
MessageLiteral.Text = "Success </br></br> <p> Call has been successfully updated <br/> ";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true);
CallDetailsView.ChangeMode(DetailsViewMode.Insert);
Session["EditCallID"] = 0;
}
}
示例8: InstructorDetailsDataSource_Deleted
protected void InstructorDetailsDataSource_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.AffectedRows != 0)
{
InstructorList.DataBind();
}
}
示例9: oPuntoServicio_Inserted
protected void oPuntoServicio_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception == null)
{
Response.Redirect("~/Terminales/MantenimientoPuntoServicio/ConsultarPuntoServicio.aspx");
}
}
示例10: ObjectDataSource1_Inserted
/// <summary>
/// Adds the inserted id to the view state.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ObjectDataSource1_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.ReturnValue != null)
{
ViewState.Add("Id", e.ReturnValue.ToString());
}
}
示例11: DepartmentsObjectDataSource_Deleted
protected void DepartmentsObjectDataSource_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
CheckForOptimisticConcurrencyException(e, "delete");
}
}
示例12: CustomerObjectDataSource_Updated
protected void CustomerObjectDataSource_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
CheckForEfExceptions(e, "update");
}
}
示例13: odsOrgsPaged_Selected
protected void odsOrgsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
messageBox.ShowErrorMessage("GET_ORGS", e.Exception);
e.ExceptionHandled = true;
}
}
示例14: odsServersPaged_Selected
protected void odsServersPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception);
e.ExceptionHandled = true;
}
}
示例15: odsSharePointSiteCollectionPaged_Selected
protected void odsSharePointSiteCollectionPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
messageBox.ShowErrorMessage("HOSTEDSHAREPOINT_GET_SITECOLLECTIONS", e.Exception);
e.ExceptionHandled = true;
}
}