Exemplo n.º 1
0
 private void InitialFigure()
 {
     _xpxsz = Xsz / pictureBox.Width;
     _ypxsz = Ysz / pictureBox.Height;
     _sz    = pictureBox.Width;
     if (File.Exists(BgFileName))
     {
         var img = Image.FromFile(BgFileName);
         if (img.Width != pictureBox.Width || img.Height != pictureBox.Height)
         {
             img.Dispose();
             File.Delete(BgFileName);
             InitialFigure();
         }
         else
         {
             _bg = img as Bitmap;
         }
     }
     else
     {
         var img = RG.GetBg(pictureBox.Width, pictureBox.Height, CProjection.DownC1C2);
         img.Save(BgFileName, ImageFormat.Bmp);
         _bg = img as Bitmap;
     }
     if (_bg != null)
     {
         pictureBox.Image = _bg.Clone() as Bitmap;
     }
 }
Exemplo n.º 2
0
        private void Notifybar_timer_Tick(object sender, EventArgs e)
        {
            POINT pt = new POINT();

            //获取鼠标的位置
            GetCursorPos(out pt);

            //获取托盘图标的位置
            RG rg = GetIconRect(_trayIcon);

            if (pt.x > rg.Left && pt.x < (rg.Left + rg.Width) && pt.y > rg.Top && pt.y < (rg.Top + rg.Height))
            {
                //鼠标指针还在托盘图标中,不需要处理
            }
            else
            {
                _trayWinTimer.Stop();

                //判断指针是否移入了弹框的区域
                if (_trayWin != null && _isMouseEnterWindow == false)
                {
                    _trayWin.Hide();
                }
            }
        }
        public RetornoUsuario Login(RequisicaoUsuario requisicao)
        {
            try
            {
                if (string.IsNullOrEmpty(requisicao.Usuario.IDLDAP) || string.IsNullOrEmpty(requisicao.Usuario.Senha))
                {
                    return(new RetornoUsuario(requisicao.Usuario, null, new Status(3, "Usuário/Senha em branco.", false)));
                }

                if (CPF.IsValid(requisicao.Usuario.IDLDAP) ||
                    (
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("DE-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("ESC-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("EFAP-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("CGRH-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("CGEB-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("CIMA-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("CISE-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("COFI-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("CEE-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("DA-") ||
                        requisicao.Usuario.IDLDAP.ToUpper().Contains("GS-"))
                    )
                {
                    requisicao.Usuario.CPF = requisicao.Usuario.IDLDAP;
                }
                else if (RG.IsValid(requisicao.Usuario.IDLDAP))
                {
                    requisicao.Usuario.RG = requisicao.Usuario.IDLDAP;
                }
                else
                {
                    requisicao.Usuario.Nome = requisicao.Usuario.IDLDAP;
                }

                requisicao.Usuario.IDLDAP = null;

                Usuario usuario = _usuarioNegocio.Login(requisicao.Usuario);

                if (usuario.IDLDAP != "0" && !String.IsNullOrEmpty(usuario.IDLDAP))
                {
                    return(new RetornoUsuario(usuario, null, new Status(0, "", true)));
                }
                else
                {
                    return(new RetornoUsuario(usuario, null, new Status(3, "Usuário não encontrado", false)));
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Ops"))
                {
                    return(new RetornoUsuario(requisicao.Usuario, null, new Status(66, ex.Message, false)));
                }
                else
                {
                    return(new RetornoUsuario(requisicao.Usuario, null, new Status(3, ex.Message, false)));
                }
            }
        }
Exemplo n.º 4
0
        private void RedrawWithArea()
        {
            if (_bgWithArea != null)
            {
                _bgWithArea.Dispose();
            }
            _bgWithArea = _bg.Clone() as Bitmap;

            var initialLstPositive = (_arc ? RGPoint.GetArcPositive(_h1, _h2, _ypxsz, CProjection.UpC1C2) : RGPoint.GetTrianglePositive(_h1, _h2, _xpxsz, _ypxsz, CProjection.UpC1C2)).ToList();
            var initialLstNegative = (_arc ? RGPoint.GetArcNegative(_h1, _h2, _ypxsz, CProjection.UpC1C2) : RGPoint.GetTriangleNegative(_h1, _h2, _xpxsz, _ypxsz, CProjection.UpC1C2)).ToList();

            _areaInitialSetCPositive = initialLstPositive.Select(e => e.Key).ToList();
            _areaInitialSetCNegative = initialLstNegative.Select(e => e.Key).ToList();

            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Yellow, _areaInitialSetCPositive, _bgWithArea, CProjection.UpC1C2);
            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Red, _areaInitialSetCNegative, _bgWithArea, CProjection.UpC1C2);

            var iteratedPositive = RGPoint.DirectIteratedMany(_areaInitialSetCPositive, trackArea.Maximum, CProjection.C1C2).ToList();
            var iteratedNegative = RGPoint.DirectIteratedMany(_areaInitialSetCNegative, trackArea.Maximum, CProjection.C1C2).ToList();

            _iteratedAreasCPositive = iteratedPositive.Select(e => e.Key.ToList()).ToList();
            _iteratedAreasCPositive.Insert(0, _areaInitialSetCPositive);
            _iteratedAreasCNegative = iteratedNegative.Select(e => e.Key.ToList()).ToList();
            _iteratedAreasCNegative.Insert(0, _areaInitialSetCNegative);

            ChangePictureBoxPicture(_bgWithArea);
            pictureBox.Update();
        }
Exemplo n.º 5
0
        public IActionResult Get()
        {
            // var broswer = HttpContext.Request.Headers["User-Agent"].FirstOrDefault();

            var _list = (
                from R in _DbEntity.Room
                join G in _DbEntity.ReservationGuestDetail on R.RoomNumber equals G.RoomNumber into RG
                from x in RG.DefaultIfEmpty()

                join RE in _DbEntity.Reservation on x.ReservationNumber equals RE.ReservationNumber into GRE
                from y in GRE.DefaultIfEmpty()

                select new
            {
                RoomId = R.RoomId,
                RoomNumber = R.RoomNumber,
                RoomType = R.RoomTypeName,

                ReservationNumber = y.ReservationNumber,
                ReservationStatus = y.ReservationStatus,
                GuestName = x.GuestName
            }).OrderBy(x => x.RoomId).ToList();

            return(Ok(_list));
        }
Exemplo n.º 6
0
        public PessoaFisica(string nome, string dados)
        {
            try
            {
                if (string.IsNullOrEmpty(nome) || string.IsNullOrEmpty(dados))
                {
                    throw new CertificadoNetException(3);
                }

                Nome = nome;
                if (DateTime.TryParseExact(dados.Substring(0, 8), "ddMMyyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dataNascimento))
                {
                    DataNascimento = dataNascimento;
                }
                CPF = dados.Substring(8, 11);
                NIS = dados.Substring(19, 11);
                RG  = dados.Substring(30, 15);
                if (!RG.Equals("0".PadRight(15, '0')))
                {
                    OrgaoExpedidor = dados.Substring(45);
                }
            }
            catch (Exception ex)
            {
                throw new CertificadoNetException(3, ex);
            }
        }
Exemplo n.º 7
0
        public RGB Convert(RG input)
        {
            var R = input.R * input.g / input.G;
            var G = input.g;
            var B = (1.0 - input.R - input.G) * input.g / input.G;

            return(new RGB(R, G, B));
        }
Exemplo n.º 8
0
        public void Validacao()
        {
            //Nome Validations
            if (string.IsNullOrEmpty(Nome) || string.IsNullOrWhiteSpace(Nome))
            {
                throw new Exception("Por favor informe o nome do funcionario");
            }

            if (Nome.Length < 8)
            {
                throw new Exception("O Nome do seu funcionario com toda certeza tem pelo menos 8 digitos né");
            }

            //Idade Validations
            if (Idade == 0)
            {
                throw new Exception("A Idade do funcionario não pode ser zero");
            }

            //CPF Validations
            if (CPF == 0.0)
            {
                throw new Exception("Por favor informe o CPF do funcionario");
            }

            if (CPF.ToString().Length < 11)
            {
                throw new Exception("O CPF deve conter pelo menos 11 digitos");
            }

            if (CPF.ToString().Length > 11)
            {
                throw new Exception("O CPF Pode ter somente 11 digitos");
            }


            //RG Validations
            if (RG == 0.0)
            {
                throw new Exception("Por favor informe o RG do funcionario");
            }

            if (RG.ToString().Length < 6)
            {
                throw new Exception("Por favor informe um RG Valido com ate 6 digitos");
            }

            if (RG.ToString().Length > 15)
            {
                throw new Exception("Por favor informe um RG Valido com no maximo 15 digitos");
            }

            //Telefone Validations
            if (string.IsNullOrEmpty(Telefone) || string.IsNullOrWhiteSpace(Telefone))
            {
                throw new Exception("Por favor informe um telefone");
            }
        }
Exemplo n.º 9
0
        public Cliente(string nomeCompleto, CPF cpf, RG rg, Email email, Guid?id = null) : base(id)
        {
            NomeCompleto = nomeCompleto;
            CPF          = cpf;
            RG           = rg;
            Email        = email;

            AddNotifications(CPF, RG, Email);
        }
Exemplo n.º 10
0
        private void FillPoint(RGPoint p1, Color clr)
        {
            var np    = NPt(p1);
            var gr    = Graphics.FromImage(pictureBox.Image);
            var bgClr = RG.GetColorDirect(new RGPoint(p1), CProjection.UpC1C2);
            var blend = RG.Blend(clr, bgClr);

            gr.TryDraw(g => g.FillEllipse(new SolidBrush(clr), np.X - 2, np.Y - 2, 4, 4));
            gr.TryDraw(g => g.DrawRectangle(new Pen(blend), np.X - 10, np.Y - 10, 20, 20));
        }
 public RG ProcessDocumento()
 {
     _rg = new RG();
     ConferirDocumentosRg();
     ColetarDigital();
     FotografarParaDocumento();
     ObterNumeroRg();
     ConfeccionarRg();
     return(_rg);
 }
Exemplo n.º 12
0
    public float Unlerp(string property, float t)
    {
        Type ownType = typeof(RDPresetRandomizer);

        System.Reflection.FieldInfo ownField = ownType.GetField(property);

        RG range = ( RG )ownField.GetValue(this);

        return((t - range.min) / (range.max - range.min));
    }
Exemplo n.º 13
0
 public Cliente(string produtoPreferido, string cpf, RG rgCleinte, int tipoCliente, Endereco enderecoCliente)
 {
     TransacaoCliente = new List <Transacao>();
     Cartoes          = new List <Cartao>();
     Comentarios      = new List <Comentario>();
     CPF              = cpf;
     TipoCliente      = tipoCliente;
     RgCliente        = rgCleinte;
     ProdutoPreferido = produtoPreferido;
     EnderecoCliente  = enderecoCliente;
 }
Exemplo n.º 14
0
        private void RedrawPoint()
        {
            ChangePictureBoxPicture(_bgWithLines);
            var gr = Graphics.FromImage(pictureBox.Image);
            var p1 = _line1[_currentStep];

            RG.FillPoint(X, Y, _xpxsz, _ypxsz, _sz, Config.Black, p1, gr, CProjection.UpC0C1);
            var p2 = _line2[_currentStep];

            RG.FillPoint(X, Y, _xpxsz, _ypxsz, _sz, Config.White, p2, gr, CProjection.UpC0C1);
        }
Exemplo n.º 15
0
        public Cliente(Nome nome, RG rg, CPF cpf, DataNascimento dataNascimento, Email email, List <Endereco> enderecos)
        {
            Nome           = nome;
            RG             = rg;
            CPF            = cpf;
            DataNascimento = dataNascimento;
            Email          = email;
            _enderecos     = enderecos;

            Validar();
        }
Exemplo n.º 16
0
        private void RedrawArea()
        {
            ChangePictureBoxPicture(_bg);
            var img         = pictureBox.Image.Clone() as Bitmap;
            var ptsPositive = _iteratedAreasCPositive[_areaStep];
            var ptsNegative = _iteratedAreasCNegative[_areaStep];

            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Yellow, ptsPositive, img, CProjection.UpC1C2);
            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Red, ptsNegative, img, CProjection.UpC1C2);
            ChangePictureBoxPicture(img);
        }
Exemplo n.º 17
0
        //查询
        protected void btn_Search_Click(object sender, EventArgs e)
        {
            OrderNumber = RTB_OrderNumber.Text.Trim();
            StartTime   = RDP_StartTime.SelectedDate != null ? RDP_StartTime.SelectedDate.Value : DateTime.MinValue;
            EndTime     = RDP_EndTime.SelectedDate != null ? RDP_EndTime.SelectedDate.Value : DateTime.MinValue;
            Status      = ddl_Status.SelectedValue;

            SaleFilialeId  = new Guid(RCB_SaleFiliale.SelectedValue);
            SalePlatformId = string.IsNullOrEmpty(RCB_SalePlatform.SelectedValue) ? Guid.Empty : new Guid(RCB_SalePlatform.SelectedValue);
            RG.Rebind();
        }
Exemplo n.º 18
0
        public void AtualizaDados(string NOME, CPF CPF, RG RG, DateTime DT_NASCIMENTO)
        {
            this.InicializaVariaveis();

            this.NOME          = NOME;
            this.CPF           = CPF;
            this.CPF           = CPF;
            this.RG            = RG;
            this.DT_NASCIMENTO = DT_NASCIMENTO;

            this.DT_ALTERACAO = DateTime.Now;
            this.APROVADO     = false;
        }
Exemplo n.º 19
0
        public override void sense()
        {
            var position        = Context.transform.position;
            var target_position = player.transform.position;

            var   grid     = RG.as_bool(RG.world.world_to_grid(Context.transform.position));
            float distance = Vector3.Distance(player.transform.position, Context.transform.position);

            is_reachable = AStar.solvable(out List <Vector2Int> temp, grid, room.world_to_grid(position), room.world_to_grid(target_position));
            path         = new Stack <Vector2Int>(temp);
            debug        = temp;

            //is_reachable = is_reachable && distance < 8.0f;
        }
Exemplo n.º 20
0
        public void ValidarRG()
        {
            var numero = "11.11.11";

            RG rg = new RG
                {
                    Numero = numero
                };

            var valido = rg.EhValido();

            Assert.IsTrue(valido);

            Assert.AreEqual(numero, rg.Numero);
        }
Exemplo n.º 21
0
    public void InitAroundBase(RDPreset preset, float radius)
    {
        Type targetType = typeof(RDPreset);
        Type ownType    = typeof(RDPresetRandomizer);

        foreach (string property in propertyNames)
        {
            System.Reflection.FieldInfo targetField = targetType.GetField(property);
            System.Reflection.FieldInfo ownField    = ownType.GetField(property);

            float baseValue = ( float )targetField.GetValue(preset);

            RG range = new RG(baseValue, baseValue - radius, baseValue + radius);
            ownField.SetValue(this, range);
        }
    }
Exemplo n.º 22
0
 public RG ProcessDocumento()
 {
     if (_conferenciaDocumentosPoupaTempo.IsValid())
     {
         _rg                 = new RG();
         _rg.Digital         = _coletorDigital.Coletar();
         _rg.Numero          = _registroGeralServices.GetNumero();
         _rg.Fotografia      = _estudioFotografiaPoupaTempo.GetFotoDocumento();
         _rg.DocumentoImagem = _graficaPoupaTempo.GetDocumentoImagem();
         return(_rg);
     }
     else
     {
         throw new Exception("Documentos inválidos para prosseguir.");
     }
 }
Exemplo n.º 23
0
        public USUARIO(Guid ID_USUARIO, string NOME, CPF CPF, RG RG, DateTime DT_NASCIMENTO)
        {
            this.InicializaVariaveis();

            this.ID_USUARIO    = ID_USUARIO;
            this.NOME          = NOME;
            this.CPF           = CPF;
            this.CPF           = CPF;
            this.RG            = RG;
            this.DT_NASCIMENTO = DT_NASCIMENTO;

            this.DT_INCLUSAO  = DateTime.Now;
            this.DT_ORDENACAO = DateTime.Now;

            this.ATIVO       = true;
            this.DT_ATIVACAO = DateTime.Now;
        }
Exemplo n.º 24
0
        public override bool Equals(object obj)
        {
            if (!(obj is Cliente))
            {
                return(false);
            }

            var Cliente = obj as Cliente;

            if (!NomeCompleto.EqualsNormalized(Cliente.NomeCompleto) || !RG.EqualsNormalized(Cliente.RG) ||
                !CPF.EqualsNormalized(Cliente.CPF) || Saldo != Cliente.Saldo || Sexo != Cliente.Sexo || Ativo != Cliente.Ativo)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 25
0
        static void Main(string[] args)
        {
            // Comparação de records
            // Comparando dois registros criados com dados iguais
            var documento1 = new Documento
            {
                Numero = 123456
            };

            var documento2 = new Documento
            {
                Numero = 123456
            };

            var igual = documento1.Equals(documento2);

            Console.WriteLine("******* Value-based equality - Igualdade baseada em valor *******");
            Console.WriteLine();
            Console.WriteLine($"Comparação de objetos diferentes (do mesmo registro) com dados iguais: {igual}");
            igual = documento1.GetHashCode().Equals(documento2.GetHashCode());
            Console.WriteLine($"Comparação de Hash Codes de objetos diferentes (do mesmo registro) com dados iguais: {igual}");

            // Comparação de records com herança
            // Comparando um registro criado pela registro base e outro criado pelo registro derivado
            var rg1 = new Documento
            {
                Numero = 123456
            };

            var rg2 = new RG
            {
                Numero         = 123456,
                OrgaoExpedidor = "SSP"
            };

            igual = rg1.Equals(rg2);
            Console.WriteLine($"Comparação de objetos diferentes (registro base X registro derivado) com dados iguais: {igual}");

            Console.WriteLine();
            Console.WriteLine("******* Positional records - Registros Posicionais *******");
            var previsaoTempo = new PrevisaoTempo(10.9m, 65.5m);

            var(temperatura, umidade) = previsaoTempo;
            Console.WriteLine($"Temperatura: {temperatura}ºC | Umidade: {umidade}%");
        }
Exemplo n.º 26
0
        void ChangeTrayWindowLocation()
        {
            App.Current.Dispatcher.Invoke(() =>
            {
                if (_trayWin == null)
                {
                    return;
                }

                //获取托盘图标位置
                RG rg = GetIconRect(_trayIcon);

                //计算弹框的位置,使其在托盘图标的正上方中间的位置
                double y      = SystemParameters.WorkArea.Height;
                _trayWin.Top  = y - _trayWin.ActualHeight + 5;
                _trayWin.Left = rg.Left - (_trayWin.ActualWidth / 2) + (rg.Width / 2);
            });
        }
Exemplo n.º 27
0
    public void Apply(RDPreset preset)
    {
        Type targetType = typeof(RDPreset);
        Type ownType    = typeof(RDPresetRandomizer);

        foreach (string property in propertyNames)
        {
            System.Reflection.FieldInfo targetField = targetType.GetField(property);
            System.Reflection.FieldInfo ownField    = ownType.GetField(property);

            RG range = ( RG )ownField.GetValue(this);

            // Randomize
            range.Fuzzy();

            targetField.SetValue(preset, range.value);
        }
    }
Exemplo n.º 28
0
        static void Main(string[] args)
        {
            string Nome, RG, RG_Masc, Telefone, Tel_Masc;
            int    PosNome, PosParenteses;
            double Nota;

            Console.Write("Digite o nome do aluno: ");
            Nome = Console.ReadLine();

            Console.Write("\nDigite o RG do aluno: ");
            RG = Console.ReadLine();

            Console.Write("\nDigite o Telefone do aluno: ");
            Telefone = Console.ReadLine();

            Console.Write("\nDigite a Nota do aluno: ");
            Nota = Double.Parse(Console.ReadLine());

            PosNome = Nome.IndexOf(' ');
            RG_Masc = RG.Replace(RG.Substring(RG.Length - 2, 2), "**");

            try
            {
                PosParenteses = Telefone.IndexOf(")");
                if (PosParenteses > 0)
                {
                    Tel_Masc = Telefone.Replace(Telefone.Substring(PosParenteses + 2, 5), "*****");
                }
                else
                {
                    Tel_Masc = Telefone.Replace(Telefone.Substring(0, 5), "*****");
                }
            }
            catch
            {
                Tel_Masc = Telefone.Replace(Telefone.Substring(0, 5), "*****");
            }

            Console.Write("\nNome: " + Nome.Substring(0, PosNome));
            Console.Write("\nRG: " + RG_Masc);
            Console.Write("\nTelefone: " + Tel_Masc);

            Console.ReadKey();
        }
Exemplo n.º 29
0
    public void InitAroundBase(RDPreset preset, PropValueKey[] pairs)
    {
        Type targetType = typeof(RDPreset);
        Type ownType    = typeof(RDPresetRandomizer);

        foreach (PropValueKey pair in pairs)
        {
            string property = pair.prop;
            float  radius   = ( float )pair.value;

            System.Reflection.FieldInfo targetField = targetType.GetField(property);
            System.Reflection.FieldInfo ownField    = ownType.GetField(property);

            float baseValue = ( float )targetField.GetValue(preset);

            RG range = new RG(baseValue, baseValue - radius, baseValue + radius);
            ownField.SetValue(this, range);
        }
    }
Exemplo n.º 30
0
        public Supplier(string name, CPFCNPJ cPFCNPJ, ICollection <Phone> phones, Company company, Guid id, DateTimeOffset?birthDate = null, RG rg = null)
        {
            Id           = id;
            Name         = name;
            CPFCNPJ      = cPFCNPJ;
            CreationDate = DateTimeOffset.Now;
            Phones       = phones;
            Company      = company;

            if (CPF.IsCpf(cPFCNPJ))
            {
                BirthDate = birthDate;
                RG        = rg;
                if (BirthDate == null || RG == null)
                {
                    throw new InvalidOperationException("Birthdate and RG must be provided for private individual");
                }
            }
        }
        public Cliente AsEntity()
        {
            var nome           = new Nome(Nome, Sobrenome);
            var rg             = new RG(RG);
            var cpf            = new CPF(CPF);
            var dataNascimento = new DataNascimento(DataNascimento);
            var email          = new Email(Email);
            var enderecos      = Enderecos.Select(e => new Endereco(
                                                      e.Rua,
                                                      e.Numero,
                                                      e.Cidade,
                                                      e.Estado,
                                                      e.Pais,
                                                      e.Cep?.Replace("-", string.Empty),
                                                      e.Complemento,
                                                      e.Observacoes,
                                                      e.Tipo
                                                      ));

            return(new Cliente(nome, rg, cpf, dataNascimento, email, enderecos.ToList()));
        }