public void Nuevo() { try { if (!isMViewShow) { MView = new CAJ007ExportacionBancosMView(); MView.Presenter = this; MView.LoadView(); } MView.ClearItem(); this.Item = new Planillas(); this.Item.EMPR_Codigo = Controls.Entorno.ItemEmpresa.EMPR_Codigo; this.Item.SetEstado(Planillas.Estado.Ingresado); this.Item.SetTipoPlanilla(TPlanilla); this.Item.AUDI_UsrCrea = Session.UserName; this.Item.AUDI_FecCrea = Session.Fecha; this.Item.Instance = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Added; this.Item.TPlanilla = TPlanilla; MView.SetItem(); isMViewShow = true; if (LView != null) { ((CAJ007ExportacionBancosMView)MView).Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap)LView.IconView).GetHicon()); } ((CAJ007ExportacionBancosMView)MView).Show(); ((CAJ007ExportacionBancosMView)MView).BringToFront(); } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, Infrastructure.Aspect.Constants.Mensajes.NewPresenter, ex); } }
public void Editar() { try { if (!isMViewShow) { MView = new CAJ007ExportacionBancosMView(); MView.Presenter = this; MView.LoadView(); } Item = Client.GetOnePlanillas(Delfin.Controls.Entorno.ItemEmpresa.EMPR_Codigo, Item.PLAN_Tipo, Item.PLAN_Codigo); if (Item != null) { MView.ClearItem(); this.Item.AUDI_UsrMod = Session.UserName; this.Item.AUDI_FecMod = Session.Fecha; this.Item.Instance = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Modified; this.Item.TPlanilla = TPlanilla; MView.SetItem(); MView.SetEnabled(false); MView.SetEnabledEdit(false); MView.ShowItems(); isMViewShow = true; if (LView != null) { ((CAJ007ExportacionBancosMView)MView).Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap)LView.IconView).GetHicon()); } ((CAJ007ExportacionBancosMView)MView).Show(); ((CAJ007ExportacionBancosMView)MView).BringToFront(); } else { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeInformacion(Title, "Debe seleccionar un elemento de la grilla"); } } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, Infrastructure.Aspect.Constants.Mensajes.EditPresenter, ex); } }