/// <summary> /// Metodo para Listar Venta /// </summary> /// <param name="buscar">Codigo del Venta</param> /// <returns>TVenta</returns> public List <TVenta> Listar(int buscar) { try { using (this.dt = new DatoSistemasDataContext()) { var t = (from c in this.dt.TVenta where c.ven_codigo.Equals(buscar) select c).OrderByDescending(c => c.ven_codigo).ToList <TVenta>(); return(t.ToList()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Venta"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(EPersona d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_per_edit(d.Per_codigo, d.Per_nombre, d.Per_apellido, d.Per_direccion, d.Ciu_nombre, d.Per_telefono, d.Per_celular, d.Per_identificacion); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Persona"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar Caracteristicas /// </summary> /// <param name="buscar">Nombre de la caracteristica</param> /// <returns>TCaracteristica</returns> public List <TDetalleProducto_Caracteristica> Listar(string dcar, int prodcodigo) { try { using (this.dt = new DatoSistemasDataContext()) { var t = (from c in this.dt.TDetalleProducto_Caracteristica where c.Tipo.Contains(dcar) && c.Codigo.Equals(prodcodigo) select c).OrderBy(c => c.CodDCar).ToList <TDetalleProducto_Caracteristica>(); return(t.ToList()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public String existValor(string valor, int dcarcodigo) { try { using (this.dt = new DatoSistemasDataContext()) { var t = from c in this.dt.TDetalleProducto_Caracteristica where c.Valor.Contains(valor) && c.CodDCar.Equals(dcarcodigo) select c; //System.Windows.Forms.MessageBox.Show(t.ToList().Count+"\n"+tipo+"\n"+dcarcodigo); return(t.Distinct().ToList().Count > 0 ?t.Single().Tipo:""); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar Proveedores por Nombres /// </summary> /// <param name="buscar">Nombre de la Proveedor</param> /// <returns>TProveedor_TCiudad</returns> public List <TProveedor_TCiudad> Listar(String buscar) { try { using (this.dt = new DatoSistemasDataContext()) { return((from p in this.dt.TProveedor_TCiudad where p.Nombre.Contains(buscar) || p.Identificacion.Contains(buscar) || p.Telefono.Contains(buscar) || p.Email.Contains(buscar) || p.Ciudad.Contains(buscar) || p.Celular.Contains(buscar) || p.Direccion.Contains(buscar) select p).OrderBy(p => p.Nombre).ToList <TProveedor_TCiudad>()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Proveedor"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de Proveedor /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(EProveedor d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_prov_insert(d.Prov_nombre, d.Prov_direccion, d.Ciu_nombre, d.Prov_telefono, d.Prov_celular, d.Prov_email, d.Prov_identificacion)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Proveedor"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar DetallePedido /// </summary> /// <param name="buscar">Codigo del DetallePedido</param> /// <returns>TDetallePedido</returns> public List <TDetalle_Pedido> Listar(int buscar, int producto) { try { using (this.dt = new DatoSistemasDataContext()) { var t = (from c in this.dt.TDetalle_Pedido where c.ped_codigo.Equals(buscar) && c.prod_codigo.Equals(producto) select c).OrderBy(c => c.ped_codigo).ToList <TDetalle_Pedido>(); return(t.ToList()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DetallePedido"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para obtener el registro deseado /// </summary> /// <param name="codigo"></param> /// <returns></returns> public TProducto_Caracteristica getDatos(int codigo) { TProducto_Caracteristica df = new TProducto_Caracteristica(); df.dcar_codigo = 0; df.prod_codigo = 0; try { using (this.dt = new DatoSistemasDataContext()) { var t = from c in this.dt.TProducto_Caracteristica where c.prod_codigo.Equals(codigo) select c; if (t.ToList().Count > 0) { return(t.Single()); } else { return(df); } } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Producto_Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar Productos por Eleccion y Secundaria /// </summary> /// <param name="buscar">Cadena a buscar</param> /// <param name="opcion">Tipo</param> /// <param name="opcion2">Mayor o menor</param> /// <returns>TProducto_Foreign</returns> public List <TVenta_Foreign> Listar(String buscar, string opcion) { try { #region Persona try { using (this.dt = new DatoSistemasDataContext()) { return((from p in this.dt.TVenta_Foreign where p.Comprador.Contains(buscar) || p.IdComprador.Contains(buscar) select p).OrderByDescending(p => p.Codigo).ToList <TVenta_Foreign>()); } } catch (Exception ex) { throw new Exception("Error al listar \n" + ex.Message); } #endregion } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Venta"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar Personas por Nombres /// </summary> /// <param name="buscar">Nombre de la Persona</param> /// <returns>TPersona_TCiudad</returns> public List <TPersona_TCiudad> Listar(String buscar) { try { using (this.dt = new DatoSistemasDataContext()) { return((from p in this.dt.TPersona_TCiudad where p.Nombre.Contains(buscar) || p.Apellido.Contains(buscar) || p.Identificacion.Contains(buscar) || p.Telefono.Contains(buscar) || p.Ciudad.Contains(buscar) || p.Celular.Contains(buscar) || p.Direccion.Contains(buscar) select p).OrderBy(p => p.Codigo).ToList <TPersona_TCiudad>()); /// /// //return (from p in this.dt.TPersona_TCiudad // join c in this.dt.TCiudad // on p.ciu_codigo equals c.ciu_codigo // select new TPersona_TCiudad // { // Codigo = p.per_codigo, // Nombre = p.per_nombre, // Apellido = p.per_apellido, // Direccion = p.per_direccion, // Ciudad = c.ciu_nombre, // Telefono = p.per_telefono, // Celular = p.per_celular, // Identificacion = p.per_identificacion // }).ToList<TPersona_TCiudad>(); /// } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Persona"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Eliminar(int codigo) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_cat_delete(codigo); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Categoria"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void EliminarDetalle(int codigo) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_dcar_delete_complete(codigo); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DCaracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Eliminar(int codigo, int producto) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_det_venta_delete(codigo, producto); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DetalleVenta"); System.Windows.Forms.MessageBox.Show(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(ECiudad d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_ciu_edit(d.Ciu_codigo, d.Ciu_nombre); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Ciudad"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de Tamanio /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(ETamanio d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_dim_insert(d.Dim_nombre)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Tamanio"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de caracteristica /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(ECaracteristica d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_car_insert(d.Car_tipo)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de unidad /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(EUnidad d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_uni_insert(d.Uni_nombre, d.Uni_prefijo)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Unidad"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de Pedido /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(EPedido d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_ped_insert(d.Prov_codigo, d.Ped_estado, d.Ped_descuento, d.Ped_date)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Pedido"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(EConfiguracion d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_conf_edit(d.Conf_clave, d.Conf_valor); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Configuracion"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Edicion de caracteristica producto /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public void Editar(EProductoCaracteristica d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_pcar_edit(d.Dcar_codigo, d.Prod_codigo); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Producto_Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(EDetalleCaracteristica d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_dcar_edit(d.Dcar_codigo, d.Car_tipo, d.Car_valor); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DCaracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(EVenta d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_ven_edit(d.Ven_codigo, d.Per_codigo, d.Ven_estado, d.Ven_descuento, d.Ven_date); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Venta"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public void Editar(EDetalleVenta d) { try { using (this.dt = new DatoSistemasDataContext()) { this.dt.sp_det_venta_edit(d.Ven_codigo, d.Prod_codigo, d.Dven_precio, d.Cantidad, d.Dven_descuento, d.Dven_aumento); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DetalleVenta"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
public System.Data.DataTable ListarReporte(int numero) { DataDetalleVentas.TDetalle_Venta_ForeignDataTable ddt = new DataDetalleVentas.TDetalle_Venta_ForeignDataTable(); using (this.dt = new DatoSistemasDataContext()) { var query = from c in this.dt.TDetalle_Venta_Foreign select c; try { foreach (TDetalle_Venta_Foreign c in query) { ddt.Rows.Add(c.VentaCod, c.ProductoCod); } } catch { } } return(ddt); }
/// <summary> /// Metodo para Listar Pedido /// </summary> /// <param name="buscar">Codigo del Pedido</param> /// <returns>TPedido</returns> public List <TPedido_Foreign> Listar() { try { using (this.dt = new DatoSistemasDataContext()) { var t = (from c in this.dt.TPedido_Foreign select c).OrderByDescending(c => c.Codigo).ToList <TPedido_Foreign>(); return(t.ToList()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Pedido"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Registro de DetallePedido /// </summary> /// <param name="d"></param> /// <returns>codigo de Registro</returns> public int Insertar(EDetallePedido d) { try { using (this.dt = new DatoSistemasDataContext()) { return(this.dt.sp_det_pedido_insert( d.Ped_codigo, d.Prod_codigo, d.Dped_precio, d.Cantidad)); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "DetallePedido"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para Listar Marcas /// </summary> /// <param name="buscar">Nombre de la marca</param> /// <returns>TMarca</returns> public List <TMarca_Foreign> Listar(String buscar) { try { using (this.dt = new DatoSistemasDataContext()) { return((from c in this.dt.TMarca_Foreign where c.Nombre.Contains(buscar) select c).OrderBy(c => c.Codigo).ToList <TMarca_Foreign>()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Marca"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para obtener el registro deseado /// </summary> /// <param name="codigo"></param> /// <returns></returns> public TConfiguracion getDatos(string nombre) { try { using (this.dt = new DatoSistemasDataContext()) { var t = from c in this.dt.TConfiguracion where c.conf_clave.Equals(nombre.ToUpper()) select c; return(t.Single()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Configuracion"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para obtener el registro deseado /// </summary> /// <param name="codigo"></param> /// <returns></returns> public TPersona_TCiudad getDatosCodProd(string identificacion) { try { using (this.dt = new DatoSistemasDataContext()) { var t = from c in this.dt.TPersona_TCiudad where c.Identificacion.Equals(identificacion.Trim()) select c; return(t.Single()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Persona"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }
/// <summary> /// Metodo para obtener el registro deseado /// </summary> /// <param name="codigo"></param> /// <returns></returns> public TDetalleProducto_Caracteristica getDatos(int codigo) { try { using (this.dt = new DatoSistemasDataContext()) { var t = from c in this.dt.TDetalleProducto_Caracteristica where c.CodDCar.Equals(codigo) select c; return(t.Single()); } } catch (System.Data.SqlClient.SqlException ex) { Datos.Excepciones.Gestionar(ex, "Caracteristica"); throw new Exception(Datos.Excepciones.MensajePersonalizado); } catch (Exception ex) { Datos.Excepciones.Gestionar(ex); throw new Exception(Datos.Excepciones.MensajePersonalizado); } }