Esempio n. 1
0
            public DatosZombie ObtenerZombieInfo()
            {
                gustos = (Partes)Random.Range(0, 4);
                DatosZombie datos = new DatosZombie();

                if (gustos == Partes.sesos)
                {
                    datos.gustos = Partes.sesos;
                    Debug.Log("warrrrr soy un Zombie y quiero comerme tus" + datos.gustos);
                }
                if (gustos == Partes.corazon)
                {
                    datos.gustos = Partes.corazon;
                    Debug.Log("warrrrr soy un Zombie y quiero comerme tu" + datos.gustos);
                }
                if (gustos == Partes.intestinos)
                {
                    datos.gustos = Partes.intestinos;
                    Debug.Log("warrrrr soy un Zombie y quiero comerme tus " + datos.gustos);
                }

                if (gustos == Partes.estomago)
                {
                    datos.gustos = Partes.estomago;
                    Debug.Log("warrrrr soy un Zombie y quiero comerte tu" + datos.gustos);
                }
                if (gustos == Partes.cuello)
                {
                    datos.gustos = Partes.cuello;
                    Debug.Log("warrrrr soy un Zombie y quiero comerte tu" + datos.gustos);
                }
                return(datos);
            }
Esempio n. 2
0
        public int Edit(Partes parte)
        {
            var connectionString = this.GetConnection();
            var count            = 0;

            using (var con = new SqlConnection(connectionString))
            {
                try
                {
                    con.Open();
                    var query = @"update Partes
									set nome = @nome 
									, id_gondola = @id_gondola
									, id_posicao = @id_posicao
									, altura = @altura
									, largura = @largura WHERE id = "                                     + parte.Id;

                    count = con.Execute(query, parte);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                }
                return(count);
            }
        }
Esempio n. 3
0
        private SV_TRANSACTION_HEADER PurchaseHeadTrans(int batch_id)
        {
            SV_BATCH_ARTICLE lote  = lotes.ById(batch_id);
            SV_PART          part  = Partes.ByLotePart(batch_id, 0);
            DateTime         fecha = Partes.FirstDateLote(batch_id, lote.purchase_date);
            var MyHeads            = cabeceras.byPartFechaFix(part.id, fecha);

            return(MyHeads);
        }
