コード例 #1
0
        public string String()
        {
            string texto = Desarrollador + ",";

            if (Titulo.Contains(','))
            {
                texto += "\"" + Titulo + "\"" + ",";
            }
            else
            {
                texto += Titulo + ",";
            }
            if (Descripcion.Contains(','))
            {
                texto += "\"" + Descripcion + "\"" + ",";
            }
            else
            {
                texto += Descripcion + ",";
            }
            if (Proyecto.Contains(','))
            {
                texto += "\"" + Proyecto + "\"" + ",";
            }
            else
            {
                texto += Proyecto + ",";
            }
            texto += Entrega.ToString("dd/MM/yyyy") + ",";
            texto += Prioridad.ToString();
            return(texto);
        }
コード例 #2
0
        /// <summary>
        /// Propósito: Método Insertar de la clase de negocios. Este método inserta una fila nueva en la base de datos.
        /// </summary>
        /// <returns>True si tuvo éxito, sino genera una Exception. </returns>
        /// <remarks>
        /// Propiedades necesarias para este método:
        /// <UL>
        ///		 <LI>Nom_Servicio</LI>
        ///		 <LI>Descripcion</LI>
        ///		 <LI>FK_IdCategoriaServicio</LI>
        ///		 <LI>FK_IdTipoServicio</LI>
        ///		 <LI>FK_IdPersona</LI>
        /// </UL>
        /// Propiedades actualizadas luego de una llamada exitosa a este método:
        /// <UL>
        ///		 <LI>Id_Servicio</LI>
        ///		 <LI>CodError</LI>
        /// </UL>
        /// </remarks>
        public override bool Insertar()
        {
            string operacion;

            //SeguridadSoapClient wsseg = new SeguridadSoapClient();
            try
            {
                //Construir aqui el string a guardar en la bitacora.
                operacion = "Insertar cIATServicio;"
                            + "Nom_Servicio:" + Nom_Servicio.ToString() + ";"
                            + "Descripcion:" + Descripcion.ToString() + ";"
                            + "FK_IdCategoriaServicio:" + FK_IdCategoriaServicio.ToString() + ";"
                            + "FK_IdTipoServicio:" + FK_IdTipoServicio.ToString() + ";"
                            + "FK_IdPersona:" + FK_IdPersona.ToString() + ";";
                //wsseg.BitacoraRegistrarUso(_COD_APLICACIONBitacora, _COD_FUNCIONALIDADBitacora, _COD_SEDEBitacora, eTipoEventoBitacora.UsoFuncionalidad, _ID_USUARIOBitacora,operacion);
                return(base.Insertar());
            }
            catch (Exception ex)
            {
                //Construir el string a guardar en la bitácora en caso de error.
                operacion = "Error Insertar cIATServicio;" + ex.Message;
                //wsseg.BitacoraRegistrarUso(_COD_APLICACIONBitacora, _COD_FUNCIONALIDADBitacora, _COD_SEDEBitacora, eTipoEventoBitacora.Error, _ID_USUARIOBitacora,operacion);
                throw ex;
            }
        }
コード例 #3
0
 public override void Validar()
 {
     if (Descripcion.Trim().Length == 0)
     {
         throw new ApplicationException("Debe ingresar razón social.");
     }
 }
コード例 #4
0
        public async Task <ActionResult <Descripcion> > PostDescripcion(Descripcion descripcion)
        {
            _context.Descripcion.Add(descripcion);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDescripcion", new { id = descripcion.Id }, descripcion));
        }
コード例 #5
0
ファイル: Referencias.cs プロジェクト: carloshrs/tyg
        public int Crear()
        {
            OdbcConnection oConnection = this.OpenConnection();

            String strSQL = "Insert into Referencias (idCliente, Estado, Descripcion, Observaciones, Path, isFile, FechaCarga, idUsuario, UsuarioCliente ";

            strSQL = strSQL + ") values (" + intIdCliente + "," + intEstado;
            strSQL = strSQL + ",'" + Descripcion.Replace("'", "''").ToUpper() + "','" + Observaciones.Replace("'", "''").ToUpper() + "','" + Path + "'," + isFile;
            strSQL = strSQL + ", getdate()," + intIdUsuario + ",'" + UsuarioCliente + "')";

            String strMaxID = "SELECT MAX(idReferencia) as MaxId FROM Referencias";
            int    MaxID    = 0;

            try
            {
                OdbcCommand myCommand = new OdbcCommand(strSQL, oConnection);
                myCommand.ExecuteNonQuery();

                MaxID = ObtenerMaxID(strMaxID, oConnection);

                String strAuditoria = "INSERT INTO HistoricoAcciones (idCliente, idUsuario, Instante, Evento, Observaciones, idTipoObjeto, idEstado, idReferencia) VALUES (";
                strAuditoria = strAuditoria + intIdCliente + "," + intIdUsuario + ", getdate(), 'Solicitud de Referencia', 'Solicitud de Referencia', 3, 1," + MaxID.ToString() + ")";

                myCommand = new OdbcCommand(strAuditoria, oConnection);
                myCommand.ExecuteNonQuery();
                oConnection.Close();
            }
            catch (Exception e)
            {
                string p = e.Message;
            }
            return(MaxID);
        }
コード例 #6
0
ファイル: Referencias.cs プロジェクト: carloshrs/tyg
        public bool Modificar(int IdReferencia)
        {
            OdbcConnection oConnection = this.OpenConnection();

            String strSQL = "UPDATE Referencias SET ";

            strSQL = strSQL + "idCliente = " + IdCliente.ToString() + ",";
            strSQL = strSQL + "Estado = " + Estado.ToString() + ",";
            strSQL = strSQL + "Descripcion  = '" + Descripcion.Replace("'", "''").ToUpper() + "',";
            strSQL = strSQL + "UsuarioCliente  = '" + UsuarioCliente + "',";
            strSQL = strSQL + "Observaciones = '" + Observaciones.Replace("'", "''").ToUpper() + "'";
            strSQL = strSQL + " WHERE IdReferencia=" + IdReferencia.ToString();

            try
            {
                OdbcCommand myCommand = new OdbcCommand(strSQL, oConnection);
                myCommand.ExecuteNonQuery();

                String strAuditoria = "INSERT INTO HistoricoAcciones (idCliente, idUsuario, Instante, Evento, Observaciones, idTipoObjeto, idEstado, idReferencia) VALUES (";
                strAuditoria = strAuditoria + intIdCliente + "," + intIdUsuario + ", getdate(), 'Modificación de Referencia', 'Modificación de la Referencia Nro. " + IdReferencia.ToString() + "', 3, 1," + IdReferencia.ToString() + ")";

                myCommand = new OdbcCommand(strAuditoria, oConnection);
                myCommand.ExecuteNonQuery();
                oConnection.Close();
            }
            catch (Exception e)
            {
                string p = e.Message;
                return(false);
            }
            return(true);
        }
コード例 #7
0
        public async Task <IActionResult> PutDescripcion(int id, Descripcion descripcion)
        {
            if (id != descripcion.Id)
            {
                return(BadRequest());
            }

            _context.Entry(descripcion).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DescripcionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #8
0
        public bool Validar()
        {
            bool paso = true;

            ErrorProvider.Clear();
            if (string.IsNullOrWhiteSpace(Descripcion.Text))
            {
                ErrorProvider.SetError(Descripcion, "No puede guardar espacios en blanco");
                Descripcion.Focus();
                paso = false;
            }
            if (Descripcion.Text == string.Empty)
            {
                ErrorProvider.SetError(Descripcion, "El campo descroipcion no puede esta vacio");
                Descripcion.Focus();
                paso = false;
            }
            if (Credito.Value < 0)
            {
                ErrorProvider.SetError(Credito, "No puede existir credito menor que 0");
                Credito.Focus();
                paso = false;
            }
            return(paso);
        }
コード例 #9
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (FechaCreacion != null)
         {
             hashCode = hashCode * 59 + FechaCreacion.GetHashCode();
         }
         if (Descripcion != null)
         {
             hashCode = hashCode * 59 + Descripcion.GetHashCode();
         }
         if (IndFinalizada != null)
         {
             hashCode = hashCode * 59 + IndFinalizada.GetHashCode();
         }
         if (FechaVencimiento != null)
         {
             hashCode = hashCode * 59 + FechaVencimiento.GetHashCode();
         }
         if (Usuario != null)
         {
             hashCode = hashCode * 59 + Usuario.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #10
0
 public virtual void Validar()
 {
     if (Descripcion.Trim().Length == 0)
     {
         throw new ApplicationException("Debe ingresar descripción.");
     }
 }
コード例 #11
0
 public void ActualizarEntidad(Entity modificar)
 {
     modificar.Numero      = Numero.Trim();
     modificar.Descripcion = Descripcion.Trim();
     modificar.Fecha       = Fecha;
     modificar.Activo      = Activo;
 }
コード例 #12
0
 public void ActualizarEntidad(Entity modificar)
 {
     modificar.Longitud    = Longitud;
     modificar.Latitud     = Latitud;
     modificar.Descripcion = Descripcion.Trim();
     modificar.Fecha       = Fecha;
     modificar.Activo      = Activo;
 }
コード例 #13
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (Descripcion != null ? Descripcion.GetHashCode() : 0);
         return(result);
     }
 }
コード例 #14
0
        /// <summary>
        /// Metodo GetHashCode sobreescrito para el Equals.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int num    = 31;
            int result = 1;

            result = num * result + ((NombreArticulo == null) ? 0 : NombreArticulo.GetHashCode());
            result = num * result + ((Descripcion == null) ? 0 : Descripcion.GetHashCode());
            return(result);
        }
コード例 #15
0
ファイル: Modelo.cs プロジェクト: elduende/MarcaModelo
 public override int GetHashCode()
 {
     unchecked
     {
         var result = (Marca != null ? Marca.GetHashCode() : 0);
         result = (result * 397) ^ (Descripcion != null ? Descripcion.GetHashCode() : 0);
         return(result);
     }
 }
コード例 #16
0
        private bool Validacion()
        {
            if (Descripcion.Text.Length == 0)
            {
                MessageBox.Show("Debes Digitar un Nombre de Articulo");
                Descripcion.Focus();
                return(false);
            }

            return(true);
        }
コード例 #17
0
        public virtual int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            var tanque = obj as Tanque;

            return(tanque == null ? 1 : Descripcion.CompareTo(tanque.Descripcion));
        }
コード例 #18
0
ファイル: Form1.cs プロジェクト: Joelyn056/REGISTRO
        private Descripcion LlenaClase()
        {
            Descripcion libro = new Descripcion();

            libro.LibroId     = (int)numericUpDown1.Value;
            libro.Descripcion = textBox1.Text;
            libro.Sigla       = textBox2.Text;
            //libro.TipoId = comboBox2.SelectedItem.ToString();

            return(libro);
        }
コード例 #19
0
ファイル: orden.cs プロジェクト: BerthaVilleda/animales
    public void AgregarPelicula(Pelicula pelicula)
    {
        int nuevoCodigo = ListaDescripcion.Count + 1;
        int cantidad    = 1;

        Descripcion o = new Descripcion(nuevoCodigo, 1, pelicula);

        ListaDescripcion.Add(o);

        Subtotal += cantidad * pelicula.Precio;
        Impuesto  = Subtotal * 0.15;
        Total     = Subtotal + Impuesto;
    }
コード例 #20
0
 private void HabilitarCajas(bool habilitadas)
 {
     NombreMedicamento.Clear();
     Descripcion.Clear();
     PrecioCompra.Clear();
     PrecioVenta.Clear();
     Presentacion.Clear();
     NombreMedicamento.IsEnabled = habilitadas;
     Descripcion.IsEnabled       = habilitadas;
     PrecioCompra.IsEnabled      = habilitadas;
     PrecioVenta.IsEnabled       = habilitadas;
     Presentacion.IsEnabled      = habilitadas;
 }
コード例 #21
0
 private void ValidarDatos()
 {
     _errores.Clear();
     Descripcion = Descripcion.Trim();
     if (Descripcion.Equals(string.Empty))
     {
         _errores.Add(new ItemDatasetError("Tipo de Ajuste", "Descripcion", "El campo no puede estar vacío"));
     }
     if (IdEstadoDeStock.Equals(string.Empty))
     {
         _errores.Add(new ItemDatasetError("Tipo de Ajuste", "Estado de Stock", "El campo no puede estar vacío"));
     }
 }
コード例 #22
0
        private bool Validar()
        {
            bool paso = true;

            ErrorProvider.Clear();

            if (Descripcion.Text == string.Empty)
            {
                ErrorProvider.SetError(Descripcion, "El campo Nombre no puede estar vacio");
                Descripcion.Focus();
                paso = false;
            }
            return(paso);
        }
コード例 #23
0
        protected async void EjecutarComprarProducto()
        {
            Compra compra = new Compra(Descripcion, Cantidad);

            if (Descripcion != null && Cantidad > 0 && !Descripcion.Equals("") && !Cantidad.Equals(""))
            {
                await App.Database.ComprarProductoAsync(productoAux.Id, compra);
            }
            else
            {
                await _pageDialogService.DisplayAlertAsync(AppResources.EtiquetaError, AppResources.ErrorCantidad, AppResources.EtiquetaOk);
            }
            await NavigationService.GoBackAsync();
        }
コード例 #24
0
        public Tarea(string plantilla, string creadoPor, DateTime fechaCreacion, params string[][] parametros)
        {
            try
            {
                var xmlConfiguration = new XmlDocument();

                var configFileInfo = new FileInfo(plantilla);

                //if (!configFileInfo.Exists)
                //    throw new Exception($"El archivo no existe {plantilla}");

                if (configFileInfo.Exists)
                {
                    xmlConfiguration.Load(configFileInfo.FullName);

                    // subject
                    var xpath    = @"task/subject";
                    var nSubject = xmlConfiguration.SelectSingleNode(xpath);

                    if (nSubject == null)
                    {
                        throw new Exception($"Seccion {xpath} no existe");
                    }
                    xpath = @"task/description";

                    var nDescription = xmlConfiguration.SelectSingleNode(xpath);

                    Asunto        = nSubject.InnerText;
                    Descripcion   = nDescription.InnerText;
                    CreadoPor     = creadoPor;
                    FechaCreacion = fechaCreacion;

                    if (parametros == null)
                    {
                        return;
                    }

                    foreach (var paramKey in parametros)
                    {
                        var paramValue = paramKey[1];
                        Asunto      = Asunto.Replace(paramKey[0], paramValue);
                        Descripcion = Descripcion.Replace(paramKey[0], paramValue);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #25
0
ファイル: GolfJornada.cs プロジェクト: rickyasg/ProyectoX
        private bool ExecuteTransaction(string psName)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            if (psName == "[golf].[pUpJornada]")
            {
                ps.Add(new SqlParameter("JornadaId", JornadaId));
            }
            ps.Add(new SqlParameter("Fecha", Fecha));
            ps.Add(new SqlParameter("EventoDeportivoId", EventoDeportivoId));
            ps.Add(new SqlParameter("Descripcion", Descripcion.ToUpper()));
            ps.Add(new SqlParameter("NombreCorto", NombreCorto.ToUpper()));
            ps.Add(new SqlParameter("UsuarioId", UsuarioId));
            db.ExecStoreProcedure(psName, ps);
            return(db.RowAffected > 0);
        }
コード例 #26
0
ファイル: Funcion.cs プロジェクト: jesumarquez/lt
        public virtual int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            var funcion = obj as Funcion;

            if (funcion == null)
            {
                return(1);
            }

            var order = Sistema.CompareTo(funcion.Sistema);

            return(!order.Equals(0) ? order : Descripcion.CompareTo(funcion.Descripcion));
        }
コード例 #27
0
        //METODO QUE VALIDA EL OBJETO Coeficiente (VALOR DE PROPIEDADES CARGADAS). N.
        public string[] cValidaCoeficiente()
        {
            string[] mValida   = new string[4];
            int      cantError = 0;

            //VALIDAR Coeficiente
            if (string.IsNullOrEmpty(Descripcion.ToString()))
            {
                mValida[cantError] = "EL CAMPO 'DESCRIPCION' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (Descripcion == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO 'DESCRIPCION'";
                cantError         += 1;
            }

            //VALIDAR Sucursal
            if (string.IsNullOrEmpty(Sucursal.ToString()))
            {
                mValida[cantError] = "EL CAMPO 'SUCURSAL $' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (Sucursal == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO 'SUCURSAL $'";
                cantError         += 1;
            }


            //VALIDAR Domicilio
            if (string.IsNullOrEmpty(Domicilio.ToString()))
            {
                mValida[cantError] = "EL CAMPO 'DOMICILO $' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (Domicilio == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO 'DOMICILIO $'";
                cantError         += 1;
            }

            return(mValida);
        }
コード例 #28
0
 public override int GetHashCode()
 {
     unchecked
     {
         var result = IdMapa.GetHashCode();
         result = (result * 397) ^ IdCalle;
         result = (result * 397) ^ IdEsquina;
         result = (result * 397) ^ IdEntrecalle;
         result = (result * 397) ^ Altura;
         result = (result * 397) ^ Latitud.GetHashCode();
         result = (result * 397) ^ Longitud.GetHashCode();
         result = (result * 397) ^ Calle.GetHashCode();
         result = (result * 397) ^ Partido.GetHashCode();
         result = (result * 397) ^ Provincia.GetHashCode();
         result = (result * 397) ^ Pais.GetHashCode();
         result = (result * 397) ^ Descripcion.GetHashCode();
         return(result);
     }
 }
コード例 #29
0
        /// <summary>
        /// Returns true if Tarea instances are equal
        /// </summary>
        /// <param name="other">Instance of Tarea to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Tarea other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     FechaCreacion == other.FechaCreacion ||
                     FechaCreacion != null &&
                     FechaCreacion.Equals(other.FechaCreacion)
                 ) &&
                 (
                     Descripcion == other.Descripcion ||
                     Descripcion != null &&
                     Descripcion.Equals(other.Descripcion)
                 ) &&
                 (
                     IndFinalizada == other.IndFinalizada ||
                     IndFinalizada != null &&
                     IndFinalizada.Equals(other.IndFinalizada)
                 ) &&
                 (
                     FechaVencimiento == other.FechaVencimiento ||
                     FechaVencimiento != null &&
                     FechaVencimiento.Equals(other.FechaVencimiento)
                 ) &&
                 (
                     Usuario == other.Usuario ||
                     Usuario != null &&
                     Usuario.Equals(other.Usuario)
                 ));
        }
