Ejemplo n.º 1
0
        private bool ExiteEnlaDB()
        {
            repositorio = new RepositorioBase <TiposCuentas>();
            TiposCuentas tiposDeCuentas = repositorio.Buscar((int)IDnumericUpDown.Value);

            return(tiposDeCuentas != null);
        }
Ejemplo n.º 2
0
 public string GetMascaraFromTipoCuenta(TiposCuentas tipo)
 {
     using (var service = FService.Instance.GetService(typeof(TiposCuentasModel), _context) as TiposcuentasService)
     {
         return(service.GetMascara(tipo));
     }
 }
Ejemplo n.º 3
0
        public static List <TiposCuentas> GetTipoCuentas(int idCompany) //yjs 030519
        {
            cadenaConexion = SelectCadena(idCompany);

            List <TiposCuentas> listatipos = new List <TiposCuentas>();

            string sql = "select distinct * from tiposcuentas  ";

            SqlConnection con = new SqlConnection(cadenaConexion);

            con.Open();
            SqlDataAdapter adapter     = new SqlDataAdapter(sql, con);
            DataSet        dsResultado = new DataSet();

            adapter.Fill(dsResultado, "VistaCuenta");
            DataTable tblCliente;

            tblCliente = dsResultado.Tables["VistaCuenta"];

            foreach (DataRow drCurrent in tblCliente.Rows)
            {
                TiposCuentas tipocuenta = new TiposCuentas()
                {
                    idTipoCuenta     = Int32.Parse(drCurrent["idTipoCuenta"].ToString()),
                    descripcion      = drCurrent["descripcion"].ToString(),
                    asientosmanuales = bool.Parse(drCurrent["asientosmanuales"].ToString()),
                    activo           = bool.Parse(drCurrent["activo"].ToString())
                };

                listatipos.Add(tipocuenta);
            }
            return(listatipos);
        }
Ejemplo n.º 4
0
        private bool ExisteEnLaBaseDeDatos()
        {
            repositorio = new RepositorioBase <TiposCuentas>(new Contexto());
            TiposCuentas tipoCuentas = repositorio.Buscar((int)TipoIDnumericUpDown.Value);

            return(tipoCuentas != null);
        }
Ejemplo n.º 5
0
        public TiposCuentas LlenaClase()
        {
            TiposCuentas tiposDeCuentas = new TiposCuentas();

            tiposDeCuentas.TipoID      = Convert.ToInt32(IDnumericUpDown.Value);
            tiposDeCuentas.Descripcion = DescripciontextBox.Text;
            return(tiposDeCuentas);
        }
Ejemplo n.º 6
0
        public IEnumerable <CuentasModel> GetCuentasClientes(TiposCuentas tipo, bool primeracarga = false)
        {
            var fkcuentatercero = _db.Tiposcuentas.Single(f => f.empresa == Empresa && f.tipos == (int)tipo)?.cuenta;

            return(_db.Cuentas.Where(f => f.nivel == 0 && f.empresa == Empresa && (primeracarga || f.bloqueada.HasValue == false || f.bloqueada.Value == false) && f.id.StartsWith(fkcuentatercero)).Select(f => new CuentasModel()
            {
                Id = f.id, Descripcion2 = f.descripcion2, Descripcion = f.descripcion, Empresa = f.empresa, Nivel = f.nivel.Value, Tiposcuentas = f.tipocuenta
            }));
        }
Ejemplo n.º 7
0
        private TiposCuentas LlenaClase()
        {
            TiposCuentas tipoCuentas = new TiposCuentas()
            {
                TipoCuentaId = Convert.ToInt32(TipoIDnumericUpDown.Value),
                Descripcion  = DescripciontextBox.Text
            };

            return(tipoCuentas);
        }
        public void GuardarTest()
        {
            TiposCuentas cuentas = new TiposCuentas();

            cuentas.TipoID      = 1002;
            cuentas.Descripcion = "William";
            RepositorioBase <TiposCuentas> repositorio;

            repositorio = new RepositorioBase <TiposCuentas>();
            Assert.IsTrue(repositorio.Guardar(cuentas));
        }
Ejemplo n.º 9
0
 public IEnumerable <CuentasBusqueda> GetCuentas(TiposCuentas tipo)
 {
     if (tipo == TiposCuentas.Todas)
     {
         return(_db.Database.SqlQuery <CuentasBusqueda>(string.Format(SelectTodasLasCuentasTerceros, _context.Empresa)).ToList());
     }
     else
     {
         return(_db.Database.SqlQuery <CuentasBusqueda>(string.Format(SelectCuentasTerceros, (int)tipo, Empresa, tipo)).ToList());
     }
 }
