protected void GridEstado_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnCambiar") { int lintCodigoEstado = Convert.ToInt32(this.GridEstado.GetRowValues(e.VisibleIndex, "Estado_ID")); this.GridEstado.JSProperties.Clear(); this.GridEstado.JSProperties.Add("cpMuestra", "General.aspx"); if (lintCodigoEstado > -1) { Guid lGuid = new Guid(Session["xCodigo"].ToString()); using (ICCEntities lObjEntidad = new ICCEntities()) { TRX_DYR_Movil lObjMovil = new TRX_DYR_Movil(); lObjMovil = (from p in lObjEntidad.TRX_DYR_Movil where p.Codigo == lGuid select p).FirstOrDefault(); if (lObjMovil != null) { lObjMovil.Estado_ID = Convert.ToInt32(this.GridEstado.GetRowValues(e.VisibleIndex, "Estado_ID")); lObjEntidad.SaveChanges(); } } } } }
protected void GridInforme_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnSelecionar") { this.GridInforme.JSProperties.Clear(); this.GridInforme.JSProperties.Add("cpMuestra", "ControlCalidad.aspx"); Session["xCodigo"] = Convert.ToString(this.GridInforme.GetRowValues(e.VisibleIndex, "Codigo")); } }
protected void GridView_PlanPago_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "EstadoCuenta") { Session["ReportName"] = "EstadoCuenta"; Session["IdAsignacionEstadoCuenta"] = GridView_PlanPago.GetRowValues(e.VisibleIndex, "IdAsignacion"); Response.Redirect("ReportViewer.aspx"); } }
protected void axgvProject_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "Select") { } else { } }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnMostrar") { string lStrArchivo = this.ASPxGridView1.GetRowValues(e.VisibleIndex, "CodigoBoletin").ToString() + "/" + this.ASPxGridView1.GetRowValues(e.VisibleIndex, "NombreArchivo").ToString(); ASPxGridView1.JSProperties.Clear(); ASPxGridView1.JSProperties.Add("cpBoletin", lStrArchivo); } }
protected void ASPxGridView3_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnview2") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView3.GetDataRow(Gid); int id = Convert.ToInt32(dr["LeaveID"].ToString()); Response.Redirect("~/HR/ViewLeave.aspx?id=" + id); } }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnview") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView1.GetDataRow(Gid); int id = Convert.ToInt32(dr["id"].ToString()); Response.Redirect("~/Finance_Module/ViewGLAccount.aspx?GlAccountID=" + id); } }
protected void ASPxGridView2_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnview") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView1.GetDataRow(Gid); int id = Convert.ToInt32(dr["id"].ToString()); Response.Redirect("~/StudentAfair/ViewDocuments.aspx?id=" + id); } }
protected void dgUsuarios_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { UnidadDeTrabajo wu = new UnidadDeTrabajo(); switch (e.ButtonID) { case "Editar": Usuario user = wu.Usuario.ObtenerPorId(int.Parse(dgUsuarios.GetRowValues(e.VisibleIndex, "Id").ToString())); break; } }
protected void dgRecepciones_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { UnidadDeTrabajo wu = new UnidadDeTrabajo(); switch (e.ButtonID) { case "Editar": dgRecepcionDetalle.Visible = true; cmbIdOrdenCompra.DataSource = wu.OrdenCompra.ObtenerListaOrdenesCompra(); cmbIdOrdenCompra.ValueField = "Id"; cmbIdOrdenCompra.TextField = "RazonSocial"; cmbIdOrdenCompra.DataBind(); cmbIdOrdenCompra.ReadOnly = true; //cmbProveedor.DataSource = wu.Empresa.ObtenerListaProveedores(); //cmbProveedor.DataBind(); cmbTipoDocumento.DataSource = wu.TipoDocumento.Obtener(); cmbTipoDocumento.DataBind(); //var ordenCompra = wu.OrdenCompra.ObtenerListaOrdenesCompra().ToList(); //ordenCompra. Recepcion Recepcion = wu.Recepcion.ObtenerPorId(int.Parse(dgRecepciones.GetRowValues(e.VisibleIndex, "Id").ToString())); cmbIdOrdenCompra.Value = Recepcion.IdOrdenCompra; cmbProveedor.Value = Recepcion.IdEmpresa; deFechaRecepcion.Value = Recepcion.Fecha; txtNumeroDocumento.Value = Recepcion.NumeroComprobante; txtSerieDocumento.Value = Recepcion.SerieComprobante; txtNumeroGuia.Value = Recepcion.NumeroGuiaRemision; txtSerieGuia.Value = Recepcion.SerieGuiaRemision; cmbProveedor.Value = Recepcion.IdEmpresa; dgRecepcionDetalle.DataSource = wu.RecepcionDetalle.ObtenerDetalleRecepcion(Recepcion.Id); dgRecepcionDetalle.DataBind(); cmbTipoDocumento.Value = Recepcion.IdTipoDocumento; dgRecepcionDetalleNew.Visible = false; pcEditorRecepciones.ShowOnPageLoad = true; break; case "Anular": Recepcion OrdenC_anular = wu.Recepcion.ObtenerPorId(int.Parse(dgRecepciones.GetRowValues(e.VisibleIndex, "Id").ToString())); OrdenC_anular.IdEstado = 11; wu.Recepcion.Actualizar(OrdenC_anular); wu.Grabar(); cargarRecepciones(); break; case "showReport": Session["ItemClickeado"] = "RecepcionCompra"; string url = "Reporte.aspx?Recepcion=" + int.Parse(dgRecepciones.GetRowValues(e.VisibleIndex, "Id").ToString()); Response.Write("<script>window.open('" + url + "','_blank');</script>"); break; } }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnDelete") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView1.GetDataRow(Gid); int id = Convert.ToInt32(dr["id"].ToString()); string sql = "DELETE FROM [Std_Absent] WHERE ID=" + id; DataAccess.ExecuteSQLNonQuery(sql); Response.Redirect(Request.Url.AbsoluteUri); } }
protected void griddevice_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (this.griddevice.FocusedRowIndex != -1) { if (e.ButtonID.Equals("Check")) { pcLogin.ShowOnPageLoad = true; lblID.Text = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "ID").ToString(); lblIDD.Text = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "IDD").ToString(); lblIOTYPE.Text = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "Type").ToString(); } } }
protected void griddevice_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (this.griddevice.FocusedRowIndex != -1) { object ID = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "idD"); lblDid.Text = ID.ToString(); int id = Convert.ToInt32(ID); if (e.ButtonID.Equals("sensor")) { try { string sql = "select * from tblDeviceIO where idD=" + ID; SqlDataAdapter adapter = new SqlDataAdapter(sql, strcon); DataTable data2 = new DataTable(); adapter.Fill(data2); if (data2.Rows.Count <= 0) { } else { string a, b; var pair = printAnalogMinMax("A1", id); a = pair.Key; b = pair.Value; txta1min.Text = a; txta1max.Text = b; pair = printAnalogMinMax("A2", id); a = pair.Key; b = pair.Value; txta2min.Text = a; txta2max.Text = b; pair = printAnalogMinMax("A3", id); a = pair.Key; b = pair.Value; txta3min.Text = a; txta3max.Text = b; pair = printAnalogMinMax("A4", id); a = pair.Key; b = pair.Value; txta4min.Text = a; txta4max.Text = b; pair = printAnalogMinMax("InternalTemp", id); a = pair.Key; b = pair.Value; txtinternalmin.Text = a; txtinternalmax.Text = b; } pnlDeviceIO.Visible = true; pnldevice.Visible = false; } catch (Exception ex) { } } } }
protected void griddevice_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (this.griddevice.FocusedRowIndex != -1) { object ID = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "idD"); lblID.Text = ID.ToString(); int id = Convert.ToInt32(ID); if (e.ButtonID.Equals("CR")) { try { pnldevice.Visible = false; pnlcr.Visible = true; pnlManageCR.Visible = false; pnlDonecr.Visible = false; //string sql = "select * from tblDeviceIO "; } catch (Exception ex) { } } if (e.ButtonID.Equals("ListCR")) { try { pnldevice.Visible = false; pnlManageCR.Visible = true; pnlDonecr.Visible = false; pnlcr.Visible = false; //string sql = "select * from tblDeviceIO "; } catch (Exception ex) { } } if (e.ButtonID.Equals("ListDCR")) { try { pnldevice.Visible = false; pnlDonecr.Visible = true; pnlManageCR.Visible = false; pnlcr.Visible = false; //string sql = "select * from tblDeviceIO "; } catch (Exception ex) { } } } }
protected void gridCRs_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (this.gridCRs.FocusedRowIndex != -1) { object ID = this.gridCRs.GetRowValues(this.gridCRs.FocusedRowIndex, "id"); lblcrid.Text = ID.ToString(); // int id = Convert.ToInt32(ID); if (e.ButtonID.Equals("users")) { pnlManageCR.Visible = false; pnlusers.Visible = true; } } }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { String id = e.ButtonID; switch (id) { case "Delete": this.ASPxGridView1.DeleteRow(e.VisibleIndex); break; case "Edit": this.ASPxGridView1.StartEdit(e.VisibleIndex); break; case "New": this.ASPxGridView1.AddNewRow(); break; //case "Viwe_check": // for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) // { // if (this.ASPxGridView1.Selection.IsRowSelected(i)) // { // DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); // Session["Checkid"] = checkinfo.Row.ItemArray[0]; // } // } // break; //case "Download": // for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) // { // if (this.ASPxGridView1.Selection.IsRowSelected(i)) // { // DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); // String path = checkinfo.Row.ItemArray[5].ToString(); // path = path.Replace("H:/MRI_Data", ""); // //path.Split(' '); // String[] paths = path.Split('/'); // Session["root"] = paths[0]; // path = path + "/"; // Session["path"] = path; // } // } // break; } }
protected void ASPxGridViewOder_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { int ID_SELECTED = int.Parse(ASPxGridViewOder.GetRowValues(e.VisibleIndex, ASPxGridViewOder.KeyFieldName).ToString()); hdProduct.Value = ID_SELECTED.ToString(); if (e.ButtonID == "GridEdit") { pnEdit.Visible = true; } else if (e.ButtonID == "GridDel") { Response.Redirect("User.aspx"); } }
protected void GridView_Beneficiarios_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { try { if (e.ButtonID == "Lotes") { Session["IdBeneficiario"] = GridView_Beneficiarios.GetRowValues(e.VisibleIndex, "IdBeneficiario"); ASPxPopup_LotesAsignados.ShowOnPageLoad = true; } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void GridView_Ubicaciones_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { try { if (e.ButtonID == "Bloques") { Session["IdUbicacion"] = GridView_Ubicaciones.GetRowValues(e.VisibleIndex, "IdUbicacion"); ASPxPopup_Bloques.ShowOnPageLoad = true; } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnView") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView1.GetDataRow(Gid); int id = Convert.ToInt32(dr["ID"].ToString()); Response.Redirect("~/Inventory/ViewSupplier.aspx?id=" + id); } if (e.ButtonID == "btnActive") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView1.GetDataRow(Gid); int id = Convert.ToInt32(dr["ID"].ToString()); new ClsSupplier().Active(id); Response.Redirect(Request.Url.AbsoluteUri); } }
protected void UserGridView_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { try { securityAgent = new CryptoProvider(); DBAgent = new DataAccessProvider(DataAccessProvider.ParamType.ServerCredentials, ConfigurationManager.AppSettings["DBServerName"], ConfigurationManager.AppSettings["DBUserName"], ConfigurationManager.AppSettings["DBPassword"]); DBAgent.AddParameter("@ParamLoginID", UserGridView.GetRowValues(e.VisibleIndex, "LoginID")); DBAgent.AddParameter("@ParamNewPassword", securityAgent.GetTemporaryPassword()); DBAgent.AddParameter("@ParamIsTempPassword", 1); DBAgent.AddParameter("@ParamComment", "Password reset by Admin"); DBAgent.ExecuteNonQuery("dbo.spUpdatePassword"); UserGridView.DataBind(); } catch (Exception ex) { CommonHelpers.writeLogToFile("UserGridView_CustomButtonCallback: UserManagement.aspx", ex.Message); } }
protected void dgOrdenesCompra_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { UnidadDeTrabajo wu = new UnidadDeTrabajo(); switch (e.ButtonID) { case "Editar": dgOrdenCompraDetalle.DataSource = wu.OrdenCompraDetalle.ObtenerDetalleOrdenCompra(int.Parse(dgOrdenesCompra.GetRowValues(e.VisibleIndex, "Id").ToString())); dgOrdenCompraDetalle.DataBind(); var ordenCompra = wu.OrdenCompra.ObtenerOrdenCompraPorId(int.Parse(dgOrdenesCompra.GetRowValues(e.VisibleIndex, "Id").ToString())); txtFecha.Text = ordenCompra.Fecha.ToString(); txtProveedor.Text = ordenCompra.RazonSocial; txtEstadoOCD.Text = ordenCompra.Estado; txtDocumentoRef.Text = ordenCompra.DocumentoReferencia; pcEditorOrdenesCompra.ShowOnPageLoad = true; break; case "Anular": OrdenCompra OrdenC_anular = wu.OrdenCompra.ObtenerPorId(int.Parse(dgOrdenesCompra.GetRowValues(e.VisibleIndex, "Id").ToString())); if (OrdenC_anular.IdEstado != 10) { MostrarMensajes("Solo se puede anular una orden de compra que aún no ha sido recepcionada"); } else { OrdenC_anular.IdEstado = 11; wu.OrdenCompra.Actualizar(OrdenC_anular); wu.Grabar(); cargarRecepciones(); } break; case "ViewReport": Session["ItemClickeado"] = "OrdenCompra"; string url = "Reporte.aspx?idoc=" + int.Parse(dgOrdenesCompra.GetRowValues(e.VisibleIndex, "Id").ToString()); Response.Write("<script>window.open('" + url + "','_blank');</script>"); break; } }
protected void griddevice_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (this.griddevice.FocusedRowIndex != -1) { object ID = this.griddevice.GetRowValues(this.griddevice.FocusedRowIndex, "idud"); if (e.ButtonID.Equals("dclose")) { SqlConnection con = new SqlConnection(strcon); String st = "UPDATE tblEntrance SET statusdoor='close' WHERE idud=" + ID; SqlCommand sqlcom = new SqlCommand(st, con); try { con.Open(); sqlcom.ExecuteNonQuery(); con.Close(); griddevice.DataBind(); // ShowPopUpMsg("choose your device please" + "\r\n"); // MessageBox.Show("update successful"); } catch (SqlException ex) { ShowPopUpMsg(ex.ToString() + "\r\n"); //MessageBox.Show(ex.Message); } } if (e.ButtonID.Equals("dopen")) { SqlConnection con = new SqlConnection(strcon); String st = "UPDATE tblEntrance SET statusdoor='open' WHERE idud=" + ID; SqlCommand sqlcom = new SqlCommand(st, con); try { con.Open(); sqlcom.ExecuteNonQuery(); con.Close(); griddevice.DataBind(); // ShowPopUpMsg("choose your device please" + "\r\n"); // MessageBox.Show("update successful"); } catch (SqlException ex) { ShowPopUpMsg(ex.ToString() + "\r\n"); //MessageBox.Show(ex.Message); } } if (e.ButtonID.Equals("erase")) { SqlConnection con = new SqlConnection(strcon); String st = "UPDATE tblEntrance SET statusdoor='' WHERE idud=" + ID; SqlCommand sqlcom = new SqlCommand(st, con); try { con.Open(); sqlcom.ExecuteNonQuery(); con.Close(); griddevice.DataBind(); // ShowPopUpMsg("choose your device please" + "\r\n"); // MessageBox.Show("update successful"); } catch (SqlException ex) { ShowPopUpMsg(ex.ToString() + "\r\n"); //MessageBox.Show(ex.Message); } } } }
protected void ASPxGridView2_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { }