Пример #1
0
        private bool VarlidarControlLote(EntidadLOTE entidadControl)
        {
            bool resultado = true;

            mensajeError = "";
            if (entidadControl.IdManzano == null)
            {
                mensajeError = "Manzano" + Environment.NewLine;
                resultado    = false;
            }
            if (entidadControl.NombreLote == null)
            {
                mensajeError += "Nombre Lote" + Environment.NewLine;
                resultado     = false;
            }
            if (entidadControl.Codigo == null)
            {
                mensajeError += "Código" + Environment.NewLine;
                resultado     = false;
            }
            if (entidadControl.Estado == null)
            {
                mensajeError += "Estado: activo / inactivo" + Environment.NewLine;
                resultado     = false;
            }

            return(resultado);
        }
Пример #2
0
        private void BtnGuardarNuevoLote_Click(object sender, EventArgs e)
        {
            entidadLote = new EntidadLOTE();

            if (dataLayoutControl1.Validate())
            {
                entidadLote = (EntidadLOTE)lOTEBindingSource.Current;
                if (VarlidarControlLote(entidadLote))
                {
                    dbContext.LOTE.Add(entidadLote);
                    dbContext.SaveChanges();
                    this.OrdenarTabPage("inicio");
                    this.ActivarBotones();
                    entidadLote = new EntidadLOTE();
                }
                else
                {
                    Mensajes.MensajeSimple("Falta información", this.mensajeError, MessageBoxIcon.Stop);
                }
            }
            else
            {
                Mensajes.MensajeRapido("Faltan Datos");
            }
        }
Пример #3
0
        /***********************************
        *
        *
        *       VERIFICADORES
        *
        *
        ***********************************/

        #region Verificadores

        private bool VerificarTabLotes()
        {
            bool resultado = false;

            if (gridViewPropiedad.FocusedRowHandle == -1)
            {
                Mensajes.MensajeSimple("ERROR", "Debe seleccionar un LOTE para poder continuar", MessageBoxIcon.Exclamation);
                resultado = false;
            }
            else
            {
                miEntidadLote = (Datos.EntidadLOTE)gridViewPropiedad.GetFocusedRow();
                //Mensajes.MensajeRapido("Paso Id:--" + miEntidadLote.IdLote.ToString());
                Modelo.ClassVenta.EntidadLote        = miEntidadLote;
                Modelo.ClassVenta.EntidadLoteLlenado = true;
                resultado = true;
            }
            return(resultado);
        }