private void ListArtiObra_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { try { ClsArticuloObra CAo = new ClsArticuloObra(); int Ren = 0; string Articulo = ""; //if ((ValAdd == true || Adding == true) || Adding == false) //{ // Ren = Convert.ToInt32(e.Row.Cells[6].Text); //} //else //{ // Ren = Convert.ToInt32(e.Row.Cells[3].Text); //} if (e.Row.Cells[3].Text.ToString() != "0") { Ren = Convert.ToInt32(e.Row.Cells[3].Text); Articulo = Convert.ToString(e.Row.Cells[5].Text); } else { Ren = Convert.ToInt32(e.Row.Cells[6].Text); Articulo = Convert.ToString(e.Row.Cells[7].Text); } //Articulo = Convert.ToString(e.Row.Cells[5].Text); if (e.Row.Cells[11].Activated == true) { CAo.IdArticuloTmp = Ren; DialogResult dr = MessageBox.Show("Estas seguro de borrar el Articulo: " + Articulo.ToString(), "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { //Borro el articulo seleccionado ClsArticuloObra.DeleteTmpArtiObra(CAo); //Llenamos de nuevo el Grid de Articulos que contiene el Kit LTmp = ClsArticuloObra.ListadoTmp(); ListArtiObra.DataSource = LTmp; GridArticulosTmp("E"); } } } catch (Exception EX) { MessageBox.Show(EX.Message.ToString()); } }
private void button1_Click(object sender, EventArgs e) { ClsArticuloObra CAO = new ClsArticuloObra(); try { if (ListArti.Rows.Count == 0) { MessageBox.Show("Debe seleccionar articulos para agregar...", "MENSAJE DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Ctn = Ctn + 1; foreach (Infragistics.Win.UltraWinGrid.UltraGridRow Rn in this.ListArti.Rows) { if (Rn.Cells[11].Value.ToString().ToUpper() == "TRUE") { CAO.IdArticulo = Convert.ToInt32(Rn.Cells[0].Value); CAO.Descripcion = Convert.ToString(Rn.Cells[1].Value); CAO.CantidadArt = Convert.ToDecimal(Rn.Cells[12].Value); ClsArticuloObra.AddArtObraTmp(CAO, 1, 0); } } LTmp = ClsArticuloObra.ListadoTmp(); ListArtiObra.DataSource = LTmp; this.ListArtiObra.Rows.ColumnFilters[4].Column.Header.Caption = "Cantidad"; try { this.ListArtiObra.Rows.Band.Columns.Add("Elim", "Eliminar"); this.ListArtiObra.Rows.ColumnFilters[11].Column.CellAppearance.ImageBackground = SISCOC_FEL.Properties.Resources.delete1; this.ListArtiObra.Rows.ColumnFilters[11].Column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Image; this.ListArtiObra.Rows.ColumnFilters[11].Column.Width = 65; } catch (Exception EX) { } GridArticulosTmp(""); } catch (Exception EX) { MessageBox.Show(EX.Message.ToString()); } }