Esempio n. 1
0
        private void btnAgregarNuevoRelacionado_Click(object sender, EventArgs e)
        {
            try
            {
                if (
                    Infrastructure.WinForms.Controls.Dialogos.MostrarMensajePregunta(Presenter.Title,
                                                                                     "¿Desea Agregar un nuevo registro Entidad?", Infrastructure.WinForms.Controls.Dialogos.LabelBoton.Si_No) ==
                    System.Windows.Forms.DialogResult.Yes)
                {
                    MAN009MView     MAN009_mview_sinlv;
                    MAN009Presenter MAN009_presenter_sinlv;
                    MAN009_mview_sinlv               = new MAN009MView();
                    MAN009_presenter_sinlv           = new MAN009Presenter(Presenter.ContainerService, MAN009_mview_sinlv, (cmbTIPE_CodHijo.SelectedItem as Entities.TiposEntidad).TIPE_Codigo);
                    MAN009_mview_sinlv.Presenter     = MAN009_presenter_sinlv;
                    MAN009_presenter_sinlv.lsinlview = true;
                    MAN009_presenter_sinlv.tipe_Desc =
                        Delfin.Controls.EntidadClear.getDescTipoEntidad(
                            (cmbTIPE_CodHijo.SelectedItem as Entities.TiposEntidad).TIPE_Codigo);
                    MAN009_presenter_sinlv.Load();

                    MAN009_presenter_sinlv.Nuevo();
                    this.Entidad = MAN009_presenter_sinlv.Item;
                    txaENTC_CodHijo.SetEntidad(this.Entidad);
                }
            }
            catch (Exception ex)
            { Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error inicializando el control de Nuevo Contactos.", ex); }
        }
Esempio n. 2
0
        public void Contacto(Boolean Nuevo)
        {
            try
            {
                MAN009MView     MAN009_mview_sinlv;
                MAN009Presenter MAN009_presenter_sinlv;
                MAN009_mview_sinlv               = new MAN009MView();
                MAN009_presenter_sinlv           = new MAN009Presenter(ContainerService, MAN009_mview_sinlv, Delfin.Controls.EntidadClear.TIPE_Contacto);
                MAN009_mview_sinlv.Presenter     = MAN009_presenter_sinlv;
                MAN009_presenter_sinlv.lsinlview = true;
                MAN009_presenter_sinlv.tipe_Desc = "Contacto";
                MAN009_presenter_sinlv.Load();


                Entities.Entidad _prospecto = Client.GetOneEntidad(Item.ENTC_CodCliente, Delfin.Controls.EntidadClear.GetCodigoTipoEntidad(Controls.TiposEntidad.TIPE_Cliente));
                if (Nuevo)
                {
                    if (MAN009_presenter_sinlv.Nuevo() != System.Windows.Forms.DialogResult.Cancel)
                    {
                        if (Item.CONS_CodRGM == "001") //Importaciones
                        {
                            _prospecto.AUDI_UsrMod = Session.UserName;
                            _prospecto.AUDI_FecMod = Session.Fecha;
                            _prospecto.Instance    = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Modified;

                            _prospecto.ContactoImpo             = MAN009_presenter_sinlv.Item;
                            _prospecto.ContactoImpo.AUDI_UsrMod = Session.UserName;
                            _prospecto.ContactoImpo.AUDI_FecMod = Session.Fecha;
                            _prospecto.ContactoImpo.Instance    = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Added;


                            Client.SaveEntidad(_prospecto);
                            Item.ItemContacto = MAN009_presenter_sinlv.Item;
                        }
                        else if (Item.CONS_CodRGM == "002") //Exportaciones
                        {
                            _prospecto.AUDI_UsrMod = Session.UserName;
                            _prospecto.AUDI_FecMod = Session.Fecha;
                            _prospecto.Instance    = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Modified;

                            _prospecto.ContactoExpo             = MAN009_presenter_sinlv.Item;
                            _prospecto.ContactoExpo.AUDI_UsrMod = Session.UserName;
                            _prospecto.ContactoExpo.AUDI_FecMod = Session.Fecha;
                            _prospecto.ContactoExpo.Instance    = Infrastructure.Aspect.BusinessEntity.InstanceEntity.Added;

                            Client.SaveEntidad(_prospecto);
                            Item.ItemContacto = MAN009_presenter_sinlv.Item;
                        }
                    }
                }
                else
                {
                    MAN009_presenter_sinlv.Item = Item.ItemContacto;
                    if (MAN009_presenter_sinlv.Editar() != System.Windows.Forms.DialogResult.Cancel)
                    {
                        Item.ItemContacto = MAN009_presenter_sinlv.Item;
                    }
                }

                LView.SetItemContacto();
            }
            catch (Exception)
            { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Title, "Ha ocurrido un error al registrar el contacto"); }
        }