Ejemplo n.º 1
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var campo = new Campo();
        try
        {
            if (txtId.Text != "")
            {
                campo.IDCampo = int.Parse(txtId.Text);
                campo.Get();
            }

            campo.IDTabela = int.Parse(Request["idTabela"]);
            campo.Nome = txtNome.Text;
            campo.Label = txtLabel.Text;
            campo.Tamanho = int.Parse(txtTamanho.Text);
            campo.ValorDefault = txtValorPadrao.Text;
            campo.PermiteNulo = bool.Parse(rdoPermiteNulo.SelectedValue);
            campo.Tipo = (TipoCampo)Enum.Parse(typeof(TipoCampo), ddlTipo.SelectedValue);
            campo.TipoInput = (TipoInput)Enum.Parse(typeof(TipoInput), ddlTipoCampo.SelectedValue);
            campo.Ordem = int.Parse(ddlOrdem.SelectedValue);
            campo.Save();
            GetCampo((int)campo.IDCampo);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
Ejemplo n.º 2
0
        protected override void AgregarCabeceraMensaje(CAMPO_PLANTILLA campoPlantilla, Valor valorCabecera, Valor valorCuerpo)
        {
            EnumTipoDatoCampo tipoDato = (EnumTipoDatoCampo)
            Enum.ToObject(typeof(EnumTipoDatoCampo), campoPlantilla.TIPO_DATO.TDT_CODIGO);

            Campo campo = new Campo(campoPlantilla.CMP_CODIGO, campoPlantilla.CMP_CABECERA, true, campoPlantilla.CMP_POSICION_RELATIVA
                , campoPlantilla.CMP_NOMBRE, false, 0, null, campoPlantilla.CMP_LONGITUD, valorCuerpo, tipoDato, false);

            Campos.Add(campo);
        }
Ejemplo n.º 3
0
        protected override void AgregarCuerpoMensaje(CAMPO campoMensaje, Valor valorCabecera, Valor valorCuerpo)
        {
            EnumTipoDatoCampo tipoDato = (EnumTipoDatoCampo)
                        Enum.ToObject(typeof(EnumTipoDatoCampo), campoMensaje.TIPO_DATO.TDT_CODIGO);

            Campo campo = new Campo(campoMensaje.CAM_CODIGO, campoMensaje.CAM_CABECERA, campoMensaje.CAM_REQUERIDO, campoMensaje.CAM_POSICION_RELATIVA
                , campoMensaje.CAM_NOMBRE, false, 0, null, campoMensaje.CAM_LONGITUD, valorCuerpo, tipoDato
                , campoMensaje.CAM_TANQUEO.HasValue ? campoMensaje.CAM_TANQUEO.Value : false);

            Campos.Add(campo);
        }
 public string ValorPorTipoCriptografia(CriptografiaCampo criptografiaCampo, Campo campo)
 {
     switch (tipoCriptografia)
     {
         case EnumTipoCriptografia.Encriptacion:
             return criptografiaCampo.Encriptar(campo.ValorCuerpo);
         case EnumTipoCriptografia.Desencriptacion:
             return criptografiaCampo.Desencriptar(campo.ValorCuerpo);
         default:
             throw new Exception("Error: CriptografiaMensaje - ValorPorTipoCriptografia");
     }
 }
Ejemplo n.º 5
0
 public void PopulaCampo(Campo campo)
 {
     m_graphicHexs = new List<GraphicHex>();
     for (int i = 0; i < campo.size(); i++) {
         GameObject graphic_hex;
         if (campo.At(i).estaVazio)
             graphic_hex = (GameObject)Instantiate(hexPrefab, m_layout.HexToScreen(campo.At(i)), Quaternion.identity);
         else
             graphic_hex = (GameObject)Instantiate(hexPreto, m_layout.HexToScreen(campo.At(i)), Quaternion.identity);
         graphic_hex.GetComponent<GraphicHex>().SetHex(this, campo.At(i));
         m_graphicHexs.Add(graphic_hex.GetComponent<GraphicHex>());
     }
 }
Ejemplo n.º 6
0
        public void Formatar(Campo Valor, TextBox txtTexto)
        {
            switch (Valor)
            {
                case Campo.CPF:
                    txtTexto.MaxLength = 14;
                    if (txtTexto.Text.Length == 3)
                    {
                        txtTexto.Text = txtTexto.Text + ".";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    else if (txtTexto.Text.Length == 7)
                    {
                        txtTexto.Text = txtTexto.Text + ".";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    else if (txtTexto.Text.Length == 11)
                    {
                        txtTexto.Text = txtTexto.Text + "-";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    break;
                case Campo.CNPJ:
                    txtTexto.MaxLength = 18;
                    if (txtTexto.Text.Length == 2 || txtTexto.Text.Length == 6)
                    {
                        txtTexto.Text = txtTexto.Text + ".";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    else if (txtTexto.Text.Length == 10)
                    {
                        txtTexto.Text = txtTexto.Text + "/";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    else if (txtTexto.Text.Length == 15)
                    {
                        txtTexto.Text = txtTexto.Text + "-";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    break;

                case Campo.CEP:
                    txtTexto.MaxLength = 9;
                    if (txtTexto.Text.Length == 5 )
                    {
                        txtTexto.Text = txtTexto.Text + "-";
                        txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                    }
                    break;
            }
        }
Ejemplo n.º 7
0
        public ActionResult Excluir(int IdCampo)
        {
            Campo campo = _dao.Buscar(IdCampo);

            try
            {
                _dao.Excluir(IdCampo);
                LogINFO(this.ToString(), "Excluir campo: " + LAB5Utils.ReflectionUtils.GetObjectDescription(campo));
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Alert(ex.Message);
                LogWARN(this.ToString(), "Excluir campo: " + LAB5Utils.ReflectionUtils.GetObjectDescription(campo) + ex.Message);
                ViewBag.Erro = ex.Message;
            }
            return(View("Index"));
        }
Ejemplo n.º 8
0
        private string ObterValorDeDominio(string valor, Campo campo)
        {
            var tipoDominio = this.ObterValorDeComplemento(campo.MascaraComplemento, "TabelaDinamica");

            if (tipoDominio.Equals(string.Empty))
            {
                return(valor);
            }

            var dominio = this.dominioCampoRepositorio.ObterPorCodigoEChave(tipoDominio, valor);

            if (dominio != null)
            {
                return(dominio.Descricao ?? valor);
            }

            return(valor);
        }
        public ActionResult Edit(Campo campo, HttpPostedFileBase fimage)
        {
            if (fimage != null)
            {
                using (var reader = new BinaryReader(fimage.InputStream))
                {
                    byte[] data = reader.ReadBytes(fimage.ContentLength);
                    campo.Imagen = data;
                }
            }
            else
            {
                campo.Imagen = null;
            }

            proxy.ActualizarCampo(campo);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 10
0
        public CampoDto Create(CampoCreateDto model)
        {
            var curso = AppDbC.Curso.Single(x => x.CursoId == model.CursoId);
            var entry = new Campo
            {
                CampoTipo        = model.CampoTipo,
                CampoPeso        = model.CampoPeso,
                CampoNumero      = model.CampoNumero,
                CampoDescripcion = model.CampoDescripcion,
                CursoId          = model.CursoId,
                Curso            = curso,
                CampoRellenado   = false
            };

            AppDbC.Campo.Add(entry);
            AppDbC.SaveChanges();
            return(Imapper.Map <CampoDto>(entry));
        }
Ejemplo n.º 11
0
        //Actualizar estado
        public async Task UpdateEstado(Campo campo)
        {
            try
            {
                var _campo = await _ctx.Campo.FirstOrDefaultAsync(e => e.CampoId == campo.CampoId);

                if (_campo != null)
                {
                    _campo.Estado = campo.Estado;

                    await _ctx.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
Ejemplo n.º 12
0
        public void InserirCampo(Campo campo)
        {
            int bar = 0;

            if (campo.bar == true)
            {
                bar = 1;
            }
            var strQuery = "";

            strQuery += "INSERT INTO Campo (idAdministrador, nomeCampo, rua, cep, numero, cidade, bar)";
            strQuery += string.Format("VALUES('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}')", campo.idAdministrador, campo.Nome, campo.rua, campo.cep, campo.numero, campo.cidade, bar);

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Ejemplo n.º 13
0
        private void txtCPFCNPJ_KeyPress_1(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != (char)8)
            {
                Campo edit = Campo.CPF;

                if (rbFisica.Checked == false)
                {
                    edit = Campo.CNPJ;
                    Formatar(edit, txtCPFCNPJ);
                }
                else
                {
                    edit = Campo.CPF;
                    Formatar(edit, txtCPFCNPJ);
                }
            }
        }
Ejemplo n.º 14
0
        public ActionResult Post([FromBody] CampoPayload payload)
        {
            try
            {
                var campo = new Campo();
                campo.Nome      = payload.Nome;
                campo.Descricao = payload.Descricao;
                campo.Local     = payload.Local;

                _context.Campos.Add(campo);
                _context.SaveChanges();
                return(Ok("Campo Cadastrado"));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
Ejemplo n.º 15
0
        protected override Indexacao AdicionaNovaIndexacaoParaCampoReconhecido(
            Documento documento,
            ValorReconhecido valorReconhecido,
            Campo campoDoDocumento)
        {
            var indexacao = new Indexacao
            {
                Campo                 = campoDoDocumento,
                Documento             = documento,
                DataPrimeiraDigitacao = DateTime.Now,
                OcrComplementou       = true,
                PrimeiroValor         = this.ObterPrimeiroValor(valorReconhecido, campoDoDocumento)
            };

            documento.Indexacao.Add(indexacao);

            return(indexacao);
        }
Ejemplo n.º 16
0
        private void AdicionarNovoCampoNaLista(List <Campo> lista, SqlDataReader reader)
        {
            var campo = new Campo();

            campo.Ordem         = Convert.ToInt32(reader["colorder"]);
            campo.NomeCampo     = reader["name"].ToString();
            campo.TipoBanco     = Convert.ToInt32(reader["xtype"]);
            campo.TipoInterno   = ConsultarTipoCampo(campo.TipoBanco);
            campo.NomeTipo      = reader["xtypename"].ToString();
            campo.Obrigatorio   = (Convert.ToInt32(reader["isnullable"]) == 0);
            campo.Chave         = false;
            campo.Identity      = false;
            campo.TamanhoMaximo = (campo.TipoInterno == TipoCampo.String)
                                ? Convert.ToInt32(reader["length"])
                                : 0;
            campo.Calculado = (Convert.ToInt32(reader["iscomputed"]) == 1);
            lista.Add(campo);
        }
Ejemplo n.º 17
0
    void Start()
    {
        m_campo = new CampoPvP((int)tamanho.x, (int)tamanho.y);

          // foreach (Hex hex in m_campo.At(0, 0).vizinhos) {
          //     hex.estaVazio = false;
           //}

           m_graphicCampo.PopulaCampo(m_campo);

           m_campo.PathFinding(m_campo.At(0, 8), m_campo.At(-5, -2));

          // foreach (Hex hex in m_campo.At(0, 2).vizinhos) {
        //   hex.estaVazio = false;
           //}

           m_graphicCampo.AtualizaCampo(m_campo);
    }
Ejemplo n.º 18
0
        public IList <Campo> ObterPorFiltro(Campo modulo)
        {
            var query = repositorio.session.Query <Campo>();

            //if (!string.IsNullOrEmpty(modulo.Nome))
            //    query = query.Where(x => x.Nome.Contains(modulo.Nome));

            //if (modulo.Capacitacao.ID > 0)
            //{
            //    query = query.Where(x => x.Capacitacao.ID == modulo.Capacitacao.ID);
            //}
            //else if (modulo.Capacitacao.ID == 0 && modulo.Capacitacao.Programa.ID > 0)
            //{
            //    query = query.Where(x => x.Capacitacao.Programa.ID == modulo.Capacitacao.Programa.ID);
            //}

            return(query.ToList <Campo>());
        }
Ejemplo n.º 19
0
        public TablaMerged CompararTablas(Tabla referencia, Tabla objetivo)
        {
            TablaMerged retorno = new TablaMerged();

            retorno.Nombre = referencia.Nombre;

            for (int i = 0; i < referencia.Campos.Count; i++)
            {
                Campo campoReferencia = referencia.Campos[i];
                bool  existeCampo     = false;
                for (int x = 0; x < objetivo.Campos.Count; x++)
                {
                    Campo campoObjetivo = objetivo.Campos[x];

                    if (campoReferencia.Nombre == campoObjetivo.Nombre)
                    {
                        if (campoReferencia.Tipo == campoObjetivo.Tipo)
                        {
                            if (campoReferencia.Largo == campoObjetivo.Largo)
                            {
                                retorno.CamposConsistentes.Add(campoObjetivo);
                            }
                            else
                            {
                                retorno.CamposInConsistentes.Add(campoObjetivo);
                            }
                        }
                        else
                        {
                            retorno.CamposInConsistentes.Add(campoObjetivo);
                        }
                        existeCampo = true;
                    }
                }
                if (!existeCampo)
                {
                    retorno.CamposInexistentesEnObjetivo.Add(campoReferencia);
                }
            }

            retorno.CamposInexistentesEnReferencia = objetivo.Campos.Where(c => referencia.Campos.Count(x => x.Nombre == c.Nombre) == 0).ToList();

            return(retorno);
        }
Ejemplo n.º 20
0
        public Indexacao AlterarIndexacao(
            Documento documento,
            ValorReconhecido valorReconhecido,
            Campo campoDoDocumento,
            Indexacao indexacao,
            IList <PalavraReconhecida> palavras)
        {
            if (this.PodeInserirCampoReconhecido(campoDoDocumento, indexacao))
            {
                indexacao = this.AdicionaNovaIndexacaoParaCampoReconhecido(
                    documento,
                    valorReconhecido,
                    campoDoDocumento);

                this.gravaLogDocumentoServico.Executar(
                    LogDocumento.AcaoDocumentoOcr,
                    documento.Id,
                    string.Format("Campo [{0}] inserido pelo ocr.", campoDoDocumento.Description));
            }
            else
            {
                if (indexacao == null)
                {
                    return(null);
                }

                if (indexacao.ValorFinal.NaoTemConteudo() == false)
                {
                    return(indexacao);
                }

                indexacao = this.ModificaIndexacaoDoCampoReconhecido(
                    indexacao,
                    valorReconhecido,
                    palavras);

                this.gravaLogDocumentoServico.Executar(
                    LogDocumento.AcaoDocumentoOcr,
                    documento.Id,
                    string.Format("Campo [{0}] atualizado pelo ocr.", campoDoDocumento.Description));
            }

            return(indexacao);
        }
Ejemplo n.º 21
0
        public void InserisciNave335()
        {
            Campo campo;
            Nave  nave;
            bool  b;

            Campo.CellType[,] @is = Array.CreateInstance(typeof(Campo.CellType),
                                                         new int[] { 3, 3 }, new int[] { 1305989246, -1878780227 }) as Campo.CellType[, ];
            campo             = new Campo(0, Campo.PlayerType.Io);
            campo.PT          = Campo.PlayerType.Io;
            campo.campoIDs    = @is;
            nave              = new Nave(Nave.Type.da2, Nave.Orientamento.Verticale);
            nave.dimensione   = 3;
            nave.type         = Nave.Type.da2;
            nave.orientamento = (Nave.Orientamento) 4;
            b = this.InserisciNave(campo, nave, 1305989247, -1878780227);
            Assert.IsNotNull((object)campo);
            Assert.AreEqual <Campo.PlayerType>(Campo.PlayerType.Io, campo.PT);
            Assert.IsNotNull((object)(campo.campoIDs));
            Assert.AreEqual <int>(2, campo.campoIDs.Rank);
            Assert.AreEqual <int>(1305989246, campo.campoIDs.GetLowerBound(0));
            Assert.AreEqual <int>(3, campo.campoIDs.GetLength(0));
            Assert.AreEqual <int>(-1878780227, campo.campoIDs.GetLowerBound(1));
            Assert.AreEqual <int>(3, campo.campoIDs.GetLength(1));
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989246, -1878780227]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989246, -1878780226]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989246, -1878780225]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Barca, campo.campoIDs[1305989247, -1878780227]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Barca, campo.campoIDs[1305989247, -1878780226]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Barca, campo.campoIDs[1305989247, -1878780225]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989248, -1878780227]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989248, -1878780226]);
            Assert.AreEqual <Campo.CellType>
                (Campo.CellType.Mare, campo.campoIDs[1305989248, -1878780225]);
            Assert.AreEqual <int>(0, campo.dimensione);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Actualiza la información del objeto campo.
        /// Catalogo de campos CH
        /// </summary>
        /// <param name="campo"></param>
        /// <returns></returns>
        public async Task Update(Campo campo)
        {
            try
            {
                var _campo = await _ctx.Campo.FirstOrDefaultAsync(e => e.CampoId == campo.CampoId);

                if (_campo != null)
                {
                    _campo.Descripcion      = campo.Descripcion;
                    _campo.DescripcionCorta = campo.DescripcionCorta;

                    await _ctx.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
        private bool BatimentoAncoragemDeCnh(Indexacao indexacao, Campo campoDoDocumento, IList <ValorReconhecido> valoresReconhecidos, Documento documento)
        {
            foreach (var valorReconhecido in valoresReconhecidos)
            {
                if (string.IsNullOrEmpty(valorReconhecido.Value))
                {
                    continue;
                }

                if (campoDoDocumento
                    .EstaMapeadoPara(valorReconhecido.CampoTemplate, valorReconhecido.TemplateName) == false)
                {
                    continue;
                }

                Log.Application.DebugFormat("Campo {0} mapeado para campo {1} do template {2}",
                                            campoDoDocumento.Description,
                                            valorReconhecido.CampoTemplate,
                                            valorReconhecido.TemplateName);

                if (indexacao == null)
                {
                    if (campoDoDocumento.PodeInserirPeloOcr && string.IsNullOrEmpty(valorReconhecido.Value) == false)
                    {
                        //// TODO: revisar -2
                        indexacao = new Indexacao()
                        {
                            Campo                 = campoDoDocumento,
                            Documento             = documento,
                            PrimeiroValor         = valorReconhecido.Value,
                            OcrComplementou       = true,
                            DataPrimeiraDigitacao = DateTime.Now,
                            UsuarioPrimeiroValor  = -2
                        };

                        documento.Indexacao.Add(indexacao);
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 24
0
        public Segmento soyIN1(string[] segmento, Segmento IN1)
        {
            /*Campo[] auxobligadosIN1 = new Campo[2];
             * Campo[] auxIN1 = new Campo[segmento.Length];*/
            List <Campo> auxIN1          = new List <Campo>();
            List <Campo> auxobligadosIN1 = new List <Campo>();

            String[] nombresIN1 = new String[] { "Segmento", "Set ID - Insurance", "Insurance Plan ID", "Insurance Company ID", "Insurance Company Name", "Insurance Company Address", "Insurance Co. Contact Ppers", "Insurance Co Phone Number", "Group Number", "Group Number", "Insured's group employer ID",
                                                 "Insured's Group Emp Name", "Plan Effective Date", "Plan Expiration Date", "Authorization Information", "Plan Type", "Name of Insured", "Insured's Relationship to Patient", "Insured's Date of Birth", "Insured's Address", "Assignment of Benefits", "Coordination of Benefits", "Coord of Ben. Priority", "Notice of Admission Code",
                                                 "Rpt of Eigibility Code", "Rpt of Eligibility Date", "Release Information Code", "Pre-Admit Cert", "Verification Date/Time", "Verification By", "Type of Agreement Code", "Billing Status", "Lifetime Reserve Days", "Delay before lifetime reserve days", "Company Plan Code", "Policy Number", "Policy Deductible", "Policy Limit - Amount",
                                                 "Policy Limit - Days", "Room Rate - Semi-Private", "Room Rate - Private", "Insured's Employment Status", "Insured's Sex", "Insured's Employer Address", "Verification Status", "Prior Insurance Plan ID", "Coverage Type", "Handicap", "Insured's ID Number" };

            for (int i = 0; i < segmento.Length; i++)
            {
                Campo campo1 = new Campo();
                campo1.data    = segmento[i];
                campo1.isEmpty = estavacio(campo1.data);
                campo1.nombre  = nombresIN1[i];
                auxIN1.Add(campo1);
                if (i == 1)
                {
                    auxobligadosIN1.Add(campo1);
                }
                else if (i == 3)
                {
                    auxobligadosIN1.Add(campo1);
                }
            }

            /*for (int i = 0; i < auxIN1.Length; i++)
             * {
             *  IN1.campos.Add(auxIN1[i]);
             * }
             * for (int i = 0; i < auxobligadosIN1.Length; i++)
             * {
             *  IN1.camposobligados.Add(auxobligadosIN1[i]);
             * }*/

            IN1.campos          = auxIN1;
            IN1.camposobligados = auxobligadosIN1;

            return(IN1);
        }
Ejemplo n.º 25
0
        public Segmento soyPV1(string[] segmento, Segmento PV1)
        {
            /* Campo[] auxobligadosPV1 = new Campo[1];
             * Campo[] auxPV1 = new Campo[segmento.Length];*/
            List <Campo> auxPV1          = new List <Campo>();
            List <Campo> auxobligadosPV1 = new List <Campo>();

            String[] nombresPV1 = new String[] { "Segmento", "Set ID - Patient Visit", "Patient Class", "Assigned Patient Location", "Admission Type", "Preadmit Number",
                                                 "Prior Patient Location", "Attending Doctor", "Referring Doctor", "Consulting Doctor", "Hospital Service", "Temporary Location", "Preadmit Test Indicator", "Readmission Indicator", "Admit Source",
                                                 "Ambulatory Status", "VIP Indicator", "Admitting Doctor", "Patient Type", "Visit Number", "Financial Class", "Charge Price Indicator", "Courtesy Code", "Credit Rating", "Contract Code", "Contract Effective Date", "Contract Amount",
                                                 "Contract Period", "Interest Code", "Transfer to Bad Debt Code", "Transfer to Bad Debt Date", "Bad Debt Agency Code", "Bad Debt Transfer Amount", "Bad Debt Recovery Amount", "Delete Account Indicator", "Delete Account Date", "Discharge Disposition",
                                                 "Discharged to Location", "Diet Type", "Servicing Facility", "Bed Status", "Account Status", "Pending Location", "Prior Temporary Location", "Admit Date/Time", "Discharge Date/Time", "Current Patient Balance", "Total Charges", "Total Adjustments",
                                                 "Total Payments", "Alternate Visit ID", "Visit Indicator", "Other Healthcare Provider" };



            for (int i = 0; i < segmento.Length; i++)
            {
                Campo campo1 = new Campo();
                campo1.data    = segmento[i];
                campo1.isEmpty = estavacio(campo1.data);
                campo1.nombre  = nombresPV1[i];
                auxPV1.Add(campo1);
                if (i == 2)
                {
                    auxobligadosPV1.Add(campo1);
                }
            }

            /*for (int i = 0; i < auxPV1.Length; i++)
             * {
             *  PV1.campos.Add(auxPV1[i]);
             * }
             * for (int i = 0; i < auxobligadosPV1.Length; i++)
             * {
             *  PV1.camposobligados.Add(auxobligadosPV1[i]);
             * }
             */
            PV1.campos          = auxPV1;
            PV1.camposobligados = auxobligadosPV1;

            return(PV1);
        }
Ejemplo n.º 26
0
        //si se agrega un nuevo tipo, se debe agregar en TipoValidacion, y la opcion en este metodo con la condicion y el mensaje correspondiente si falla esa condicion
        public static void validarTipo(Campo campo)
        {
            if (!stringVacio(campo.texto))
            {
                switch (campo.tipoVal) //dependiendo del tipo de campo, utiliza el metodo correspondiente para comparar contra la expresion regular, en caso de no cumplir muestra un mensaje de error distinto
                {
                case TipoValidacion.Email:
                    if (!stringEmailValido(campo.texto))
                    {
                        throw new ExcepcionValidacion("-El campo " + campo.nombre + " debe contener caracteres válidos para un e-mail." + Environment.NewLine);
                    }
                    break;

                case TipoValidacion.Alfa:
                    if (!stringAlfa(campo.texto))
                    {
                        throw new ExcepcionValidacion("-El campo " + campo.nombre + " debe ser solo letras." + Environment.NewLine);
                    }
                    break;

                case TipoValidacion.Alfanumerico:
                    if (!stringValido(campo.texto))
                    {
                        throw new ExcepcionValidacion("-El campo " + campo.nombre + " debe ser alfanumérico." + Environment.NewLine);
                    }
                    break;

                case TipoValidacion.Dinero:
                    if (!esDinero(campo.texto))
                    {
                        throw new ExcepcionValidacion("-El campo " + campo.nombre + " debe representar dinero.(sin letras, negativo ni ',')" + Environment.NewLine);
                    }
                    break;

                case TipoValidacion.Codigo:
                    if (!cadenaEsNumerica(campo.texto))
                    {
                        throw new ExcepcionValidacion("-El campo " + campo.nombre + " no es un código válido. Solo se permiten números." + Environment.NewLine);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 27
0
 public void Salvar(Campo campo)
 {
     try
     {
         if (campo.IdCampo == 0)
         {
             _dao.Add(campo);
             _dao.CommitChanges();
         }
         else
         {
             _dao.Update(campo);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private static void GerarAtributosBasicos(StreamWriter arquivo, Campo campo)
 {
     arquivo.Write("\t\t[Coluna(\"");
     arquivo.Write(campo.NomeCampo);
     arquivo.Write("\", NomeDoTipo = \"");
     arquivo.Write(campo.NomeTipo);
     arquivo.Write("\")");
     if (campo.TamanhoMaximo > 0)
     {
         arquivo.Write(", TamanhoMaximo(");
         arquivo.Write(campo.TamanhoMaximo);
         arquivo.Write(")");
     }
     if (campo.Obrigatorio)
     {
         arquivo.Write(", Obrigatorio");
     }
     arquivo.WriteLine("]");
 }
Ejemplo n.º 29
0
        //-------------------------------------------------------------------------------------------------------------------
        public void Formatar(Campo Valor, TextBox txtTexto)
        {
            switch (Valor)
            {
            case Campo.CPF:
                txtTexto.MaxLength = 14;
                if (txtTexto.Text.Length == 3)
                {
                    txtTexto.Text           = txtTexto.Text + ".";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                else if (txtTexto.Text.Length == 7)
                {
                    txtTexto.Text           = txtTexto.Text + ".";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                else if (txtTexto.Text.Length == 11)
                {
                    txtTexto.Text           = txtTexto.Text + "-";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                break;

            case Campo.CNPJ:
                txtTexto.MaxLength = 18;
                if (txtTexto.Text.Length == 2 || txtTexto.Text.Length == 6)
                {
                    txtTexto.Text           = txtTexto.Text + ".";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                else if (txtTexto.Text.Length == 10)
                {
                    txtTexto.Text           = txtTexto.Text + "/";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                else if (txtTexto.Text.Length == 15)
                {
                    txtTexto.Text           = txtTexto.Text + "-";
                    txtTexto.SelectionStart = txtTexto.Text.Length + 1;
                }
                break;
            }
        }
Ejemplo n.º 30
0
        public void InserisciNave42()
        {
            Campo campo;
            Nave  nave;
            bool  b;

            campo             = new Campo(0, Campo.PlayerType.Io);
            campo.PT          = Campo.PlayerType.Io;
            campo.campoIDs    = (Campo.CellType[, ])null;
            nave              = new Nave(Nave.Type.da2, Nave.Orientamento.Verticale);
            nave.dimensione   = 514;
            nave.type         = Nave.Type.da2;
            nave.orientamento = (Nave.Orientamento) 4;
            b = this.InserisciNave(campo, nave, 0, 749);
            Assert.IsNotNull((object)campo);
            Assert.AreEqual <Campo.PlayerType>(Campo.PlayerType.Io, campo.PT);
            Assert.IsNull((object)(campo.campoIDs));
            Assert.AreEqual <int>(0, campo.dimensione);
        }
Ejemplo n.º 31
0
 //-------------------------------------------------------------------------------------------------------------------
 private void txtValor_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (rbCodigoBarras.Checked == true)
     {
         if (e.KeyChar != (char)8)
         {
             Campo edit = Campo.CodigoBarras;
             Formatar(edit, txtValor);
         }
     }
     else
     {
         if (e.KeyChar != (char)8)
         {
             Campo edit = Campo.Nome;
             Formatar(edit, txtValor);
         }
     }
 }
Ejemplo n.º 32
0
        public void TestMethod1()
        {
            PdfDocument document = new PdfDocument();
            PdfPage     page     = document.AddPage();

            XGraphics gfx  = XGraphics.FromPdfPage(page);
            Gfx       gfx2 = new Gfx(gfx);

            Estilo estilo = new Estilo();

            Campo campo1 = new Campo("Cabeçalho", "vulputate", estilo);



            campo1.X     = 10;
            campo1.Y     = 10;
            campo1.Width = 30;



            campo1.Draw(gfx2);


            CampoMultilinha campo2 = new CampoMultilinha("Cabecalho", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices dignissim est ac eleifend. Curabitur sed sem viverra, viverra nibh maximus, consectetur libero. Sed elementum urna in consequat scelerisque. Vestibulum eu pellentesque odio. Maecenas velit nunc, semper a felis ac, auctor consequat justo. Maecenas tempus turpis eget metus volutpat efficitur. Donec quis lacus eget sapien tristique mattis. Cras commodo blandit vulputate.", estilo);

            campo2.Y     = campo1.BoundingBox.Bottom;
            campo2.X     = 10;
            campo2.Width = 50;
            campo2.Draw(gfx2);

            campo1.Y = campo2.BoundingBox.Bottom;

            for (int i = 0; i < 15; i++)
            {
                campo1.Draw(gfx2);
                campo1.Conteudo += "abc";
                campo1.Y        += campo1.Height;
            }


            document.Save("TextCampo.pdf");
        }
Ejemplo n.º 33
0
        public ICommandResult Handler(FormularioCommand command)
        {
            var formulario = new Formulario();

            command.Validate();
            if (command.Invalid)
            {
                AddNotifications(command);
                return(new CommandResult(false, "Não foi possível criar o Formulario"));
            }

            foreach (var item in command.Campos)
            {
                if (item.TipoCampo == TipoCampo.Combo)
                {
                    var combo = new Combo(item.Nome, item.TipoCampo, item.Valor, item.Descricao, item.Obrigatorio);

                    foreach (var valor in item.Items)
                    {
                        combo.AddItem(new Item(valor));
                    }

                    formulario.AddItem(combo);
                    AddNotifications(combo);
                }
                else
                {
                    var campo = new Campo(item.Nome, item.TipoCampo, item.Valor, item.Descricao, item.Obrigatorio);
                    formulario.AddItem(campo);
                    AddNotifications(campo);
                }
            }

            if (formulario.Invalid)
            {
                return(new CommandResult(false, "Não foi possível criar o formulario"));
            }

            _repository.CreateFormulario(formulario);

            return(new CommandResult(true, "Formulário criado com sucesso"));
        }
Ejemplo n.º 34
0
        public Segmento soyPID(string[] segmento, Segmento PID)
        {
            /*Campo[] auxobligadosPID = new Campo[2];
             * Campo[] auxPID = new Campo[segmento.Length];*/
            List <Campo> auxPID          = new List <Campo>();
            List <Campo> auxobligadosPID = new List <Campo>();

            String[] nombresPID = new String[] { "Segmento", "Set ID - Patient ID", "Patient ID (External ID)", "Patient ID (Internal ID)", "Alternate Patient ID", "Patient Name", "Mother's Maiden Name", "Date of Birth", "Sex", "Patient Alias", "Race",
                                                 "Patient Address", "County Code", "Phone Number - Home", "Phone Number - Business", "Primary Language", "Marital Status", "Religion", "Patient Account Number", "SSN Number - Patient", "Driver's License Number",
                                                 "Mother's Identifier", "Ethnic Group", "Birth Place", "Multiple Birth Indicator", "Birth Order", "Citizenship", "Veterans Military Status", "Nationality Code", "Patient Death Date and Time", "Patient Death Indicator" };

            for (int i = 0; i < segmento.Length; i++)
            {
                Campo campo1 = new Campo();
                campo1.data    = segmento[i];
                campo1.isEmpty = estavacio(campo1.data);
                campo1.nombre  = nombresPID[i];
                auxPID.Add(campo1);
                if (i == 3)
                {
                    auxobligadosPID.Add(campo1);
                }
                else if (i == 5)
                {
                    auxobligadosPID.Add(campo1);
                }
            }

            /*for (int i = 0; i < auxPID.Length; i++)
             * {
             *  PID.campos.Add(auxPID[i]);
             * }
             * for (int i = 0; i < auxobligadosPID.Length; i++)
             * {
             *  PID.camposobligados.Add(auxobligadosPID[i]);
             * }*/

            PID.campos          = auxPID;
            PID.camposobligados = auxobligadosPID;

            return(PID);
        }
Ejemplo n.º 35
0
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        // we only process commands with a datasource (our image buttons)
        if (e.CommandSource == null)
        {
            return;
        }
        string typeOfControl = e.CommandSource.GetType().ToString();

        if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton"))
        {
            int         id   = 0;
            ImageButton imgb = (ImageButton)e.CommandSource;
            if (imgb.ID != "New" && imgb.ID != "Exit")
            {
                id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
            }
            switch (imgb.ID)
            {
            case "Select":
                break;

            case "Edit":
                break;

            case "Delete":
                try
                {
                    Campo campo = CntLainsaSci.GetCampo(id, ctx);
                    CntLainsaSci.CTXEliminar(campo, ctx);
                    CntLainsaSci.CTXGuardar(ctx);
                    RefreshGrid(true);
                }
                catch (Exception ex)
                {
                    ControlDeError(ex);
                }
                break;
            }
        }
    }
Ejemplo n.º 36
0
        public Segmento soyDG1(string[] segmento, Segmento DG1)
        {
            /*Campo[] auxobligadosDG1 = new Campo[2];
             * Campo[] auxDG1 = new Campo[segmento.Length];*/
            List <Campo> auxDG1          = new List <Campo>();
            List <Campo> auxobligadosDG1 = new List <Campo>();

            String[] nombresDG1 = new String[] { "Segmento", "Set ID - Diagnosis", "Diagnosis Coding Method", "Diagnosis Code", "Diagnosis Description", "Diagnosis Date/Time", "Diagnosis Type", "Major Diagnostic Category", "Diagnostic Related Group", "DRG Approval Indicator", "DRG Grouper Review Code",
                                                 "Outlier Type", "Outlier Days", "Outlier Cost", "Grouper Version and Type", "Diagnosis Priority", "Diagnosing Clinician", "Diagnosis Classification", "Confidential Indicator", "Attestation Date/Time" };

            for (int i = 0; i < segmento.Length; i++)
            {
                Campo campo1 = new Campo();
                campo1.data    = segmento[i];
                campo1.isEmpty = estavacio(campo1.data);
                campo1.nombre  = nombresDG1[i];
                auxDG1.Add(campo1);
                if (i == 1)
                {
                    auxobligadosDG1.Add(campo1);
                }
                else if (i == 6)
                {
                    auxobligadosDG1.Add(campo1);
                }
            }

            /*for (int i = 0; i < auxDG1.Length; i++)
             * {
             *  DG1.campos.Add(auxDG1[i]);
             * }
             * for (int i = 0; i < auxobligadosDG1.Length; i++)
             * {
             *  DG1.camposobligados.Add(auxobligadosDG1[i]);
             * }*/

            DG1.campos          = auxDG1;
            DG1.camposobligados = auxobligadosDG1;

            return(DG1);
        }
Ejemplo n.º 37
0
        public Segmento soyORC(string[] segmento, Segmento ORC)
        {
            /*Campo[] auxobligadosORC = new Campo[2];
             * Campo[] auxORC = new Campo[segmento.Length];*/
            List <Campo> auxORC          = new List <Campo>();
            List <Campo> auxobligadosORC = new List <Campo>();

            String[] nombresORC = new String[] { "Segmento", "Order Control", "Placer Order Number", "Filler Order Number", "Placer Group Number", "Order Status", "Response Flag", "Quantity/Timing", "Parent Order", "Date/Time of Transaction", "Entered By",
                                                 "Verified By", "Ordering Provider", "Enterer's Location", "Call Back Phone Number", "Order Effective Date/Time", "Order Control Code Reason", "Entering Organization", "Entering Device", "Action By" };

            for (int i = 0; i < segmento.Length; i++)
            {
                Campo campo1 = new Campo();
                campo1.data    = segmento[i];
                campo1.isEmpty = estavacio(campo1.data);
                campo1.nombre  = nombresORC[i];
                auxORC.Add(campo1);
                if (i == 1)
                {
                    auxobligadosORC.Add(campo1);
                }
                else if (i == 7)
                {
                    auxobligadosORC.Add(campo1);
                }
            }

            /* for (int i = 0; i < auxORC.Length; i++)
             * {
             *   ORC.campos.Add(auxORC[i]);
             * }
             * for (int i = 0; i < auxobligadosORC.Length; i++)
             * {
             *   ORC.camposobligados.Add(auxobligadosORC[i]);
             * }*/

            ORC.campos          = auxORC;
            ORC.camposobligados = auxobligadosORC;

            return(ORC);
        }
Ejemplo n.º 38
0
 protected void btnVoltaCampo_Click(object sender, EventArgs e)
 {
     var campo = new Campo(int.Parse(Request["idCampo"]));
     campo.Get();
     Response.Redirect("~/camposTabela.aspx?idCampo=" + campo.IDCampo + "&idTabela=" + campo.Tabela.IDTabela );
 }
Ejemplo n.º 39
0
    private void GetCampo(int idCampo)
    {
        LoadCombos();
        dvSalvarCampo.Visible = true;
        dvListarCampos.Visible = false;

        var campo = new Campo();
        campo.IDTabela = int.Parse(Request["idTabela"]);
        campo.IDCampo = idCampo;
        campo.Get();

        txtId.Text = campo.IDCampo.ToString();
        txtNome.Text = campo.Nome;
        txtLabel.Text = campo.Label;
        txtTamanho.Text = campo.Tamanho.ToString();
        txtValorPadrao.Text = campo.ValorDefault;
        rdoPermiteNulo.SelectedValue = campo.PermiteNulo.ToString();
        ddlTipo.SelectedValue = campo.Tipo.ToString();
        ddlTipoCampo.SelectedValue = campo.TipoInput.ToString();
        ddlOrdem.SelectedValue = campo.Ordem.ToString();
    }
Ejemplo n.º 40
0
        public List<bel.CCe.belPesquisaCCe> BuscaCCe(string sVl_inicial, string sVl_final, Campo campo, string status)
        {
            try
            {
                if (belStatic.RAMO != "TRANSPORTE")
                {
                    AddCamposAquery();
                    sQuery.Append(string.Format("where coalesce(nf.cd_recibocanc,'') = '' and cartacor." + campo.ToString() + " between '{0}' and '{1}'  and cartacor.cd_empresa = '{2}'", sVl_inicial, sVl_final, belStatic.codEmpresaNFe));
                }
                else
                {
                    AddCamposAqueryCte();
                    sQuery.Append(string.Format("where coalesce(conhecim.cd_recibocanc,'') = '' and conhecim." + campo.ToString() + " between '{0}' and '{1}'  and cartacor.cd_empresa = '{2}'", sVl_inicial, sVl_final, belStatic.codEmpresaNFe));
                }

                AddWhereStatus(status);
                ExecuteQuery();


                return objLPesquisa;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 41
0
 internal bool checaValor(Campo campo)
 {
     if (campo.valor.Length != campo.tamanho)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
Ejemplo n.º 42
0
 public void AtualizaCampo(Campo campo)
 {
     for (int i = 0; i < campo.size(); i++) {
         m_graphicHexs[i].AtualizaHex();
     }
 }