protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { // Display a user-friendly message ExceptionDetails.Visible = true; ExceptionDetails.Text = "There was a problem updating the product. "; if (e.Exception.InnerException != null) { Exception inner = e.Exception.InnerException; if (inner is System.Data.Common.DbException) ExceptionDetails.Text += "Our database is currently experiencing problems. Please try again later."; else if (inner is NoNullAllowedException) ExceptionDetails.Text += "There are one or more required fields that are missing."; else if (inner is ArgumentException) { string paramName = ((ArgumentException)inner).ParamName; ExceptionDetails.Text += string.Concat("The ", paramName, " value is illegal."); } else if (inner is ApplicationException) ExceptionDetails.Text += inner.Message; } // Indicate that the exception has been handled e.ExceptionHandled = true; // Keep the row in edit mode e.KeepInEditMode = true; } }
protected void dridView_RoeUpdated(object sender, GridViewUpdatedEventArgs e) { GridView1.Columns[1].Visible = true; GridView1.Columns[2].Visible = true; GridView1.Columns[3].Visible = true; GridView1.Columns[4].Visible = true; GridView1.Columns[5].Visible = true; GridView1.Columns[6].Visible = true; GridView1.Columns[9].Visible = false; //MailAddress mailfrom = new MailAddress("*****@*****.**"); //MailAddress mailto = new MailAddress("*****@*****.**"); //MailMessage newmsg = new MailMessage(mailfrom, mailto); //newmsg.Subject = "APPOINTMENT"; //newmsg.Body = "Appointment On date :" + GridView1.Rows[ + " is " + GridView1.SelectedRow.Cells[6].Text; //// Attachment att = new Attachment("C:\\...file path"); //// newmsg.Attachments.Add(att); //SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); //smtp.UseDefaultCredentials = false; //smtp.Credentials = new NetworkCredential("*****@*****.**", "were690vase804"); //smtp.EnableSsl = true; //smtp.Send(newmsg); //Response.Write(@"<script language='javascript'>alert('Appointment Status sent to Student's Mail')</script>"); }
protected void gvProducts_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occurred.<br /><br />" + e.Exception.ToString(); } }
protected void grdaltkategoriler_RowUpdated(object sender, GridViewUpdatedEventArgs e) { int AltKategoriID = Convert.ToInt32((this.grdaltkategoriler.Rows[e.AffectedRows].FindControl("lblID") as Label).Text); AltKategoriler altkat = et.AltKategorilers.Single(v => v.ALTID == AltKategoriID); altkat.ALTAD = (this.grdaltkategoriler.Rows[e.AffectedRows].FindControl("txtAd") as TextBox).Text; altkat.AKID = Convert.ToInt32((this.grdaltkategoriler.Rows[e.AffectedRows].FindControl("DropDownList2") as DropDownList).SelectedValue); et.SubmitChanges(); }
protected void GridView_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblConnError.Text = "Fout opgetreden bij het verbinden met de database:<br />" + e; e.ExceptionHandled = true; } }
protected void Categories_RowUpdated(object sender, GridViewUpdatedEventArgs e) { // If there were no problems and we updated the PDF file, then delete the existing one if (e.Exception == null) { DeleteRememberedBrochurePath(); } }
protected void gridAssetClass_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { showException(e.Exception, labelException, "updating the asset class"); e.ExceptionHandled = true; e.KeepInEditMode = true; } }
protected void gridBenchmarkData_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { showException(e.Exception, labelException, "updating the benchmark prices"); e.ExceptionHandled = true; e.KeepInEditMode = true; } }
protected void GridView_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { e.ExceptionHandled = true; e.KeepInEditMode = true; this.Alert(e.Exception.Message); } }
protected void grvStock_RowUpdated(object sender, GridViewUpdatedEventArgs e) { e.ExceptionHandled = (e.Exception != null); if (e.ExceptionHandled) { e.KeepInEditMode = true; Appz.ClientAlert(this, e.Exception.InnerException.Message); } }
protected void gridContent_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { showException(e.Exception, labelException, "updating the Text Content"); e.ExceptionHandled = true; e.KeepInEditMode = true; } }
protected void GroupGridView_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Flash.Visible = true; Flash.Text = e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } }
protected void Products_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.AffectedRows == 0) { ConcurrencyViolationMessage.Visible = true; e.KeepInEditMode = true; // Rebind the data to the GridView to show the latest changes Products.DataBind(); } }
protected void gridView_RowUpdated(object sender, GridViewUpdatedEventArgs e) { GridView1.Columns[1].Visible = true; GridView1.Columns[4].Visible = true; GridView1.Columns[5].Visible = true; GridView1.Columns[6].Visible = true; GridView1.Columns[8].Visible = true; GridView1.Columns[9].Visible = true; GridView1.Columns[10].Visible = false; GridView1.Columns[11].Visible = true; GridView1.Columns[7].Visible = true; }
public void gvFSFileOverview_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblErrorMessage.Text = "Error updating fund settle number, check for duplicate numbers"; e.ExceptionHandled = true; e.KeepInEditMode = true; } int fileId = Convert.ToInt32(e.Keys[0].ToString()); FSFileOverviewAdapter.PlaceOrdersForFile(fileId); }
protected void grdDiskografije_RowUpdated(Object sender, GridViewUpdatedEventArgs e) { if (e.Exception == null) { porukaPromjene.InnerText = "Uspješno promijenjeno"; } else { porukaPromjene.InnerText = "Dogodila se greška"; e.ExceptionHandled = true; } }
protected void GridViewProject_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Message.Text = e.Exception.Message + " , Please try again!"; e.ExceptionHandled = true; e.KeepInEditMode = true; } else { Message.Text = "Project Update Successful!"; } }
protected void GridView_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { ActionStatus.Text = e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } else { ActionStatus.Text = ""; } }
protected void grdIncidents_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occurred. <br /><br />" + "Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { lblError.Text = "Another user may have updated that incident.<br /> Please try again."; } }
//Event occurs when update command is sent protected void GridViewUsersUpdate(object sender, GridViewUpdatedEventArgs e) { if (e.AffectedRows == 1) { //the update is successful notification.Visible = true; notification.Text = "Update Successful"; } else { //the update is failed notification.Visible = true; notification.Text = "Update Failed"; } }
//handle exceptions for the row update event protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs 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; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { lblError.Text = "Another user may have updated that repair, please try again."; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "An exception occurred. " + "Please correct any invalid data and try again.<br /><br />" + "Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) lblError.Text = "No rows were updated. " + "Another user may have updated that category.<br />" + "Please try again."; }
protected void gvAllAccounts_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblStatus.Text = "Update failed. " + e.Exception.Message.ToString(); e.ExceptionHandled = true; } else if (e.AffectedRows == 0) { lblStatus.Text = "Update failed. Another user may have updated this record."; } else { lblStatus.Text = "Account was updated."; } }
//protected HtmlForm form1; //protected GridView GridView1; //protected Label Label1; //protected SqlDataSource SqlDataSource1; protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; using (SqlCommand command = new SqlCommand("UPDATE PRECALCUL SET NOTE=" + e.NewValues[0].ToString().Replace(',', '.') + " WHERE NUMERO=" + e.Keys[0].ToString())) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); command.Connection = connection; command.ExecuteNonQuery().ToString(); connection.Close(); } } this.GridView1.DataBind(); }
protected void GridViewAdmin_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occurred. " + "Message: " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { lblError.Text = "Another user may have updated that category. " + "Please try again."; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { lblError.Text = ""; if (e.Exception != null) { lblError.Text = "A database error has occured..."; e.ExceptionHandled = true; } else { if (e.AffectedRows == 0) { lblError.Text = "Someone might have already updated the item..."; } } GridView1.DataBind(); }
protected void GridView2_RowUpdated(object sender, GridViewUpdatedEventArgs e) { CartItem CartItem; List<CartItem> ItemList = new List<CartItem>(); ItemList = CartItem.getItems(); if (ItemList != null && ItemList.Count > 0) { CartMsg.Text = "Total: $ " + CartItem.grandTotal(); } else { CartMsg.Text = "Your cart is empty !"; } }
protected void gvOrderDetails_OnRowUpdated(object sender, GridViewUpdatedEventArgs e) { //Retrieve the table from the session object. DataTable dt = (DataTable)Session["TaskTable"]; ////Update the values. //GridViewRow row = TaskGridView.Rows[e.RowIndex]; //dt.Rows[row.DataItemIndex]["Id"] = ((TextBox)(row.Cells[1].Controls[0])).Text; //dt.Rows[row.DataItemIndex]["Description"] = ((TextBox)(row.Cells[2].Controls[0])).Text; //dt.Rows[row.DataItemIndex]["IsComplete"] = ((CheckBox)(row.Cells[3].Controls[0])).Checked; ////Reset the edit index. //TaskGridView.EditIndex = -1; ////Bind data to the GridView control. //BindData(); }
//handle exceptions for the row update event protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs 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; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { lblError.Text = "Another user may have updated that repair, please try again."; } }
protected void grdProducts_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occured. PLease check your data and try again"; e.ExceptionHandled = true; // handles all the exception that occures e.KeepInEditMode = true; // stays in edit mode } else if (e.AffectedRows == 0) // if affected row is zero then nothing is change in database. { lblError.Text = "Another user may have updated this product. Please try again "; } else { grdProducts.DataBind(); } }
protected void ProductsGrid_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null && e.Exception.InnerException != null) { if (e.Exception.InnerException is System.Data.DBConcurrencyException) { // Display the warning message and note that the exception has // been handled... UpdateConflictMessage.Visible = true; e.ExceptionHandled = true; // OPTIONAL: Rebind the data to the GridView and keep it in edit mode //ProductsGrid.DataBind(); //e.KeepInEditMode = true; } } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { try { if (e.AffectedRows > 0) { Response.Write("details updated"); } } catch (Exception ex) { using (StreamWriter streamwriter = new StreamWriter(ConfigurationManager.AppSettings["Logpath"].ToString(), true)) { streamwriter.WriteLine(DateTime.Now + " " + ex.Message); } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "StateSelectionError", "alert('" + ex.Message + "');", true); } }
/// <summary> /// Handles the RowUpdated event of the gvProducts control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="GridViewUpdatedEventArgs"/> instance containing the event data.</param> protected void gvProducts_RowUpdated(object sender, GridViewUpdatedEventArgs e) { this.lblError.Text = ""; if (e.Exception != null) { this.lblError.Text = "A database error has occurred.<br /<br />" + e.Exception.Message; e.ExceptionHandled = true; } else if (e.AffectedRows == 0) { this.lblError.Text = "Another user may have updated this customer. Try again"; } else { gvProducts.DataBind(); } EnableProductPanel(); }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblState2.Text = "A database error has occurred. " + "Message: " + e.Exception.Message; e.ExceptionHandled = true; } else if (e.AffectedRows == 0) { lblState2.Text = "No rows were updated."; } else { GridView1.DataBind(); } lblState2.Text = "Record Added Successfully"; }
protected void GV_carrito_RowUpdated(object sender, GridViewUpdatedEventArgs e) { //ACTUALIZA VALOR DEL PEDIDO SI MODIFICAN CANTIDADES UEncapPedido pedido = new UEncapPedido(); pedido.User_id = ((UEncapUsuario)Session["Valido"]).User_id; //List<UEncapCarrito> listCarrito2 = new DAOUser().ObtenerCarritoxUsuario(pedido.User_id); List <UEncapCarrito> listCarrito2 = new LUsuario().ObtenerCarritoxUsuario(pedido.User_id); int first = listCarrito2[0].Id_pedido; if (first != 0) { pedido.Total = listCarrito2.Sum(x => x.Precio * x.Cantidad).Value; pedido.Id = first; //new DAOUser().ActualizarValorpedido(pedido); new LUsuario().ActualizarValorpedido(pedido); } }
public void GridView_RowUpdated(Object sender, GridViewUpdatedEventArgs e) { // Use the Exception property to determine whether an exception // occurred during the insert operation. if (e.Exception != null) { // Insert the code to handle the exception. Feedback.Text = e.Exception.Message; // Use the ExceptionHandled property to indicate that the // exception is already handled. e.ExceptionHandled = true; // When an exception occurs, keep the GridView // control in edit mode. e.KeepInEditMode = true; } }
protected void grdProducts_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = DatabaseErrorMessage(e.Exception.Message); e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { lblError.Text = ConcurrencyErrorMessage(); } else { grdProducts.DataBind(); lblError.Text = ""; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { var data = e; var keys = e.Keys.Keys; var supple_id = e.Keys[0].ToString(); try { if (!Context.Request.Url.Host.Contains("localhost") && Context.Request.QueryString["Debug"] == null) { GET("http://vg.wilstream.ru:82/API/landpro/landprosupply/", "id=" + supple_id); } } catch { } }
protected void gvProjects_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblStatus.Text = "Unable to save changes."; e.ExceptionHandled = true; } else { if (e.AffectedRows == 0) { lblStatus.Text = "Update failed."; } else { lblStatus.Text = "Updated OK"; } } }
protected void GridLocal_RowUpdated(object sender, GridViewUpdatedEventArgs e) { var changeTime = DateTime.Now; var companyNo = User.Identity.Name; var connectionString = ConfigurationManager.ConnectionStrings["SecureConnectionString"].ConnectionString; var updateRecord = "INSERT INTO Pipecor_Edit(CompNumber, TimeOfEdit) VALUES (@CompNumber, @TimeOfEdit)"; using (var myConnection = new SqlConnection(connectionString)) { myConnection.Open(); var myCommand = new SqlCommand(updateRecord, myConnection); myCommand.Parameters.AddWithValue("@CompNumber", companyNo); myCommand.Parameters.AddWithValue("@TimeOfEdit", changeTime); myCommand.ExecuteNonQuery(); myConnection.Close(); } }
protected void GridView_dsdanhmuc_RowUpdated(object sender, GridViewUpdatedEventArgs e) { GridView_dsdanhmuc.DataBind(); if (GridView_dsdanhmuc.Rows.Count <= 0) { lblthongbao.Text = "Danh sách tài khoản trống!"; } else { lblthongbao.Text = ""; } if (e.Exception != null) { lblthongbao.Text = "Có lỗi xảy ra khi sửa tài khoản!"; e.ExceptionHandled = true; } }
protected void GridView_dskhachhang_RowUpdated(object sender, GridViewUpdatedEventArgs e) { GridView_dskhachhang.DataBind(); if (GridView_dskhachhang.Rows.Count <= 0) { Label_thongbao.Text = "Danh sách tài khoản khách hàng trống!"; } else { Label_thongbao.Text = ""; } if (e.Exception != null) { Label_error.Text = "Có lỗi xảy ra khi sửa tài khoản khách hàng!"; e.ExceptionHandled = true; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { //// GridView gv = (GridView)sender; //// GridViewRow gvr = (GridViewRow)gv.Rows[e.RowIndex]; //// // PERSONNELCATALOG pc = new PERSONNELCATALOG(); //// //// pc.Name = e.NewValues["Name"].ToString(); //// using (var context = new SMEntities()) //// { //// int str = Convert.ToInt32(e.NewValues["RegisterID"].ToString()); //// var cust = ////(from c in context.PERSONNELCATALOGs //// where c.RegisterID == str //// select c).First(); //// cust.Name = e.NewValues["Name"].ToString(); //// context.SaveChanges(); //// } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "A database error has occurred"; e.ExceptionHandled = true; } else { if (e.AffectedRows == 0) { lblError.Text = " Book is not updated. Someone may have already updated it already."; } else { lblError.Text = "Database is successfully updated."; } } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Errors2LBL.Text = "An error occurrred updating your meals. Check to make sure " + "you don't have duplicate recipe names & meal dates. " + e.Exception.Message; e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) { Errors2LBL.Text = "Another user may have updated that meal. Try again."; } else { GridView1.DataBind(); Errors2LBL.Text = "Meal successfully updated."; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { try { lblState.Text = "Record Updated Successfully"; txtProductCode.Enabled = true; txtName.Enabled = true; txtVersion.Enabled = true; txtReleaseDate.Enabled = true; RFValidatorProductCode.Enabled = true; RFValidatorName.Enabled = true; RFValidatorVersion.Enabled = true; RFValidatorReleaseDate.Enabled = true; btnAddProduct.Enabled = true; } catch (Exception ex) { lblState.Text = "A database connection error has occurred" + ex.Message; } }
protected void GridView1_RowUpdating(object sender, GridViewUpdatedEventArgs e) { SqlConnection connection = new SqlConnection("Server=DESKTOP-AD15ROA\\SQLEXPRESS;UId=xmum;Password=123456;Database=XMUA"); connection.Open(); SqlCommand cmd = new SqlCommand("update Score set course_id=@CID, course_name=@CN, mark=@M where student_id = @SID and course_id=@CID1", connection); cmd.Parameters.Add("@CID", SqlDbType.VarChar, 100).Value = ((Label)GridView1.Rows[GridView1.EditIndex].FindControl("lcid")).Text; cmd.Parameters.Add("@CID1", SqlDbType.VarChar, 100).Value = ((Label)GridView1.Rows[GridView1.EditIndex].FindControl("lcid")).Text; cmd.Parameters.Add("@CN", SqlDbType.VarChar, 100).Value = ((Label)GridView1.Rows[GridView1.EditIndex].FindControl("lcn")).Text; cmd.Parameters.Add("@M", SqlDbType.VarChar, 100).Value = ((TextBox)GridView1.Rows[GridView1.EditIndex].FindControl("tbMark")).Text; cmd.Parameters.Add("@SID", SqlDbType.VarChar, 100).Value = ((Label)GridView1.Rows[GridView1.EditIndex].FindControl("lsid")).Text; cmd.ExecuteNonQuery(); GridView1.EditIndex = -1; }
protected void gridorder_RowUpdated(object sender, GridViewUpdatedEventArgs e) { string arg = e.NewValues[0].ToString(); try { int n = Int32.Parse(arg); if (n < 0) { Label2.Text = "Invalid Quantity"; gridorder.Rows[0].Cells[2].Text = e.OldValues[2].ToString(); Button1.Enabled = false; Button2.Enabled = false; gridorder.DataBind(); } } catch (FormatException i) { Response.Write("Invalid Quantity"); } }
protected void gvIndemnizaciones_RowUpdated(object sender, GridViewUpdatedEventArgs e) { string sResult = string.Empty; if (e.Exception != null) { e.ExceptionHandled = true; Logger.Instance.LogException(Logger.typeUserActions.UPDATE, "updating indemnizacion", e.Exception); sResult = "ERROR ACTUALIZANDO LA INDEMNIZACION, REVISE LOS DATOS E INTENTELO DE NUEVO <BR />"; sResult += "DESCRIPCION DEL ERROR: " + e.Exception.ToString(); } if (e.AffectedRows == 1) { sResult = "INDEMNIZACION ACTUALIZADA EXITOSAMENTE."; } this.lblIndeminzacionResult.Visible = true; this.lblIndeminzacionResult.Text = sResult; this.gvIndemnizaciones.DataBind(); this.gvCreditoData.DataBind(); this.dvEstadoGeneral.DataBind(); }
protected void GridView1_RowUpdated( Object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { lblError.Text = "An exception has occurred. " + "Please check all entries and try again.<br /><br />" + e.Exception.Message; if (e.Exception.InnerException != null) lblError.Text += "<br />Message: " + e.Exception.InnerException.Message + "<br />"; e.ExceptionHandled = true; e.KeepInEditMode = true; } else if (e.AffectedRows == 0) lblError.Text = "Another user may have updated that category. " + "Please try again.<br />"; }
protected void grdProdutosOrcamentoComposicao_RowUpdated(object sender, GridViewUpdatedEventArgs e) { var grdProdutosOrcamentoComposicaoParent = grdProdutosOrcamentoComposicao.Parent; while (grdProdutosOrcamentoComposicaoParent.ID != "grdProdutosOrcamento") { grdProdutosOrcamentoComposicaoParent = grdProdutosOrcamentoComposicaoParent.Parent; } var dtvOrcamento = grdProdutosOrcamentoComposicao.Parent; while (dtvOrcamento.ID != "mainTable") { dtvOrcamento = dtvOrcamento.Parent; } dtvOrcamento = dtvOrcamento.FindControl("dtvOrcamento"); ((DetailsView)dtvOrcamento).DataBind(); ((GridView)grdProdutosOrcamentoComposicaoParent).DataBind(); }
protected void GridView2_RowUpdated(object sender, GridViewUpdatedEventArgs e) { GridView2.Columns[2].Visible = false; GridView2.Columns[3].Visible = false; TableSeuil.Visible = GridView2.Columns[3].Visible; Button3.Text = "Afficher Seuils"; string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; using (SqlCommand command = new SqlCommand()) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); command.Connection = connection; command.CommandText = "SELECT CAST(CAST(SUM(CASE WHEN NOTE >= [OR] THEN 1 ELSE 0 END)*100.00 / SUM(1) AS DECIMAL(5,2)) AS VARCHAR(255)) + '%' FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.pOR.Text = command.ExecuteScalar().ToString(); command.CommandText = "SELECT CAST(CAST(SUM(CASE WHEN NOTE >= ARGENT AND NOTE < [OR] THEN 1 ELSE 0 END)*100.00 / SUM(1) AS DECIMAL(5,2)) AS VARCHAR(255)) + '%' FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.pARGENT.Text = command.ExecuteScalar().ToString(); command.CommandText = "SELECT CAST(CAST(SUM(CASE WHEN NOTE >= BRONZE THEN 1 ELSE 0 END)*100.00 / SUM(1) AS DECIMAL(5,2)) AS VARCHAR(255)) + '%' FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.pMedailles.Text = command.ExecuteScalar().ToString(); command.CommandText = "SELECT CAST(SUM(CASE WHEN NOTE >= [OR] THEN 1 ELSE 0 END) AS VARCHAR(255)) FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.nbOR.Text = command.ExecuteScalar().ToString() + " vins"; command.CommandText = "SELECT CAST(SUM(CASE WHEN NOTE >= ARGENT AND NOTE < [OR] THEN 1 ELSE 0 END) AS VARCHAR(255)) FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.nbARGENT.Text = command.ExecuteScalar().ToString() + " vins"; command.CommandText = "SELECT CAST(SUM(CASE WHEN NOTE >= BRONZE AND NOTE < ARGENT THEN 1 ELSE 0 END) AS VARCHAR(255)) FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; command.CommandText = "SELECT CAST(SUM(CASE WHEN NOTE >= BRONZE THEN 1 ELSE 0 END) AS VARCHAR(255)) FROM PRECALCUL, SEUIL_BY_CATEG WHERE PRECALCUL.CATEGORIE = SEUIL_BY_CATEG.CATEGORIE"; this.nbMedailles.Text = command.ExecuteScalar().ToString() + " vins"; command.CommandText = "SELECT CAST(SUM(1) AS VARCHAR(255)) FROM PRECALCUL"; this.nbTOTAL.Text = command.ExecuteScalar().ToString() + " vins"; connection.Close(); this.GridView1.DataBind(); this.GridView2.DataBind(); this.GridView3.DataBind(); } } }
protected void grdCollectiveName_RowUpdated(Object sender, GridViewUpdatedEventArgs e) { String tempStr = ""; // Append the original field values to the log text. foreach (DictionaryEntry valueEntry in e.OldValues) { tempStr += valueEntry.Key + "=" + valueEntry.Value + ";"; } if (e.Exception == null) { // The update operation succeeded. Clear the message label. //ErrorMessage.Text = ""; } else { // The update operation failed. Display an error message. //ErrorMessage.Text = e.AffectedRows.ToString() + " rows updated. " + e.Exception.Message; e.ExceptionHandled = true; } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { stdb = adpStt.CheckStatus(orderGet); List <string> statusRows = new List <string>(); foreach (var row in stdb) { string sttS = row["Status"].ToString(); statusRows.Add(sttS); } foreach (var i in statusRows) { if (!i.Equals("Completed")) { adpOrd.UpdateStatus("Processing", orderGet); } else { adpOrd.UpdateStatus("Completed", orderGet); } } }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { // Display a user-friendly message ExceptionDetails.Visible = true; ExceptionDetails.Text = "There was a problem updating the product. "; if (e.Exception.InnerException != null) { Exception inner = e.Exception.InnerException; if (inner is System.Data.Common.DbException) { ExceptionDetails.Text += "Our database is currently experiencing problems. Please try again later."; } else if (inner is NoNullAllowedException) { ExceptionDetails.Text += "There are one or more required fields that are missing."; } else if (inner is ArgumentException) { string paramName = ((ArgumentException)inner).ParamName; ExceptionDetails.Text += string.Concat("The ", paramName, " value is illegal."); } else if (inner is ApplicationException) { ExceptionDetails.Text += inner.Message; } } // Indicate that the exception has been handled e.ExceptionHandled = true; // Keep the row in edit mode e.KeepInEditMode = true; } }
protected void DetailsView_Update(object sender, GridViewUpdatedEventArgs e) { DetailsView1.DataBind(); }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { this.Label1.Text = e.Exception.Message; } }
protected void Row_Updating(Object sender, GridViewUpdatedEventArgs e) { // GridViewRow row = ((GridView)sender).Rows[e.RowIndex];//row.Cells[13].Controls[0] //// LiteralControl ltEmil = (LiteralControl)row.Cells[22].Controls[0]; //// HtmlContainerControl dvEmail=(HtmlContainerControl) ltEmil.FindControl("dvEmail"); //////////////////// HtmlTextArea txtemail = (HtmlTextArea)ltEmil.FindControl("txtemail"); //// TextBox txtemailfff = (TextBox)ltEmil.FindControl("txtemail"); //// HtmlTextArea txtemaillllll = (HtmlTextArea)ltEmil.FindControl("txt_email"); /// UpdateDonate("S", "get_Orgs",0); // HtmlContainerControl hh = (HtmlContainerControl)e.NewValues[9]; //int i = e.NewSelectedIndex;dvEmil //grdvSubGmach.EditIndex = e..Row.DataItemIndex; /// grdvSubGmach.DataBind(); /// // String id =e.OldValues[0].ToString() ; //String email =e.NewValues[0].ToString() ; //String subtype =e.NewValues[0].ToString() ; //String firstName = e.NewValues[0].ToString() ; //String lastName =e.NewValues[0].ToString() ; //String tel = e.NewValues[0].ToString() ; //String sunday = e.NewValues[0].ToString() ; //String monday = e.NewValues[0].ToString() ; //String tuesday = e.NewValues[0].ToString() ; //String wednesday = e.NewValues[0].ToString() ; //String thursday = e.NewValues[0].ToString() ; //String friday = e.NewValues[0].ToString() ; //String morning = e.NewValues[0].ToString() ; //String afternoon = e.NewValues[0].ToString() ; //String evening = e.NewValues[0].ToString() ; //String subType = e.NewValues[0].ToString() ; //String prm = "u"; //String avail_request = e.OldValues[0].ToString() ; // GridViewRow row = ((GridView)sender).Rows[e.RowIndex];//row.Cells[13].Controls[0] ////LiteralControl ltEmil = (LiteralControl)row.Cells[22].Controls[0]; ////TextBox ID = (TextBox)row.Cells[1].Controls[0]; ////string id = ID.Text; ////HtmlContainerControl dvEmail = (HtmlContainerControl)ltEmil.FindControl("dvEmail"); //////////////////// HtmlTextArea txtemail = (HtmlTextArea)ltEmil.FindControl("txtemail"); ////TextBox txtemailfff = (TextBox)ltEmil.FindControl("txtemail"); //HtmlTextArea txtemaillllll = (HtmlTextArea)ltEmil.FindControl("txt_email"); string status = e.NewValues[0].ToString(); ; // grdvSubGmach.EditIndex = e.NewEditIndex; //string firstName = ""; //string lastName = ""; string commandText = "setMatches"; //r.setMatches(commandText, prm, id, morning, afternoon, evening, // sunday, monday, tuesday, wednesday, thursday, friday, // subType, avail_request, email, firstName, lastName, tel, status); //grdvSubGmach.AutoGenerateColumns = false; ///UpdateDonate("S", "get_Orgs", 0, "pending"); }
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e) { }