Example #1
0
        public XFrmAddFuncionario(Funcionario funcionario, FormTypeAction action = FormTypeAction.Nenhum) : this()
        {
            this.funcAnt                = this.indexarFuncionario(funcionario);
            this.cbSituacao.ReadOnly    = false;
            this.dtDataAdmissao.Enabled = false;
            this.cbDepartamento.Enabled = false;
            this.cbFuncao.Enabled       = false;
            this.cbSituacao.Enabled     = false;
            this.txtSalario.Enabled     = false;

            var q = from p in funcionario.Eventos.Where(e => e.Removed == false)
                    select new EventoFuncionario()
            {
                Evento = p.Evento, IdEvento = p.IdEvento, Valor = p.Valor, IdFuncionario = p.IdFuncionario, IdRegistro = p.IdRegistro, Removed = p.Removed
            };

            this.eventosFuncionario = q.ToList();

            gridControlEvtFunc.DataSource = this.eventosFuncionario;

            if (action == FormTypeAction.Visualizar)
            {
                ComponenteUtil.DesabilitarComponentes(new Component[] { this.ribbon,
                                                                        this.navPaneHistoricoPai,
                                                                        this.navPaneHistDepartamento, this.navPaneHistFuncao, this.navPaneHistSalarial,
                                                                        this.navPaneInfoPessoais, this.navPaneEndereco, this.navPaneCTPS, navPaneDadosAdmissionais, navPaneDocumentos });
            }
        }
Example #2
0
        //Edição da nota fiscal
        public XFrmNotaFiscal(Movimento capaNF, FormTypeAction formTypeAction, TypeFiltroMovimento typeFiltroMovimento, Usuario currentUser) : this()
        {
            this.capa                = capaNF;
            this.formTypeAction      = formTypeAction;
            this.currentUser         = currentUser;
            this.typeFiltroMovimento = typeFiltroMovimento;
            this.lookUpTipoMovimento1.TypeFiltroMovimento = typeFiltroMovimento;
            btnEditNF.Visible = true;
            //deixar readyOnly os textEdits
            ComponenteUtil.ReadyOnly(true, getComponents()[0]);
            //desabilitar os componentes
            ComponenteUtil.DesabilitarComponentes(getComponents()[1]);
            //desabilitar os lookups ITS
            lookUpCentroCusto1.ReadOnlyMode();
            lookUpFormaPagamento1.ReadOnlyMode();
            lookUpMatrizFilial1.ReadyOnlyMode();
            lookUpCliFor1.ReadOnlyMode();
            lookUpTipoMovimento1.ReadOnlyMode();
            lookUpModeloDocFiscal1.ReadOnlyMode();
            lookUpLocalEstoque1.ReadOnlyMode();
            //desabilitar a ediçao se houver alguma parcela paga
            if (isParcelasPagas(capaNF) || capa.TipoMovimento.CategoriaTipoMovimento == TypeCategoriaTipoMovimento.Transferencia)
            {
                btnEditNF.Enabled = false;

                if (capa.TipoMovimento.CategoriaTipoMovimento == TypeCategoriaTipoMovimento.Transferencia)
                {
                    lbMensagem.Visible = true;
                }
            }
        }
Example #3
0
        private void ReadyOnlyMode()
        {
            //esse atalho so eh permitido na atualização
            FormsUtil.AddShortcutEscapeOnDispose(this);

            lookUpCentroCusto1.ReadOnlyMode();
            lookUpCliFor1.ReadOnlyMode();
            lookUpFilial1.ReadOnlyMode();
            ComponenteUtil.ReadyOnly(true,
                                     rdTipoLanc,
                                     cbStatusLancamento,
                                     cbFormaPagto,
                                     dtEditEmissao,
                                     dtEditPagamento,
                                     dtEditVencimento,
                                     txtValorLancamento,
                                     txtValorJuros,
                                     richObs);
            this.gridView1.OptionsBehavior.Editable = false;

            if (this._currentUser.IsAdmin == false)
            {
                this.barBtnAnexar.Enabled      = false;
                this.barBtnDigitalizar.Enabled = false;
                this.btnRemoveAnexo.Visible    = false;
            }
            this.btnSalvar.Text = "OK";
        }
Example #4
0
 private void cbTipoColeta_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbTipoColeta.SelectedIndex == (int)TypeAtendimento.PontoAtendimento)
     {
         ComponenteUtil.DesabilitarComponentes(barBtnAddEndereco);
     }
     else
     {
         ComponenteUtil.HabilitarComponentes(barBtnAddEndereco);
     }
 }
Example #5
0
 private void bntEditar_Click(object sender, EventArgs e)
 {
     //deixa readyOnly false
     ComponenteUtil.ReadyOnly(false, getComponents()[0]);
     //ativa os outros componentes
     ComponenteUtil.HabilitarComponentes(getComponents()[1]);
     //habilitar os lookups ITS
     lookUpCentroCusto1.ReadOnlyMode(false);
     lookUpFormaPagamento1.ReadOnlyMode(false);
     lookUpMatrizFilial1.ReadyOnlyMode(false);
     lookUpCliFor1.ReadOnlyMode(false);
     lookUpTipoMovimento1.ReadOnlyMode(false);
     lookUpLocalEstoque1.ReadOnlyMode(false);
     btnSalvar.Enabled = true;
 }