Esempio n. 4
0
        public RespuestaAccion GENERAR_CODIGO(int batch_id, GENERIC_VALUE clase)
        {
            var res = new RespuestaAccion();

            try
            {
                //Comprobamos existencia del lote a crearle codigos
                var lote = lotes.ById(batch_id);
                if (lote == null)
                {
                    res.set(-2, "NO EXISTE LOTE");
                    return(res);
                }
                //Comprobamos existencia de codigos ya creados para el lote
                var CurPartes   = Partes.ByLote(batch_id);
                var CurPartesId = CurPartes.Select(l => l.id).ToArray();
                var codigos     = inv_articulos.ByParts(CurPartesId);
                if (!(codigos == null || codigos.Count == 0))
                {
                    res.set(-3, "YA TIENE CODIGOS CREADOS");
                    return(res);
                }
                DateTime fecha_compra = lote.purchase_date;
                string   raiz         = fecha_compra.ToString("yyyyMM") + clase.code.Trim();
                //ingresamos articulos
                foreach (var part in CurPartes)
                {
                    //determinamos cantidad ingresada
                    int cantidad   = part.quantity;
                    int count_raiz = inv_articulos.GetCorrelativoCodigo(raiz);
                    for (int i = 1; i <= cantidad; i++)
                    {
                        string nuevo_code = raiz + (i + count_raiz).ToString("D7");
                        var    nuevo_art  = new ARTICLE();
                        nuevo_art.code         = nuevo_code;
                        nuevo_art.part_id      = part.id;
                        nuevo_art.codigo_old   = string.Empty;  //only keep as reference for legacy inventory
                        nuevo_art.ubicacion_id = 0;             //unknown place by default
                        nuevo_art.desde        = fecha_compra;
                        nuevo_art.hasta        = _final_date;   //has default value in DB
                        _context.ARTICLES.AddObject(nuevo_art);
                        _context.SaveChanges();

                        res.result_objs.Add(nuevo_art);
                    }
                }

                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
        public int Insert_Integrativa_Partes(Partes Reg)
        {
            int _id = 0;

            using (Integrativa_Context db = new Integrativa_Context(_connection)) {
                try {
                    db.Partes.Add(Reg);
                    db.SaveChanges();
                    _id = Reg.Idparte;
                } catch {
                }
                return(_id);
            }
        }
Esempio n. 6
0
        public int Add(Partes parte)
        {
            var connectionString = this.GetConnection();
            int count            = 0;

            using (var con = new SqlConnection(connectionString))
            {
                try
                {
                    con.Open();
                    var query = @"insert into partes
								( nome
								, id_gondola
								, id_posicao
								, altura
								, largura
								)
								values
								( @nome
								, @id_gondola
								, @id_posicao
								, @altura
								, @largura
								); SELECT CAST(SCOPE_IDENTITY() as INT); "                                ;

                    count = con.Execute(query, parte);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                }
                return(count);
            }
        }
        private void btnFinalizar_Click(object sender, EventArgs e)
        {
            if (txtNome.Text != String.Empty)
            {
                i    += 1;
                parte = new Partes(txtNome.Text, txtNomePai.Text, txtNomeMae.Text, txtTelefone.Text, txtEndereco.Text, txtBairro.Text,
                                   txtCidade.Text, txtNumero.Text, Convert.ToInt32(cmbEstado.SelectedValue), txtRg.Text, dtpDataNascimento.Text, Convert.ToInt32(cmbOrgaoEmissor.SelectedValue),
                                   Convert.ToInt32(cmbOrgaoEmissorUf.SelectedValue), cmbTipoParte.Text, cmbConduzido.Text, txtNaturalidade.Text, txtNacionalidade.Text, idBoletim);

                parte.Emissao_Rg      = dtpDataExpedicaoRg.Text;
                parte.Cnh             = txtCnh.Text;
                parte.RegCnh          = txtRegCnh.Text;
                parte.Validade_cnh    = dtpValidadeCnh.Text;
                parte.Categoria       = Convert.ToInt32(cmbCategoria.SelectedValue);
                parte.Cpf             = txtCpf.Text;
                parte.Celular         = txtCelular.Text;
                parte.Cep             = txtCep.Text;
                parte.Complemento     = txtComplemento.Text;
                parte.Local_Trabalho  = txtLocalTrabalho.Text;
                parte.Numero_Trabalho = txtNumTrabalho.Text;
                parte.Bairro_Trabalho = txtBairroTrabalho.Text;
                parte.Cidade_Trabalho = txtCidadeTrabalho.Text;
                parte.Profissao       = txtProfissao.Text;
                parte.Tel_Comercial   = txtTelComercial.Text;
                parte.VersaoParte     = txtVersao.Text;
                parte.Naturalidade    = txtNaturalidade.Text;
                addParte.Add(parte);
            }
            if (addParte.Count > 0)
            {
                _boletimOcorrenciaServices.CadastrarParte(addParte);
            }
            LimparDadosBO();
            LimparDadosParte();
            i         = 0;
            idBoletim = 0;
        }
Esempio n. 8
0
        public Partes Get(int id)
        {
            var    connectionString = this.GetConnection();
            Partes parte            = new Partes();

            using (var con = new SqlConnection(connectionString))
            {
                try
                {
                    con.Open();
                    var query = "SELECT * FROM Partes WHERE id =" + id;
                    parte = con.Query <Partes>(query).FirstOrDefault();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                }
                return(parte);
            }
        }
        private void btnNovaParte_Click(object sender, EventArgs e)
        {
            parte = new Partes(txtNome.Text, txtNomePai.Text, txtNomeMae.Text, txtTelefone.Text, txtEndereco.Text, txtBairro.Text,
                               txtCidade.Text, txtNumero.Text, Convert.ToInt32(cmbEstado.SelectedValue), txtRg.Text, dtpDataNascimento.Text, Convert.ToInt32(cmbOrgaoEmissor.SelectedValue),
                               Convert.ToInt32(cmbOrgaoEmissorUf.SelectedValue), cmbTipoParte.Text, cmbConduzido.Text, txtNaturalidade.Text, txtNacionalidade.Text, idBoletim);
            parte.Emissao_Rg      = dtpDataExpedicaoRg.Text;
            parte.Cnh             = txtCnh.Text;
            parte.RegCnh          = txtRegCnh.Text;
            parte.Validade_cnh    = dtpValidadeCnh.Text;
            parte.Categoria       = Convert.ToInt32(cmbCategoria.SelectedValue);
            parte.Cpf             = txtCpf.Text;
            parte.Celular         = txtCelular.Text;
            parte.Cep             = txtCep.Text;
            parte.Complemento     = txtComplemento.Text;
            parte.Local_Trabalho  = txtLocalTrabalho.Text;
            parte.Numero_Trabalho = txtNumTrabalho.Text;
            parte.Bairro_Trabalho = txtBairroTrabalho.Text;
            parte.Cidade_Trabalho = txtCidadeTrabalho.Text;
            parte.Profissao       = txtProfissao.Text;
            parte.Tel_Comercial   = txtTelComercial.Text;
            parte.VersaoParte     = txtVersao.Text;

            var resposta = MessageBox.Show("Deseja cadastrar uma nova parte para o mesmo B.O.?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (resposta == DialogResult.Yes)
            {
                i += 1;
                addParte.Add(parte);
                LimparDadosParte();
            }
            else
            {
                grbPartes.Enabled = false;
                // LimparDadosParte();
            }
        }
Esempio n. 10
0
 public ItemBinario()
 {
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.Int));
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.Int));
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.String));
 }
