protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception == null || e.ExceptionHandled) { Response.Redirect(table.ListActionPath); } }
protected void ExamDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception == null) { ShowMessageBox("Exam is successfully created"); } }
protected void DetailsView2_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { GridView2.Visible = true; this.setGriview2(GridView1.SelectedValue.ToString()); DetailsView2.DataBind(); UpdatePanel3.Update(); }
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"); }
//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(); }
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; }
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); } } }
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); }
protected void DetailsViewModifica_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception != null) { LabelErrorMessage.Text = e.Exception.Message; } GridViewMarca.DataBind(); }
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(); }
protected void DetailsViewEditItem_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception == null) { } else { ShowError(e.Exception); e.ExceptionHandled = true; } }
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"); } }
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; } }
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"); } }
void ItemDetails_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception == null) { ItemsList.DataBind(); } else { ShowError(e.Exception); e.ExceptionHandled = HandleErrors; e.KeepInInsertMode = true; } }
public void DetailsView1_ItemInserted1(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; } lblStatus.Visible = true; lblStatus.Text = "You Have secussfully added the Course"; Response.Redirect("~/Default.aspx"); }
protected void dvCustomerSelect_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception != null) { lblDbError.Visible = true; lblDbError.Text = "A database error occured. Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInInsertMode = true; } else if (e.AffectedRows == 0) { lblDbError.Visible = true; lblDbError.Text = "Another user may have added this entry already"; } else grdCustomers.DataBind(); }
protected void BankAccountDetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { UserBL userBL = new UserBL(); int bankaccountid = Convert.ToInt32(Session["NewBankID"]); int bankid = userBL.CompanySetBankAccountID(bankaccountid); 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); }
/// <summary> /// Handles the ItemInserted event of the dvCustomers control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DetailsViewInsertedEventArgs"/> instance containing the event data.</param> protected void dvCustomers_ItemInserted(object sender, System.Web.UI.WebControls.DetailsViewInsertedEventArgs e) { if (e.Exception != null) { this.lblError.Text = "A database error has occurred. " + "Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInInsertMode = true; } else if (e.AffectedRows == 0) { this.lblError.Text = "Another user may have updated that customer. " + "Please try again"; } else { this.gvCustomers.DataBind(); } }
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occurred. " + "Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInInsertMode = true; lblError.Text = DataValidation(e); } else if (e.AffectedRows == 0) lblError.Text = "Another user may have updated that product. " + "Please try again. "; else { lblError.Text = "New record was successfully added. "; GridView1.DataBind(); } }
void dv_ItemInserted (object sender, DetailsViewInsertedEventArgs e) { itemInserted = true; }
static void d_ItemInserted (object sender, DetailsViewInsertedEventArgs e) { if (WebTest.CurrentTest.UserData == null) { ArrayList list = new ArrayList (); list.Add ("ItemInserted"); WebTest.CurrentTest.UserData = list; } else { ArrayList list = WebTest.CurrentTest.UserData as ArrayList; if (list == null) throw new NullReferenceException (); list.Add ("ItemInserted"); WebTest.CurrentTest.UserData = list; } }
public void DoOnItemInserted (DetailsViewInsertedEventArgs e) { OnItemInserted (e); }
protected void dvArticle_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { lblStatus.Text = "Статья успешно добавлена."; lblStatus.Visible = true; }
protected void dvInsertComment_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { gvAllComments.DataBind(); }
protected void MeetingDetailsView_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 mailresult = String.Empty; if (Session["toUser"] != null) { string usertname = String.Empty; long recentmeetingID = Convert.ToInt64(Session["NewMeeting"]); ListDictionary templateValues = new ListDictionary(); string subject = e.Values["Subject"].ToString(); string startDate = e.Values["StartDate"].ToString(); string endDate = e.Values["EndDate"].ToString(); string location = e.Values["Location"].ToString(); long uid = Convert.ToInt64(e.Values["CreatedBy"]); IEnumerable<User> userdetails = userBL.GetUsersByID(uid); foreach (var name in userdetails) { usertname = name.FirstName; } templateValues.Add("<%=CreatedBy%>", usertname); templateValues.Add("<%=Subject%>", subject); templateValues.Add("<%=StartDate%>", startDate); templateValues.Add("<%=EndDate%>", endDate); templateValues.Add("<%=Location%>", location); string emailAdd = Session["toUser"].ToString(); string attendees = emailAdd.TrimEnd(';'); if (attendees.Contains(';')) { string[] emails = attendees.Split(';'); foreach (string email in emails) { string receiver = email; C3App.App_Code.Notification.Notify("Meeting", recentmeetingID, 1, receiver, 4, templateValues); mailresult = "and mail successfully sent"; } } else { if (attendees != string.Empty) { C3App.App_Code.Notification.Notify("Meeting", recentmeetingID, 1, attendees, 4, templateValues); mailresult = "and mail successfully sent"; } } //save meeting invitees long meetingID = Convert.ToInt64(Session["NewMeeting"]); const string inviteeType = "Contacts"; string allInvitee = Session["targetID"].ToString().TrimEnd(';'); string[] invitees = allInvitee.Split(';'); foreach (string invitee in invitees) { long inviteeID = Convert.ToInt64(invitee); meetingBL.SaveMeetingInvitees(meetingID, inviteeID, inviteeType); } Session.Remove("toUser"); Session["targetID"] = 0; } else { mailresult = "but not selecected any meeting invitee"; } string meetingSubject = e.Values["Subject"].ToString(); MessageLiteral.Text = "Success <br /><p> Meeting on " + meetingSubject + " has been saved " + mailresult + " </p>"; ViewMeetingsGridView.DataBind(); WeeklyMeetingGridView.DataBind(); MiniDetailsUpdatePanel.Update(); Session["NewMeeting"] = 0; } else { MessageLiteral.Text = "Sorry,save failed <br /> <p> Please try again</p>"; } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "ShowAlertModal();", true); MeetingDetailsView.DataBind(); MeetingDetailsView.ChangeMode(DetailsViewMode.Insert); //CreateMeetingUpdatePanel.Update(); MeetingTargetListUpdatePanel.Update(); ContactGridView.DataBind(); } }
protected void dv_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { this.gv.SelectedIndex = -1; this.gv.DataBind(); }
protected virtual new void OnItemInserted(DetailsViewInsertedEventArgs e) { }
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { GridView1.DataBind(); DetailsView1.DefaultMode = DetailsViewMode.Edit; }
protected void dvwOrderStatus_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { gvwOrderStatuses.SelectedIndex = -1; gvwOrderStatuses.DataBind(); }
protected void DetailsView2_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { GridView2.DataSourceID = "LinqDataSource2"; GridView2.DataBind(); }
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { GridView1.DataBind(); }