コード例 #30
0
        private void ValidarDatos()
        {
            _errores.Clear();
            Descripcion = Descripcion.Trim();
            if (Descripcion.CompareTo(string.Empty) == 0)
            {
                _errores.Add(new ItemDatasetError("Condicion de Venta", "Descripcion", "El campo no puede estar vacío"));
            }

            /*tfi_TDCompTesoreria_CondicionesDeVentaDataset data = mz.erp.dataaccess.tfi_TDCompTesoreria_CondicionesDeVenta.GetList(null,null,IdCondicionDeVenta);
             * tfi_TDCompTesoreria_CondicionesDeVentaDataset.tfi_TDCompTesoreria_CondicionesDeVentaDataTable tabla = data.tfi_TDCompTesoreria_CondicionesDeVenta;
             *
             * if (tabla.Rows.Count == 1)
             * {
             *      string fp = tabla.Rows[0]["IdTDCompTesoreria"].ToString();
             *      if ((ListaFormasDePagoSeleccionadas.Count != 0)&&((fp == "NULL") || (fp == string.Empty)))
             *      {
             *              _errores.Add(new ItemDatasetError("Condicion de Venta","Formas de Pago","No se debe seleccionar ninguna forma de pago"));
             *      }
             * }*/

            if (DiasDeVencimiento < 0)
            {
                _errores.Add(new ItemDatasetError("Condicion de Venta", "Dias de vencimiento", "El campo no puede ser menor a 0"));
            }
            else
            {
                if (DiasDeVencimiento == 0)
                {                // al menos una forma de pago y no tiene una forma de pago asociada en null
                    if (ListaFormasDePagoSeleccionadas.Count == 0)
                    {
                        _errores.Add(new ItemDatasetError("Condicion de Venta", "Formas de Pago", "Debe seleccionar por lo menos una forma de pago"));
                    }
                }
                else
                {                //ninguna forma de pago
                    if (ListaFormasDePagoSeleccionadas.Count != 0)
                    {
                        _errores.Add(new ItemDatasetError("Condicion de Venta", "Formas de Pago", "No se debe seleccionar ninguna forma de pago"));
                    }
                }
            }
        }