Ejemplo n.º 10
0
 private void usuario_Load(object sender, EventArgs e)
 {
     try {
         TiposCuentas n = new TiposCuentas();
         CmbTipoCuenta.DataSource    = n.Listar();
         CmbTipoCuenta.ValueMember   = "idtipocuenta";
         CmbTipoCuenta.DisplayMember = "descripcion";
     }
     catch {
     }
 }
        public void GuardarTest()
        {
            TiposCuentas cuentas = new TiposCuentas();

            cuentas.TipoCuentaId = 1022;
            cuentas.Descripcion  = "alejandro";
            RepositorioBase <TiposCuentas> repositorio;

            repositorio = new RepositorioBase <TiposCuentas>();
            Assert.IsTrue(repositorio.Guardar(cuentas));
        }
Ejemplo n.º 12
0
        public StExiste GetCompañia(TiposCuentas tipo, string id)
        {
            var result = new StExiste();
            var tiposcuentasService = FService.Instance.GetService(typeof(TiposCuentasModel), _context) as TiposcuentasService;
            var subcuenta           = tiposcuentasService.GetMascaraFromTipoCuenta(tipo);

            result.Valido = id.Contains(subcuenta);
            result.Existe = false;
            if (result.Valido)
            {
                result.Existe = exists(id);
            }
            return(result);
        }
Ejemplo n.º 13
0
        public void CleanAllContactos(TiposCuentas tipo, string fkCuentas)
        {
            var tipoInt = (int)tipo;
            var list    =
                _db.Set <Contactos>()
                .Where(f => f.empresa == Empresa && f.tipotercero == tipoInt && f.fkentidad == fkCuentas)
                .ToList();


            foreach (var item in list)
            {
                _db.Set <Contactos>().Remove(item);
            }
        }
Ejemplo n.º 14
0
        private void BuscarButton_Click(object sender, EventArgs e)
        {
            int id;

            repositorio = new RepositorioBase <TiposCuentas>(new Contexto());
            int.TryParse(TipoIDnumericUpDown.Text, out id);
            TiposCuentas tipoCuentas = new TiposCuentas();

            tipoCuentas = repositorio.Buscar(id);

            if (tipoCuentas != null)
            {
                MessageBox.Show("Tipo de Cuenta Encontrada.!!", "Exito!!!", MessageBoxButtons.OK);
                LlenaCampo(tipoCuentas);
            }
            else
            {
                MessageBox.Show("Tipo de Cuenta no Encontrada", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 15
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            int id;

            repositorio = new RepositorioBase <TiposCuentas>();
            TiposCuentas tiposDeCuentas = new TiposCuentas();

            int.TryParse(IDnumericUpDown.Text, out id);
            tiposDeCuentas = repositorio.Buscar(id);

            if (tiposDeCuentas != null)
            {
                MessageBox.Show("Econtado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Llenacampo(tiposDeCuentas);
            }
            else
            {
                MessageBox.Show("No encontrado!!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 16
0
        public void CleanAllDirecciones(string empresa, TiposCuentas tipo, string fkCuentas)
        {
            var tipoInt = (int)tipo;

            CleanAllDirecciones(empresa, tipoInt, fkCuentas);
        }
Ejemplo n.º 17
0
 public bool addEdit(TiposCuentas tipoCuenta, int idTipo)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 18
0
        public IEnumerable <ContactosLinModel> GetContactos(TiposCuentas tipo, string fkCuentas)
        {
            var tipoInt = (int)tipo;

            return(_db.Set <Contactos>().Where(f => f.empresa == Empresa && f.tipotercero == tipoInt && f.fkentidad == fkCuentas).ToList().Select(f => _converterModel.GetModelView(f) as ContactosLinModel).ToList());
        }
Ejemplo n.º 19
0
 public void Llenacampo(TiposCuentas tiposDeCuentas)
 {
     IDnumericUpDown.Value   = tiposDeCuentas.TipoID;
     DescripciontextBox.Text = tiposDeCuentas.Descripcion;
 }
Ejemplo n.º 20
0
 internal string GetMascara(TiposCuentas tipo)
 {
     return(_db.Tiposcuentas.SingleOrDefault(f => f.tipos == (int)tipo && f.empresa == Empresa)?.cuenta);
 }
Ejemplo n.º 21
0
 public IEnumerable <DireccionesLinModel> GetDirecciones(string empresa, TiposCuentas tipo, string fkCuentas)
 {
     return(GetDirecciones(empresa, (int)tipo, fkCuentas));
 }
Ejemplo n.º 22
0
 private void LlenaCampo(TiposCuentas tipoCuentas)
 {
     TipoIDnumericUpDown.Value = tipoCuentas.TipoCuentaId;
     DescripciontextBox.Text   = tipoCuentas.Descripcion;
 }