protected void GridViewdetalle_RowEditing(object sender, GridViewEditEventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); DataTable dt1 = Session["Tabla"] as DataTable; GridViewdetalle.EditIndex = e.NewEditIndex; Session["Tabla"] = dt1; GridViewdetalle.DataSource = dt1; GridViewdetalle.DataBind(); }
protected void GridViewdetalle_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); DataTable dt1 = Session["Tabla"] as DataTable; GridViewdetalle.EditIndex = -1; Session["Tabla"] = dt1; GridViewdetalle.DataSource = dt1; GridViewdetalle.DataBind(); //Bind data to the GridView control. }
protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); int index = Convert.ToInt32(e.RowIndex); DataTable dt1 = Session["Tabla"] as DataTable; dt1.Rows[index].Delete(); Session["Tabla"] = dt1; GridViewdetalle.DataSource = dt1; GridViewdetalle.DataBind(); }
public void nuevonumeroacta(object sender, EventArgs e) { nuevo(); observatxt.Value = ""; table = (System.Data.DataTable)(Session["Tabla"]); DataTable dt1 = Session["Tabla"] as DataTable; dt1.Rows.Clear(); Session["Tabla"] = dt1; GridViewdetalle.DataSource = dt1; GridViewdetalle.DataBind(); }
protected void agregarow(object sender, EventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = Selectarticulo.Value; row["Detalle"] = txtobserva.Value.ToUpper().Trim(); row["Destino"] = txtdestino.Value.ToUpper().Trim(); table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); nuevo(); txtobserva.Value = ""; }
protected void agregarow(object sender, EventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = SelectEmployeeDelivery.Value; row["Observacion"] = SelectEmployeeReceives.Value.ToUpper(); table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; //This code allows the user to edit the information in the DataGrid. }
protected void agregarow(object sender, EventArgs e) { if (Selectarticulo.Visible == false) { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = clasetrabajo.Value; row["Tipo_Mant"] = SelecttipoMant.Value; row["Detalle"] = txtobserva.Value.ToUpper().Trim(); row["$_Mano_Obra"] = valorManObra.Value.Trim(); row["Repuestos"] = txtRepuestos.Value.ToUpper().Trim(); row["#_Externo"] = Textnumeroexterno.Value.ToUpper().Trim(); row["Garantia"] = Textgarantia.Value.ToUpper().Trim(); row["$_Repuestos"] = V_repuestos.Value.Trim(); row["Clase_M"] = clasetrabajo.Value.Trim(); table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); nuevo(); txtobserva.Value = ""; valorManObra.Value = "0"; txtRepuestos.Value = ""; Textnumeroexterno.Value = ""; V_repuestos.Value = "0"; } else { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = Selectarticulo.Value; row["Tipo_Mant"] = SelecttipoMant.Value; row["Detalle"] = txtobserva.Value.ToUpper(); row["$_Mano_Obra"] = valorManObra.Value.Trim(); row["Repuestos"] = txtRepuestos.Value.ToUpper(); row["#_Externo"] = Textnumeroexterno.Value.ToUpper().Trim(); row["Garantia"] = Textgarantia.Value.ToUpper().Trim(); row["$_Repuestos"] = V_repuestos.Value.Trim(); row["Clase_M"] = clasetrabajo.Value.Trim(); table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; nuevo(); } }
protected void agregarow(object sender, EventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = Selectarticulo.Value; row["Cantidad"] = canti.Value; row["Observacion"] = observatxt.Value.ToUpper(); table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; //This code allows the user to edit the information in the DataGrid. nuevo(); }
protected void GridViewdetalle_RowUpdating(object sender, GridViewUpdateEventArgs e) { table = (System.Data.DataTable)(Session["Tabla"]); DataTable dt1 = Session["Tabla"] as DataTable; //Update the values. GridViewRow row = GridViewdetalle.Rows[e.RowIndex]; dt1.Rows[row.DataItemIndex]["Serial_Nombre"] = ((TextBox)(row.Cells[2].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["Tipo_Mant"] = ((TextBox)(row.Cells[3].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["Detalle"] = ((TextBox)(row.Cells[4].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["$_Mano_Obra"] = ((TextBox)(row.Cells[5].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["Repuestos"] = ((TextBox)(row.Cells[6].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["#_Externo"] = ((TextBox)(row.Cells[7].Controls[0])).Text; dt1.Rows[row.DataItemIndex]["$_Repuestos"] = ((TextBox)(row.Cells[8].Controls[0])).Text; //Reset the edit index. GridViewdetalle.DataSource = dt1; GridViewdetalle.EditIndex = -1; GridViewdetalle.DataBind(); }
protected void GridDelivery_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow gr = GridDelivery.SelectedRow; string serial = Page.Server.HtmlDecode(gr.Cells[2].Text); string observa = Page.Server.HtmlDecode(gr.Cells[3].Text); table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = serial; row["Observacion"] = observa; table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; }
public void nuevonumeroacta(object sender, EventArgs e) { nuevo(); SelectProveedor.Value = "QUIEN REALIZA MANTENIMIENTO"; OBSERVACIONG.Value = ""; Selectarticulo.Value = "SELECCIONE ARTICULO"; valorManObra.Value = "0"; txtRepuestos.Value = ""; V_repuestos.Value = "0"; table = (System.Data.DataTable)(Session["Tabla"]); DataTable dt1 = Session["Tabla"] as DataTable; dt1.Rows.Clear(); Session["Tabla"] = dt1; GridViewdetalle.DataSource = dt1; GridViewdetalle.DataBind(); }
public void cargarinfo() { try { String bd = Session["BD"].ToString(); var registrosm = Controlasql.CtraeIncapacidad(bd); if (registrosm.Tables[0].Rows.Count > 0) { GridViewdetalle.DataSource = registrosm; GridViewdetalle.DataBind(); } else { GridViewdetalle.DataSource = null; GridViewdetalle.DataBind(); } } catch (Exception) { throw; } }
public void cargarInfo() { try { String bd = Session["BD"].ToString(); var registrosm = Controlasql.ctraeactaeditar(txtidacta.Value, bd); if (registrosm.Tables[0].Rows.Count > 0) { DataTable dt1 = Session["Tabla"] as DataTable; Session["Tabla"] = registrosm; GridViewdetalle.DataSource = registrosm; GridViewdetalle.DataBind(); } else { GridViewdetalle.DataSource = null; GridViewdetalle.DataBind(); } } catch (Exception) { } }
protected void btninsertar_Click(object sender, EventArgs e) { if (Selectarticulo.Visible == false) { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = clasetrabajo.Value; row["Tipo_Mant"] = SelecttipoMant.Value; row["Detalle"] = txtobserva.Value.ToUpper(); row["Repuesto"] = txtRepuestos.Value.ToUpper(); row["Garantia"] = Textgarantia.Value; table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; } else { table = (System.Data.DataTable)(Session["Tabla"]); row = table.NewRow(); row["Serial_Nombre"] = Selectarticulo.Value; row["Tipo_Mant"] = SelecttipoMant.Value; row["Detalle"] = txtobserva.Value.ToUpper(); row["Repuesto"] = txtRepuestos.Value.ToUpper(); row["Garantia"] = Textgarantia.Value; table.Rows.Add(row); GridViewdetalle.DataSource = table; GridViewdetalle.DataBind(); Session.Add("Tabla", table); GridViewdetalle.EditIndex = -1; } //This code allows the user to edit the information in the DataGrid. }
protected void listausuarios_Click(object sender, EventArgs e) { try { String bd = Session["BD"].ToString(); var registros = Controlasql.Clistausuarios(bd); if (registros.Tables[0].Rows.Count > 0) { GridViewdetalle.DataSource = registros; GridViewdetalle.DataBind(); bloqueaitems(); } else { GridViewdetalle.DataSource = null; GridViewdetalle.DataBind(); } } catch (Exception ex) { alerta.MessageBox(this, $"{ex}"); // Response.Redirect("Exceptionnet.aspx"); } }