protected void GridSap_RowDeleting(object sender, ASPxDataDeletingEventArgs e) { try { var erpDoc = e.Values["ERP_DOC"].ToString(); //BORRAR DEL DATASET var oldDs = (DataSet)Session["SAP_RECEPTION_DATA"]; oldDs.Tables[0].Delete("ERP_DOC = '" + erpDoc + "'"); oldDs.Tables[0].AcceptChanges(); if (oldDs.Tables[0].Rows.Count == 0) { Session["SAP_RECEPTION_TYPE"] = null; } Session["SAP_RECEPTION_DATA"] = oldDs; e.Cancel = true; GridReception.CancelEdit(); GridReception.DataSource = Session["SAP_RECEPTION_DATA"]; GridReception.DataBind(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void AspxRowDeleting(object sender, ASPxDataDeletingEventArgs e) { try { var receptionDetailTemp = Convert.ToInt32(e.Keys["RECEPTION_DETAIL_TEMP"]); _wscalled.DeleteDetail(receptionDetailTemp, Session["connectionString"].ToString()); e.Cancel = true; GridReception.CancelEdit(); var pResult = ""; var dsDetail = _wscalled.GetIncomeDetailForIncomeHeader((int)Session["Header"], Session["connectionString"].ToString(), ref pResult); if (pResult == "") { GridReception.DataSource = dsDetail; GridReception.DataBind(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } pcConfirm.ShowOnPageLoad = false; } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }