本文整理汇总了C#中System.Web.UI.WebControls.DetailsViewInsertedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DetailsViewInsertedEventArgs类的具体用法?C# DetailsViewInsertedEventArgs怎么用?C# DetailsViewInsertedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DetailsViewInsertedEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DetailsViewInsertedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExamDetailsView_ItemInserted
protected void ExamDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception == null)
{
ShowMessageBox("Exam is successfully created");
}
}
示例2: AccountDetailsView_ItemInserted
protected void AccountDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
long accountId = Convert.ToInt64(Session["AccountID"]);
if (e.Exception != null)
{
var customValidator = new CustomValidator();
customValidator.IsValid = false;
customValidator.ErrorMessage = "Insert failed: " + e.Exception.InnerException.Message;
customValidator.ValidationGroup = "avs";
Page.Validators.Add(customValidator);
e.ExceptionHandled = true;
}
else
{
if (accountId > 0)
{
AccountGridView.DataBind();
string accountName = e.Values["Name"].ToString();
TextBox AccountName = OpportunityDetailsView.FindControl("AccountNameTextBox") as TextBox;
AccountName.Text = accountName;
AccountList.Update();
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script",
"CloseModals(['BodyContent_ModalPanel1','BodyContent_ModalPanel291']);",
true);
}
}
}
示例3: DataValidation
protected String DataValidation(DetailsViewInsertedEventArgs e)
{
//if (e.Values["UnitPrice"].ToString() == "4")
decimal testfield = 0m;
if (!(Decimal.TryParse(e.Values["UnitPrice"].ToString(), out testfield)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Unit Price must be numeric ";
}
if (!(Decimal.TryParse(e.Values["OnHand"].ToString(), out testfield)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Inventory On Hand must be numeric ";
}
int number;
if (!(Int32.TryParse(e.Values["OnHand"].ToString(), out number)))
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "On Hand field must be an Integer ";
}
return lblError.Text;
}
示例4: DetailsView1_ItemInserted
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
((TextBox)DetailsView1.Rows[0].Cells[1].FindControl("TextBox1")).Text="";
((TextBox)DetailsView1.Rows[1].Cells[1].FindControl("TextBox2")).Text="";
((TextBox)DetailsView1.Rows[3].Cells[1].FindControl("TextBox3")).Text="";
Response.Redirect("NewModule.aspx");
}
示例5: DetailsView2_ItemInserted
protected void DetailsView2_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
GridView2.Visible = true;
this.setGriview2(GridView1.SelectedValue.ToString());
DetailsView2.DataBind();
UpdatePanel3.Update();
}
示例6: DetailsView1_ItemInserted
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception == null || e.ExceptionHandled)
{
Response.Redirect(table.ListActionPath);
}
}
示例7: InvoiceDetailsView_ItemInserted
//after inserting new invoice
protected void InvoiceDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
var customValidator = new CustomValidator();
customValidator.IsValid = false;
customValidator.ErrorMessage = "Save failed: " + e.Exception.InnerException.Message;
customValidator.ValidationGroup = "sum";
Page.Validators.Add(customValidator);
e.ExceptionHandled = true;
}
else
{
int rowcount = e.AffectedRows;
if (rowcount == -1)
{
string name = e.Values["Name"].ToString();
MsgLiteral.Text = "Success";
alertLabel.Text = "Invoice of " + name + " has been saved";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true);
//update the order(converted to true) thats invoice has been created..
long orderID = Convert.ToInt64(Session["OrderID"]);
orderBL.UpdateConvertOrder(orderID);
}
}
//ShowAlertModal();
MiniInvoiceFormView.DataBind();
MiniInvoiceDetailsView.DataBind();
InvoiceGridView.DataBind();
MiniInvoiceUpdatePanel.Update();
Session["EditInvoiceID"] = 0;
Session["EditOrderID"] = 0;
InvoiceDetailsView.DataBind();
}
示例8: AccountDetailsView_ItemInserted
protected void AccountDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
AccountGridView.DataBind();
string accountName = e.Values["Name"].ToString();
TextBox AccountName = ContactDetailsView.FindControl("AccountNameTextBox") as TextBox;
AccountName.Text = accountName;
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "CloseModals(['BodyContent_AccountListModalPanel','BodyContent_CreateAccountModalPanel']);", true);
}
示例9: DetailsViewModifica_ItemInserted
protected void DetailsViewModifica_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
LabelErrorMessage.Text = e.Exception.Message;
}
GridViewMarca.DataBind();
}
示例10: ChoicesDetailsView_ItemInserted
protected void ChoicesDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
//seçilen şıkkın tersini truth value false olacak şekilde tabloya yazarız
String questionID = Request.QueryString["questionID"].ToString();
String body = (String) Session["TFChoice"].ToString();
if (body == "True") body = "False";
else body = "True";
ChoicesSqlDataSource.InsertCommand = "INSERT INTO [Choice](questionId,body,truthValue) VALUES ('" + questionID + "','" + body + "','False')";
ChoicesSqlDataSource.Insert();
}
示例11: DetailsViewEditItem_ItemInserted
protected void DetailsViewEditItem_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception == null)
{
}
else
{
ShowError(e.Exception);
e.ExceptionHandled = true;
}
}
示例12: SectionDetailsView_ItemInserted
protected void SectionDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
e.ExceptionHandled = true;
ShowMessageBox("Existing Section");
}
else // if (e.Exception == null)
{
ShowMessageBox("Section successfully created");
}
}
示例13: DetailsView1_ItemInserted
protected void DetailsView1_ItemInserted(
object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
lblError.Text = "A database error has occurred.<br /><br />" +
e.Exception.Message;
if (e.Exception.InnerException != null)
lblError.Text += "<br />Message: "
+ e.Exception.InnerException.Message;
e.ExceptionHandled = true;
}
}
示例14: ExaminationDetailsView_ItemInserted
protected void ExaminationDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception != null)
{
e.ExceptionHandled = true;
ShowMessageBox("Could not schedule exam");
}
else // if (e.Exception == null)
{
SendMailNotification();
ShowMessageBox("Exam is successfully scheduled for the section");
}
}
示例15: ItemDetails_ItemInserted
void ItemDetails_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
if (e.Exception == null)
{
ItemsList.DataBind();
}
else
{
ShowError(e.Exception);
e.ExceptionHandled = HandleErrors;
e.KeepInInsertMode = true;
}
}