private bool ExiteEnlaDB() { repositorio = new RepositorioBase <TiposCuentas>(); TiposCuentas tiposDeCuentas = repositorio.Buscar((int)IDnumericUpDown.Value); return(tiposDeCuentas != null); }
public string GetMascaraFromTipoCuenta(TiposCuentas tipo) { using (var service = FService.Instance.GetService(typeof(TiposCuentasModel), _context) as TiposcuentasService) { return(service.GetMascara(tipo)); } }
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); }
private bool ExisteEnLaBaseDeDatos() { repositorio = new RepositorioBase <TiposCuentas>(new Contexto()); TiposCuentas tipoCuentas = repositorio.Buscar((int)TipoIDnumericUpDown.Value); return(tipoCuentas != null); }
public TiposCuentas LlenaClase() { TiposCuentas tiposDeCuentas = new TiposCuentas(); tiposDeCuentas.TipoID = Convert.ToInt32(IDnumericUpDown.Value); tiposDeCuentas.Descripcion = DescripciontextBox.Text; return(tiposDeCuentas); }
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 })); }
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)); }
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()); } }
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)); }
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); }
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); } }
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); } }
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); } }
public void CleanAllDirecciones(string empresa, TiposCuentas tipo, string fkCuentas) { var tipoInt = (int)tipo; CleanAllDirecciones(empresa, tipoInt, fkCuentas); }
public bool addEdit(TiposCuentas tipoCuenta, int idTipo) { throw new NotImplementedException(); }
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()); }
public void Llenacampo(TiposCuentas tiposDeCuentas) { IDnumericUpDown.Value = tiposDeCuentas.TipoID; DescripciontextBox.Text = tiposDeCuentas.Descripcion; }
internal string GetMascara(TiposCuentas tipo) { return(_db.Tiposcuentas.SingleOrDefault(f => f.tipos == (int)tipo && f.empresa == Empresa)?.cuenta); }
public IEnumerable <DireccionesLinModel> GetDirecciones(string empresa, TiposCuentas tipo, string fkCuentas) { return(GetDirecciones(empresa, (int)tipo, fkCuentas)); }
private void LlenaCampo(TiposCuentas tipoCuentas) { TipoIDnumericUpDown.Value = tipoCuentas.TipoCuentaId; DescripciontextBox.Text = tipoCuentas.Descripcion; }