Exemple #1
0
        public long Insertar(MotivoBajaDTO dto)
        {
            using (var context = new ModeloXCommerceContainer())
            {
                var motivoBajaNuevo = new AccesoDatos.MotivoBaja
                {
                    Descripcion = dto.Descripcion
                };

                context.MotivosBajas.Add(motivoBajaNuevo);

                context.SaveChanges();

                return(motivoBajaNuevo.Id);
            }
        }
Exemple #2
0
        /*public override void CargarDatos(long? entidadId)
         * {
         *  if (!entidadId.HasValue)
         *  {
         *      MessageBox.Show(@"Ocurrio un Error Grave", @"Error Grave", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         *
         *      this.Close();
         *  }
         *
         *  if (TipoOperacion == TipoOperacion.Eliminar)
         *  {
         *      btnLimpiar.Enabled = false;
         *  }
         *
         *  var provincia = _motivoBajaServicio.ObtenerPorId(entidadId.Value);
         *
         * }*/

        public override bool EjecutarComandoNuevo()
        {
            if (!VerificarDatosObligatorios())
            {
                MessageBox.Show(@"Por favor ingrese los campos Obligatorios.", @"Atención", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return(false);
            }

            var motivoBajaNuevo = new MotivoBajaDTO
            {
                Descripcion = txtMotivoBaja.Text,
            };

            _motivoBajaServicio.Insertar(motivoBajaNuevo);
            return(true);
        }