Example #6
0
        private void indexarDados(Produto pro)
        {
            txtDescricao.Text = pro.DescricaoProduto;

            ComboBoxUtil.AddItem <CategoriaProduto>(cbCategoriaProduto, pro.CategoriaProduto);
            ComboBoxUtil.AddItem <UnidadeMedida>(cbUnidadeMed, pro.UnidadeMedida);
            cbStatusProduto.SelectedIndex = (int)pro.StatusProduto;

            ComponenteUtil.ReadyOnly(true,
                                     cbCategoriaProduto, txtDescricao,
                                     cbUnidadeMed, cbStatusProduto);

            pictureFotoProduto.Image = ImageUtilIts.GetImageFromBytes(pro.FotoProduto);
            txtCodigoBarras.Text     = pro.CodigoBarras;
        }
Example #7
0
        private void showConfirmationProposta()
        {
            //Flag para ativar a Thread
            IsSucess = true;

            //desabilite tudo
            ComponenteUtil.DesabilitarComponentes(new Component[]  {
                barBtbFinalizar, txtDesconto, lblTotalVenda,
                txtDesconto
            });

            //Task para exibir mensagem de impressao
            //Task.Run(() => this.showMessagePrintProposta());

            Task.Run(() => ilustrador.RunOscillate());
        }
        private void InativarComponentes()
        {
            lookUpFilial1.Enabled        = false;
            lookUpContaBancaria1.Enabled = false;

            lookUpFilial2.Enabled        = false;
            lookUpContaBancaria2.Enabled = false;

            ComponenteUtil.DesabilitarComponentes(new Component[]
            {
                lookUpCentroCusto1,
                lookUpContaBancaria1,
                lookUpFilial1,
                cbOperacao,
                dtExtrato,
                txtValorExtrato
            });
        }
Example #9
0
        private void showConfirmationProposta()
        {
            //Flag para ativar a Thread
            this.IsSucess = true;
            this._cts     = new CancellationTokenSource();
            //desabilite tudo
            ComponenteUtil.DesabilitarComponentes(new Component[]  {
                barManager1, groupBoxReceb,
                barBtnVoltar,
                barBtbFinalizar, txtDesconto, lblTotalVenda,
                txtDesconto
            });

            //Task para exibir mensagem de impressao
            //Task.Run(() => this.showMessagePrintProposta());

            Task.Run(() => _ilustrador.Run());
        }
Example #10
0
        private void setProdutoEditavel(Produto p)
        {
            using (var ctx = new BalcaoContext())
            {
                try
                {
                    var i = ctx.ItemVendaDao.First(it => it.IdProduto == p.IdProduto);


                    //nao deixe editar nada se tem venda vinculada
                    ComponenteUtil.ReadyOnly(true, cbStatusProduto,
                                             txtCodigoBarras,
                                             txtDescricao,
                                             cbCategoriaProduto,
                                             cbUnidadeMed,
                                             radioTipoProduto,
                                             txtComprimento,
                                             txtLargura,
                                             txtEspessura1,
                                             txtEspessura2);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Produto pode ser totalmente editado: " + ex.Message);
                    var data1 = p.DataCadastro;
                    var data2 = DateTime.Now;
                    var prazo = DataUtil.CalcularDias(data1, data2);
                    //vai deixar edita somente se nao tem uma semana q cadastro
                    //7 dias eh o prazo para notar algo errado no cadastro
                    if (prazo >= 7)
                    {
                        ComponenteUtil.ReadyOnly(false, cbStatusProduto,
                                                 txtCodigoBarras,
                                                 txtDescricao,
                                                 cbCategoriaProduto,
                                                 cbUnidadeMed,
                                                 radioTipoProduto);
                    }
                }
            }
        }
Example #11
0
        /// <summary>
        /// Altera uma manutencao
        /// </summary>
        /// <param name="m"></param>
        public XFrmAddManutencao(Manutencao m)
        {
            init();
            this.manutencao = indexarDados(m);

            //somente leitura
            if (this.manutencao.StatusManutencao == TypeStatusManutencao.Encerrado)
            {
                this.btnSalvar.Text      = "OK";
                this.btnCancelar.Visible = false;

                ComponenteUtil.ReadyOnly(true,
                                         this.cbStatus, timeEditDuracao,
                                         this.timeEditDuracao,
                                         this.memoEditReport,
                                         this.cbStatus);

                this.lookUpCentroCusto1.ReadOnlyMode();
                this.searchLookUpCliente.ReadOnly = true;
                this.btnLoadReport.Enabled        = false;

                this.dtEntrega.Enabled = false;
                this.dtInicial.Enabled = false;
                this.dtTermino.Enabled = false;

                this.txtValor.ReadOnly = true;

                this.gridViewItens.OptionsBehavior.Editable = false;
                this.gridViewPCs.OptionsBehavior.Editable   = false;

                //bar 1
                this.barBtnAddPC.Enabled    = false;
                this.barBtnEditarPc.Enabled = false;
                this.barBtnRemovePc.Enabled = false;

                //bar 1
                this.barBtnAddItem.Enabled    = false;
                this.barBtnRemoveItem.Enabled = false;
            }
        }
Example #12
0
 private void ativarComponents()
 {
     ComponenteUtil.HabilitarComponentes(getComponents());
     lookUpMatriz1.ReadyOnlyMode(false);
 }
Example #13
0
 private void desativarComponents()
 {
     ComponenteUtil.DesabilitarComponentes(getComponents());
     lookUpMatriz1.ReadyOnlyMode(true);
 }