protected void Guardar(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Add")) { DBConnect conector = new DBConnect(); GridPerifericos(tipo.SelectedValue); } if (e.CommandName.Equals("Desincorpora")) { DBConnect conector = new DBConnect(); Label LblID = (Label)GridView1.Rows[GridView1.SelectedRow.RowIndex].FindControl("LblID") as Label; DDisp.VerEquipos(this, LblID.Text, tipo.SelectedValue, vhidequipo.Value, "2"); GridPerifericos(tipo.SelectedValue); } }
protected void Guardar(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Add")) { string sql = ""; DBConnect conector = new DBConnect(); Label LblID = (Label)GridView1.FooterRow.FindControl("LblID") as Label; TextBox TBXserial = (TextBox)GridView1.FooterRow.FindControl("TBXserial") as TextBox; TextBox TBXnumero = (TextBox)GridView1.FooterRow.FindControl("TBXnumero") as TextBox; TextBox TBXmarca = (TextBox)GridView1.FooterRow.FindControl("TBXmarca") as TextBox; TextBox TBXcapacidad = (TextBox)GridView1.FooterRow.FindControl("TBXcapacidad") as TextBox; DropDownList Dispositivo = (DropDownList)GridView1.FooterRow.Cells[6].FindControl("Dispositivo") as DropDownList; DropDownList Tipo = (DropDownList)GridView1.FooterRow.Cells[7].FindControl("Tipo") as DropDownList; DropDownList capacidadram = (DropDownList)GridView1.FooterRow.Cells[5].FindControl("DDcapacidadram"); DropDownList capacidaddd = (DropDownList)GridView1.FooterRow.Cells[5].FindControl("DDcapacidaddd"); if ((Dispositivo.SelectedValue == "7") || (Dispositivo.SelectedValue == "9")) { if (Dispositivo.SelectedValue == "7") { sql = conector.IDispositivo(vhequipo.Value + conector.Uid_temp(), TBXserial.Text, TBXmarca.Text, TBXnumero.Text, Tipo.SelectedValue, capacidaddd.SelectedItem.Text, Dispositivo.SelectedValue, vhequipo.Value, capacidaddd.SelectedValue); } if (Dispositivo.SelectedValue == "9") { sql = conector.IDispositivo(vhequipo.Value + conector.Uid_temp(), TBXserial.Text, TBXmarca.Text, TBXnumero.Text, Tipo.SelectedValue, capacidadram.SelectedItem.Text, Dispositivo.SelectedValue, vhequipo.Value, capacidadram.SelectedValue); } } else { sql = conector.IDispositivo(vhequipo.Value + conector.Uid_temp(), TBXserial.Text, TBXmarca.Text, TBXnumero.Text, Tipo.SelectedValue, TBXcapacidad.Text, Dispositivo.SelectedValue, vhequipo.Value, "0"); } FillCustomerInGrid(); } if (e.CommandName.Equals("Cambio")) { DBConnect conector = new DBConnect(); Label LblID = (Label)GridView1.Rows[GridView1.SelectedRow.RowIndex].FindControl("LblID") as Label; Label Lbltdispositivo = (Label)GridView1.Rows[GridView1.SelectedRow.RowIndex].FindControl("Lbltdispositivo"); VerCambio.VerEquipos(this, LblID.Text, Lbltdispositivo.Text, vhequipo.Value); FillCustomerInGrid(); } if (e.CommandName.Equals("Desincorpora")) { DBConnect conector = new DBConnect(); Label LblID = (Label)GridView1.Rows[GridView1.SelectedRow.RowIndex].FindControl("LblID") as Label; Label Lbltdispositivo = (Label)GridView1.Rows[GridView1.SelectedRow.RowIndex].FindControl("Lbltdispositivo"); DDisp.VerEquipos(this, LblID.Text, Lbltdispositivo.Text, vhequipo.Value, "1"); FillCustomerInGrid(); } // if (e.CommandName.Equals("Cancelar")) { GridView1.FooterRow.Visible = false; } }