Esempio n. 11
0
        //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        public Partes ParteGetLast()
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "ParteGetLast").Tables[0];
                Partes NewEnt = new Partes();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt = CargarParte(dr);
                }
                return NewEnt;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        private Partes CargarParte(DataRow dr)
		{
			try
			{
				Partes oObjeto = new Partes();
                ClientesImpl oClientesImpl = new ClientesImpl();
                AreasImpl oAreaImpl = new AreasImpl();
                YacimientosImpl oYacimientosImpl = new YacimientosImpl();
                TareasImpl oTareasImpl = new TareasImpl();
                EquiposImpl oEquiposImpl = new EquiposImpl();


				oObjeto.IdParte = Int32.Parse(dr["IdParte"].ToString());
				oObjeto.Fecha = DateTime.Parse(dr["Fecha"].ToString());
				oObjeto.Numero = Int32.Parse(dr["Numero"].ToString());
                oObjeto.IdEquipo = (Int32.Parse(dr["IdEquipo"].ToString()));
				oObjeto.IdPickUp = (Int32.Parse(dr["IdPickUp"].ToString()));
				oObjeto.IdVehiculoCL = (Int32.Parse(dr["IdVehiculoCL"].ToString()));
				oObjeto.oIdCliente = oClientesImpl.ClientesGetById(Int32.Parse(dr["IdCliente"].ToString()));
				oObjeto.oIdArea = oAreaImpl.AreasGetById(Int32.Parse(dr["IdArea"].ToString()));
				oObjeto.oIdYacimiento = oYacimientosImpl.YacimientosGetById(Int32.Parse(dr["IdYacimiento"].ToString()));
				oObjeto.Pozo = dr["Pozo"].ToString();
				oObjeto.Bateria = dr["Bateria"].ToString();
				oObjeto.IdOperador = (dr["IdOperador"].ToString());
				oObjeto.IdAyudante = (dr["IdAyudante"].ToString());
				oObjeto.IdChoferCL = (dr["IdChoferCL"].ToString());
				oObjeto.Baja = Boolean.Parse(dr["Baja"].ToString());
				oObjeto.HoraInicio = DateTime.Parse(dr["HoraInicio"].ToString());
				oObjeto.HoraFin = DateTime.Parse(dr["HoraFin"].ToString());
				oObjeto.IdTareas = (dr["IdTareas"].ToString());
				oObjeto.KmEquipoAdic = Int32.Parse(dr["KmEquipoAdic"].ToString());
				oObjeto.Automatico = Boolean.Parse(dr["Automatico"].ToString());
				oObjeto.Inspector = dr["Inspector"].ToString();
				oObjeto.Observaciones = dr["Observaciones"].ToString();
				oObjeto.Zona = dr["Zona"].ToString();
				
				return oObjeto;
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
        public string GeraJsonProcesso(string parametros)
        {
            string retorno = string.Empty;

            Andamentos andamentos = new Andamentos();
            Documentos documentos = new Documentos();
            Partes     partes     = new Partes();
            Prazos     prazos     = new Prazos();

            if (parametros != string.Empty)
            {
                string[] pRecebidos = parametros.Split('|');

                /*
                 * ${Processo} ok
                 * ${OrgaoJulgador} ok
                 * ${Autuacao} ok dt Cadastro
                 * ${Cliente} ok : réu?
                 * ${Area} --
                 * ${Assunto}
                 * ${Polopassivo}|${TipoOutraParte}|${PoloAtivo}|${PAcpfCnpj}|${PAEndereco}|${ValorCausa}|${AndamentosProcesso}|${DataAudiencia}|${HoraAudiencia}|${TipoAudiencia}|${ValorComplementar01}|${PAAdvogado}|${Magistrado}|${Link}|${oab}|${ufoab}
                 *
                 *
                 */



                API max = new API();
                max.AdvogadoResponsavel       = "";
                max.AdvogadoResponsavelEstado = "";



                andamentos.Cobravel       = "";
                andamentos.DtAndamento    = "";
                andamentos.DtCadastro     = "";
                andamentos.TextoAndamento = "";
                andamentos.TipoAndamento  = "";
                andamentos.UserCadastro   = "";

                max.Andamentos = new List <Andamentos>();

                max.Andamentos.Add(andamentos);
                max.Citacao            = "";
                max.CNPJCliente        = "";
                max.CNPJCorrespondente = "";
                max.Comarca            = pRecebidos[1].Trim().Length > 0 ? pRecebidos[1].Trim() : "";
                max.Competencia        = pRecebidos[1].Trim().Length > 0 ? pRecebidos[1].Trim() : "";
                max.ControleCliente    = "";
                max.Correspondente     = "";


                documentos.AccessKeyID       = "";
                documentos.BucketName        = "";
                documentos.DtCadastro        = "";
                documentos.HostFTP           = "";
                documentos.NomeArquivo       = "";
                documentos.NomeArquivoWeb    = "";
                documentos.Pasta             = "";
                documentos.PastaFTP          = "";
                documentos.Region            = "";
                documentos.SecretAccessKeyID = "";
                documentos.SenhaFTP          = "";
                documentos.TipoDocumento     = "";
                documentos.UserCadastro      = "";
                documentos.UsuarioFTP        = "";

                max.Documentos = new List <Documentos>();
                max.Documentos.Add(documentos);

                max.DtCadastro             = DateTime.Now.ToShortDateString().Trim();
                max.DtCitacao              = "";
                max.DtDistribuicao         = pRecebidos[2].Trim().Length > 0 ? pRecebidos[2].Trim() : "";
                max.DtTerceirizacao        = "";
                max.MotivoEstrategico      = "";
                max.NomeCliente            = "";
                max.Nucleo                 = "";
                max.NumProcesso            = (pRecebidos[0].Trim().Length > 0 ? pRecebidos[0].Trim() : "");
                max.NumProcessoCNJ         = (pRecebidos[0].Trim().Length > 0 ? pRecebidos[0].Trim() : "");
                max.NumProcessoNovo        = (pRecebidos[0].Trim().Length > 0 ? pRecebidos[0].Trim() : "");
                max.OABAdvogadoResponsavel = "";
                max.Observacao             = "";



                partes.AdvParteContraria = "";
                partes.Bairro            = "";
                partes.CEP                    = "";
                partes.Cidade                 = "";
                partes.Cliente                = "";
                partes.Complemento            = "";
                partes.DocParte               = "";
                partes.DtNascimento           = "";
                partes.Email                  = "";
                partes.Endereco               = "";
                partes.Filiacao               = "";
                partes.NomeParte              = "";
                partes.NumEndereco            = "";
                partes.OABAdvParteContraria   = "";
                partes.Telefone               = "";
                partes.TipoParte              = "";
                partes.UFCidade               = "";
                partes.UFOABAdvParteContraria = "";

                max.Partes = new List <Partes>();
                max.Partes.Add(partes);


                prazos.DescPrazo      = "";
                prazos.DtCadastro     = "";
                prazos.DtPrazo        = "";
                prazos.DtPublicacao   = "";
                prazos.HoraAudiencia  = "";
                prazos.LocalAudiencia = "";
                prazos.Peremptorio    = "";
                prazos.TipoAudiencia  = "";
                prazos.TipoPrazo      = "";
                prazos.UserCadastro   = "";

                max.Prazos = new List <Prazos>();
                max.Prazos.Add(prazos);

                max.ProcEletronico  = "";
                max.ProcEstrategico = "";
                max.Segmento        = "";
                max.TipoAcao        = "";
                max.UFComarca       = "";
                max.UserCadastro    = "";
                max.ValorCausa      = "";
                max.Vara            = "";


                retorno = JsonConvert.SerializeObject(max);
            }


            return(retorno);
        }
        private void Grava_Dados()
        {
            Sistema_bll    sistema_Class    = new Sistema_bll(_connection);
            Tributario_bll tributario_Class = new Tributario_bll(_connection);

            GTI_Models.modelCore.TipoCadastro _tipo_cadastro = sistema_Class.Tipo_Cadastro(_codigo);

            Contribuinte_Header_Struct _header = sistema_Class.Contribuinte_Header(_codigo);

            string _tipo_divida = _tipo_cadastro == GTI_Models.modelCore.TipoCadastro.Imovel ? "Imobiliário" :
                                  _tipo_cadastro == GTI_Models.modelCore.TipoCadastro.Cidadao ? "Taxas Diversas" : "Mobiliário";
            int _certidao = tributario_Class.Retorna_Ultima_Certidao_Livro(_numero_livro);
            int _pagina   = _certidao;

            Cdas regCda = new Cdas()
            {
                Iddevedor    = _codigo.ToString(),
                Setordevedor = _tipo_divida,
                Dtinscricao  = Convert.ToDateTime(DataInscricaoText.Text),
                Nrocertidao  = _certidao,
                Nrolivro     = _numero_livro,
                Nrofolha     = _pagina,
                Dtgeracao    = DateTime.Now
            };
            Integrativa_bll integrativa_Class = new Integrativa_bll(_connection_integrativa);
            int             _idCda            = integrativa_Class.Insert_Integrativa_Cda(regCda);

            if (_tipo_cadastro != GTI_Models.modelCore.TipoCadastro.Cidadao)
            {
                Cadastro regCadastro = new Cadastro()
                {
                    Idcda              = _idCda,
                    Setordevedor       = _tipo_divida,
                    Crc                = _codigo,
                    Nome               = _header.Nome,
                    Inscricao          = _header.Inscricao,
                    Cpfcnpj            = _header.Cpf_cnpj,
                    Rginscrestadual    = _header.Rg,
                    Localcep           = _header.Cep,
                    Localendereco      = _header.Endereco,
                    Localnumero        = _header.Numero,
                    Localcomplemento   = _header.Complemento,
                    Localbairro        = _header.Nome_bairro,
                    Localcidade        = _header.Nome_cidade,
                    LocalEstado        = _header.Nome_uf,
                    Quadra             = _header.Quadra_original,
                    Lote               = _header.Lote_original,
                    Entregacep         = _header.Cep_entrega,
                    Entregaendereco    = _header.Endereco_entrega,
                    Entreganumero      = _header.Numero_entrega,
                    Entregabairro      = _header.Nome_bairro_entrega,
                    Entregacomplemento = _header.Complemento_entrega,
                    Entregacidade      = _header.Nome_cidade_entrega,
                    Entregaestado      = _header.Nome_uf_entrega,
                    Dtgeracao          = DateTime.Now
                };
                integrativa_Class = new Integrativa_bll(_connection_integrativa);
                int _idCadastro = integrativa_Class.Insert_Integrativa_Cadastro(regCadastro);
            }
            else
            {
                Partes regPartes = new Partes()
                {
                    Idcda           = _idCda,
                    Tipo            = "Principal",
                    Crc             = _codigo,
                    Nome            = _header.Nome,
                    Cpfcnpj         = _header.Cpf_cnpj,
                    Rginscrestadual = _header.Rg,
                    Cep             = _header.Cep,
                    Endereco        = _header.Endereco,
                    Numero          = _header.Numero,
                    Complemento     = _header.Complemento,
                    Bairro          = _header.Nome_bairro,
                    Cidade          = _header.Nome_cidade,
                    Estado          = _header.Nome_uf,
                    Dtgeracao       = DateTime.Now
                };
                integrativa_Class = new Integrativa_bll(_connection_integrativa);
                int _idPartes = integrativa_Class.Insert_Integrativa_Partes(regPartes);
            }
            Imovel_bll  imovel_Class  = new Imovel_bll(_connection);
            Cidadao_bll cidadao_Class = new Cidadao_bll(_connection);
            Empresa_bll empresa_class = new Empresa_bll(_connection);

            if (_tipo_cadastro == GTI_Models.modelCore.TipoCadastro.Imovel)
            {
                List <ProprietarioStruct> ListaPropImovel = imovel_Class.Lista_Proprietario(_codigo);
                foreach (ProprietarioStruct item in ListaPropImovel)
                {
                    CidadaoStruct _cidadao  = cidadao_Class.Dados_Cidadao(item.Codigo);
                    Partes        regPartes = new Partes()
                    {
                        Idcda           = _idCda,
                        Tipo            = item.Principal ? "Principal" : "Compromissário",
                        Crc             = _codigo,
                        Nome            = _cidadao.Nome,
                        Cpfcnpj         = string.IsNullOrWhiteSpace(_cidadao.Cnpj) ? _cidadao.Cpf : _cidadao.Cnpj,
                        Rginscrestadual = _cidadao.Rg,
                        Dtgeracao       = DateTime.Now
                    };
                    if (_cidadao.EtiquetaR == "C")
                    {
                        regPartes.Cep         = _cidadao.CepC.ToString();
                        regPartes.Endereco    = _cidadao.EnderecoC;
                        regPartes.Numero      = _cidadao.NumeroC;
                        regPartes.Complemento = _cidadao.ComplementoC;
                        regPartes.Bairro      = _cidadao.NomeBairroC;
                        regPartes.Cidade      = _cidadao.NomeCidadeC;
                        regPartes.Estado      = _cidadao.UfC;
                    }
                    else
                    {
                        regPartes.Cep         = _cidadao.CepR.ToString();
                        regPartes.Endereco    = _cidadao.EnderecoR;
                        regPartes.Numero      = _cidadao.NumeroR;
                        regPartes.Complemento = _cidadao.ComplementoR;
                        regPartes.Bairro      = _cidadao.NomeBairroR;
                        regPartes.Cidade      = _cidadao.NomeCidadeR;
                        regPartes.Estado      = _cidadao.UfR;
                    }
                    integrativa_Class = new Integrativa_bll(_connection_integrativa);
                    int _idPartes = integrativa_Class.Insert_Integrativa_Partes(regPartes);
                }
            }
            else
            {
                if (_tipo_cadastro == GTI_Models.modelCore.TipoCadastro.Empresa)
                {
                    List <CidadaoStruct> ListaSocio = empresa_class.ListaSocio(_codigo);
                    foreach (CidadaoStruct item in ListaSocio)
                    {
                        CidadaoStruct _cidadao  = cidadao_Class.Dados_Cidadao(item.Codigo);
                        Partes        regPartes = new Partes()
                        {
                            Idcda           = _idCda,
                            Tipo            = "Sócio",
                            Crc             = _codigo,
                            Nome            = _cidadao.Nome,
                            Cpfcnpj         = string.IsNullOrWhiteSpace(_cidadao.Cnpj) ? _cidadao.Cpf : _cidadao.Cnpj,
                            Rginscrestadual = _cidadao.Rg,
                            Dtgeracao       = DateTime.Now
                        };
                        if (_cidadao.EtiquetaR == "C")
                        {
                            regPartes.Cep         = _cidadao.CepC.ToString();
                            regPartes.Endereco    = _cidadao.EnderecoC;
                            regPartes.Numero      = _cidadao.NumeroC;
                            regPartes.Complemento = _cidadao.ComplementoC;
                            regPartes.Bairro      = _cidadao.NomeBairroC;
                            regPartes.Cidade      = _cidadao.NomeCidadeC;
                            regPartes.Estado      = _cidadao.UfC;
                        }
                        else
                        {
                            regPartes.Cep         = _cidadao.CepR.ToString();
                            regPartes.Endereco    = _cidadao.EnderecoR;
                            regPartes.Numero      = _cidadao.NumeroR;
                            regPartes.Complemento = _cidadao.ComplementoR;
                            regPartes.Bairro      = _cidadao.NomeBairroR;
                            regPartes.Cidade      = _cidadao.NomeCidadeR;
                            regPartes.Estado      = _cidadao.UfR;
                        }
                        integrativa_Class = new Integrativa_bll(_connection_integrativa);
                        int _idPartes = integrativa_Class.Insert_Integrativa_Partes(regPartes);
                    }
                }
            }

            foreach (ListViewItem linha in MainListView.Items)
            {
                short _ano   = Convert.ToInt16(linha.Text);
                short _lanc  = Convert.ToInt16(linha.SubItems[1].Text.Substring(0, 2));
                short _seq   = Convert.ToInt16(linha.SubItems[2].Text);
                byte  _parc  = Convert.ToByte(linha.SubItems[3].Text);
                byte  _compl = Convert.ToByte(linha.SubItems[4].Text);

                Exception ex = tributario_Class.Inscrever_Divida_Ativa(_codigo, _ano, _lanc, _seq, _parc, _compl, _numero_livro, _pagina, _certidao, Convert.ToDateTime(DataInscricaoText.Text));

                foreach (SpExtrato item in _listaTributo)
                {
                    if (item.Anoexercicio == _ano && item.Codlancamento == _lanc && item.Seqlancamento == _seq && item.Numparcela == _parc && item.Codcomplemento == _compl)
                    {
                        Cdadebitos regCdaDebito = new Cdadebitos()
                        {
                            Idcda        = _idCda,
                            Codtributo   = item.Codtributo,
                            Tributo      = item.Abrevtributo,
                            Exercicio    = _ano,
                            Lancamento   = _lanc,
                            Seq          = _seq,
                            Nroparcela   = _parc,
                            Complparcela = _compl,
                            Dtvencimento = item.Datavencimento,
                            Vlroriginal  = item.Valortributo,
                            Vlrmultas    = item.Valormulta,
                            Vlrjuros     = item.Valorjuros,
                            Vlrcorrecao  = item.Valorcorrecao,
                            Dtgeracao    = DateTime.Now
                        };
                        int _IdCdaDebito = integrativa_Class.Insert_Integrativa_CdaDebito(regCdaDebito);
                    }
                }
            }
        }
Esempio n. 15
0
        /// <summary>
        /// /// Inserir um registro na tabela Partes da Integrativa
        /// </summary>
        /// <param name="Reg"></param>
        /// <returns></returns>
        public int Insert_Integrativa_Partes(Partes Reg)
        {
            Integrativa_Data obj = new Integrativa_Data(_connection);

            return(obj.Insert_Integrativa_Partes(Reg));
        }
Esempio n. 16
0
 public KeyBinarioConId() : base()
 {
     Partes.Add(new ByteArrayBinario());
     Partes.Add(new KeyBinario());
 }
Esempio n. 17
0
        public RespuestaAccion CAMBIO_ZONA(int codigo_articulo, int parte_articulo, DateTime newfecha, GENERIC_VALUE newzona, GENERIC_VALUE newsubzona, int newcantidad, string usuario, List <C.DetalleArticulo> detalle_articulos)
        {
            var res = new RespuestaAccion();

            //TODO: implementar cambio de zona
            try
            {
                //valido que parte existe
                SV_PART partToSell = Partes.ByLotePart(codigo_articulo, parte_articulo);
                if (partToSell == null)
                {
                    res.set(-2, "Activo Fijo no puede ser cambiado, ya que no existe la parte solicitada");
                    return(res);
                }
                //determino si necesito crear una nueva parte para vender
                if (partToSell.quantity > newcantidad)
                {
                    res = CREATE_NEW_PART_FROM(codigo_articulo, partToSell.id, newcantidad, newfecha);
                    if (res.codigo < 0)
                    {
                        return(res);
                    }
                    int newPartId = res.result_objs[0].id;
                    partToSell = Partes.ById(newPartId);
                }

                //determino cabecera vigente
                SV_TRANSACTION_HEADER headPrev = cabeceras.byPartFechaValid(partToSell.id, newfecha);
                if (headPrev == null)
                {
                    res.set(-3, "Activo Fijo no puede ser cambiado, no tiene una transaccion vigente al periodo");
                    return(res);
                }

                //crear nueva cabecera de transaccion
                res = REGISTER_CHANGE_HEAD(partToSell.id, newfecha, newzona, newsubzona, headPrev, usuario);
                //TODO: reporto en log hitos
                if (res.codigo < 0)
                {
                    return(res);
                }
                var headChange = res.result_objs[0];

                //copio los detalles anteriores a la nueva cabecera (no aplico ningun calculo adicional)
                List <SV_TRANSACTION_DETAIL> findDetails = detalles.GetByHead(headPrev.id);
                foreach (var Detail in findDetails)
                {
                    //ingreso detalle
                    res = REGISTER_CHANGE_DETAIL(headChange.id, Detail);
                    if (res.codigo < 0)
                    {
                        return(res);
                    }
                }
                //copio los detalles de valores anteriores a la nueva cabecera (no aplica ningun calculo adicional)
                List <SV_TRANSACTION_PARAMETER_DETAIL> findDetailsParams = DetallesParametros.ByHead(headPrev.id);
                foreach (var DetParam in findDetailsParams)
                {
                    //ingreso detalle de parametros
                    res = REGISTER_PARAM_DETAIL(headChange.id, DetParam.system_id, DetParam.paratemer_id, DetParam.parameter_value);
                    if (res.codigo < 0)
                    {
                        return(res);
                    }
                }
                //actualizo detalles de inventarios
                res = ACTUALIZA_PARTES(detalle_articulos, partToSell.id, newcantidad);
                if (res.codigo < 0)
                {
                    return(res);
                }
                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
Esempio n. 18
0
        private RespuestaAccion baja_act(int codigo_articulo, int parte_articulo, DateTime newfecha, int newcantidad, string usuario, List <C.DetalleArticulo> detalle_articulos, SV_VALIDATY tipo_baja)
        {
            var res = new RespuestaAccion();

            try
            {
                ACode.Vperiodo prev_periodo = new ACode.Vperiodo(newfecha.Year, newfecha.Month) - 1;
                //valido que parte existe
                SV_PART partToDown = Partes.ByLotePart(codigo_articulo, parte_articulo);
                if (partToDown == null)
                {
                    res.set(-2, "Activo Fijo no puede ser vendido, ya que no existe la parte solicitada");
                    return(res);
                }
                //determino si necesito crear una nueva parte para bajar
                if (partToDown.quantity > newcantidad)
                {
                    res = CREATE_NEW_PART_FROM(codigo_articulo, partToDown.id, newcantidad, newfecha);
                    if (res.codigo < 0)
                    {
                        return(res);
                    }
                    int newPartId = res.result_objs[0].id;
                    partToDown = Partes.ById(newPartId);
                }

                //determino cabecera vigente
                SV_TRANSACTION_HEADER headPrev = cabeceras.byPartFechaValid(partToDown.id, newfecha);
                if (headPrev == null)
                {
                    res.set(-3, "Activo Fijo no puede ser dado de baja (" + tipo_baja.name + "), no tiene una transaccion vigente al periodo");
                    return(res);
                }

                //crear nueva cabecera de transaccion
                res = REGISTER_DOWNS_HEAD(partToDown.id, newfecha, headPrev, usuario, tipo_baja);
                //TODO: reporto en log hitos
                if (res.codigo < 0)
                {
                    return(res);
                }

                var headDown   = res.result_objs[0];
                var AllSystems = sistemas.All();
                //agregar valores de detalle y parametros para la cabecera
                foreach (SV_SYSTEM currSys in AllSystems)
                {
                    //compruebo si la transaccion anterior tenía detalle para este ambiente
                    SV_TRANSACTION_DETAIL findDet = detalles.GetByPartSystem(headPrev.id, currSys);
                    if (findDet != null)
                    {
                        //ingreso detalle de transaccion
                        res = REGISTER_DOWNS_DETAIL(headDown.id, currSys.id, tipo_baja);
                        if (res.codigo < 0)
                        {
                            return(res);
                        }

                        if (currSys.ENVIORMENT.depreciation_rate == "daily")
                        {
                            //si deprecio en días (IFRS) debo depreciar solo los dias desde el ultimo cierre
                            var currProc = get_detailed(currSys, prev_periodo.last, codigo_articulo, true, true).FirstOrDefault();
                            if (currProc != null)
                            {
                                //determino los valores de depreciados segun corresponda
                                var depreciado = new DETAIL_DEPRECIATE(currProc, 0, newfecha);
                                //ingreso parametros
                                decimal monto_param;
                                if (depreciado.val_AF_cm != 0)
                                {
                                    SV_PARAMETER currParam = parametros.PrecioBase;
                                    monto_param = depreciado.val_AF_cm / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.DA_AF != 0)
                                {
                                    SV_PARAMETER currParam = parametros.DepreciacionAcum;
                                    monto_param = depreciado.DA_AF / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.credi_adi_cm != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Credito;
                                    monto_param = depreciado.credi_adi_cm / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.deter != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Deterioro;
                                    monto_param = depreciado.deter / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.val_res != 0)
                                {
                                    SV_PARAMETER currParam = parametros.ValorResidual;
                                    monto_param = depreciado.val_res / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.vu_resi != 0)
                                {
                                    SV_PARAMETER currParam = parametros.VidaUtil;
                                    res = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, depreciado.vu_resi);
                                }
                                if (depreciado.preparacion != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Preparacion;
                                    monto_param = depreciado.preparacion / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.transporte != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Transporte;
                                    monto_param = depreciado.transporte / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.montaje != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Montaje;
                                    monto_param = depreciado.montaje / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.desmantelamiento != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Desmantelamiento;
                                    monto_param = depreciado.desmantelamiento / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.honorario != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Honorario;
                                    monto_param = depreciado.honorario / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                                if (depreciado.revalorizacion != 0)
                                {
                                    SV_PARAMETER currParam = parametros.Revalorizacion;
                                    monto_param = depreciado.revalorizacion / depreciado.cantidad;
                                    res         = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, currParam.id, monto_param);
                                }
                            }
                            else
                            {
                                res.set(-4, "No se encontro información vigente para dar de baja");
                                return(res);
                            }
                        }
                        else //if (currSys.ENVIORMENT.depreciation_rate == "monthly")
                        {
                            //copio los detalles de valores anteriores a la nueva cabecera (no aplica ningun calculo adicional)
                            List <SV_TRANSACTION_PARAMETER_DETAIL> findDetailsParams = DetallesParametros.ByHeadSys(headPrev.id, currSys);
                            foreach (var DetParam in findDetailsParams)
                            {
                                //ingreso detalle de parametros
                                res = REGISTER_PARAM_DETAIL(headDown.id, currSys.id, DetParam.paratemer_id, DetParam.parameter_value);
                                if (res.codigo < 0)
                                {
                                    return(res);
                                }
                            }
                        }
                    }
                }
                //actualizo detalles de inventarios
                res = ACTUALIZA_PARTES_HASTA(detalle_articulos, partToDown.id, newcantidad, newfecha);
                if (res.codigo < 0)
                {
                    return(res);
                }
                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
Esempio n. 19
0
File: PART.cs Progetto: akuze18/AFN2
        public RespuestaAccion CREATE_NEW_PART_FROM(int batch_id, int source_part_id, int quantity, DateTime movement_date)
        {
            var res = new RespuestaAccion();

            try
            {
                var source_part       = Partes.ById(source_part_id);
                int current_max_index = Partes.ByLote(batch_id).Max(p => p.part_index);

                //creo nueva parte
                var nueva_parte = new PART();
                nueva_parte.article_id = batch_id;
                nueva_parte.part_index = current_max_index + 1;
                nueva_parte.quantity   = quantity;
                nueva_parte.first_date = movement_date;
                _context.PARTS.AddObject(nueva_parte);

                //actualizo cantidad parte antigua
                var busca = _context.PARTS.Where(p => p.id == source_part_id).FirstOrDefault();
                busca.quantity = source_part.quantity - quantity;

                //copio transacciones a la nueva parte y sus relacionados desde la parte origen
                //copio cabeceras de transacciones
                var source_trx_heads = cabeceras.ByParte(source_part_id);
                foreach (SV_TRANSACTION_HEADER s_trx_head in source_trx_heads)
                {
                    TRANSACTION_HEADER nueva_head = new TRANSACTION_HEADER();
                    nueva_head.PART              = nueva_parte; //con este relacionamos a la nueva parte
                    nueva_head.head_index        = s_trx_head.head_index;
                    nueva_head.trx_ini           = s_trx_head.trx_ini;
                    nueva_head.trx_end           = s_trx_head.trx_end;
                    nueva_head.ref_source        = s_trx_head.ref_source;
                    nueva_head.zone_id           = s_trx_head.zone_id;
                    nueva_head.subzone_id        = s_trx_head.subzone_id;
                    nueva_head.kind_id           = s_trx_head.kind_id;
                    nueva_head.subkind_id        = s_trx_head.subkind_id;
                    nueva_head.category_id       = s_trx_head.category_id;
                    nueva_head.user_own          = s_trx_head.user_own;
                    nueva_head.manage_id         = s_trx_head.manage_id;
                    nueva_head.method_revalue_id = s_trx_head.method_revalue_id;
                    _context.TRANSACTIONS_HEADERS.AddObject(nueva_head);

                    //copio detalles de transacciones
                    var source_trx_details = detalles.GetByHead(s_trx_head.id);
                    foreach (SV_TRANSACTION_DETAIL s_trx_detail in source_trx_details)
                    {
                        TRANSACTION_DETAIL nuevo_detail = new TRANSACTION_DETAIL();
                        nuevo_detail.TRANSACTION_HEADER = nueva_head; //con este relacionamos a la nueva cabecera
                        nuevo_detail.system_id          = s_trx_detail.system_id;
                        nuevo_detail.validity_id        = s_trx_detail.validity_id;
                        nuevo_detail.depreciate         = s_trx_detail.depreciate;
                        nuevo_detail.allow_credit       = s_trx_detail.allow_credit;
                        _context.TRANSACTIONS_DETAILS.AddObject(nuevo_detail);
                    }
                    //copio detalle de parametros de transaccion
                    var source_trx_params = DetallesParametros.ByHead(s_trx_head.id);
                    foreach (SV_TRANSACTION_PARAMETER_DETAIL s_trx_param in source_trx_params)
                    {
                        TRANSACTION_PARAMETER_DETAIL nuevo_param = new TRANSACTION_PARAMETER_DETAIL();
                        nuevo_param.TRANSACTION_HEADER = nueva_head; //con este relacionamos a la nueva cabecera
                        nuevo_param.system_id          = s_trx_param.system_id;
                        nuevo_param.paratemer_id       = s_trx_param.paratemer_id;
                        nuevo_param.parameter_value    = s_trx_param.parameter_value;
                        _context.TRANSACTIONS_PARAMETERS_DETAILS.AddObject(nuevo_param);
                    }
                }
                _context.SaveChanges();
                _load_parts();
                _load_transactions_headers();
                _load_transactions_details();
                _load_transactions_param_details();
                res.result_objs.Add((SV_PART)nueva_parte);

                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
Esempio n. 20
0
 public CrazyItemBinario()
 {
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.Byte));
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.Byte));
     Partes.Add(ElementoBinario.ElementoTipoAceptado(Utilitats.Serializar.TiposAceptados.Byte));
 }
 public BitmapBinario()
 {
     Partes.Add(new ByteArrayBinario());
 }