private void ubNuevoServicio_Click(object sender, EventArgs e) { FrmOrdenProducciondeServicio AgregarServicio = new FrmOrdenProducciondeServicio(); ItemOrdenProduccionServicio item = AgregarServicio.ObtenerServicio(OrdenProduccion, ItemOrdenProduccion); if (item != null) { UltraGridRow Row = ugServicios.DisplayLayout.Bands[0].AddNew(); Row.Tag = item; Row.Cells[colServicio].Activate(); ugServicios.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode); ItemOrdenProduccion.Servicios.Add(item); MostrarTotalServicio(ItemOrdenProduccion); MostrarServicio(Row); } }
private void ModificarServicio() { if (ugServicios.ActiveRow != null) { ItemOrdenProduccionServicio ItemOrdenProduccionServicio = (ItemOrdenProduccionServicio)ugServicios.ActiveRow.Tag; FrmOrdenProducciondeServicio AgregarServicio = new FrmOrdenProducciondeServicio(OrdenProduccion, ItemOrdenProduccionServicio, ItemOrdenProduccion); ItemOrdenProduccionServicio item = AgregarServicio.ObtenerServicio(OrdenProduccion, ItemOrdenProduccion); if (item != null) { ugServicios.ActiveRow.Tag = item; ugServicios.ActiveRow.Cells[colServicio].Activate(); MostrarServicio(ugServicios.ActiveRow); } } else { Exception ex = new Exception("Debe seleccionar un servicio para poder modificar"); Soft.Exceptions.SoftException.ShowException(ex); } }