本文整理汇总了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;
}
}