/// <summary> /// Obtener informacion de PuntoVenta /// </summary> /// <param name="alias">id de punto</param> /// <returns></returns> public vwPuntoVenta ObtenerVistaPuntoVenta(int idPunto) { vwPuntoVenta puntoVenta = new vwPuntoVenta(); var puntoVentas = this.ObtenerVistaPuntosVenta(); if (puntoVentas != null && puntoVentas.Any()) { puntoVenta = puntoVentas.FirstOrDefault(p => p.IdPuntoVenta.Equals(idPunto)); } return(puntoVenta); }
/// <summary> /// Obtener punto de venta a partir del valor de la mac address /// </summary> /// <param name="macAddress">mac address</param> /// <returns></returns> public vwPuntoVenta ObtenerVistaPuntoVenta(string macAddress) { vwPuntoVenta puntoVenta = new vwPuntoVenta(); if (!string.IsNullOrWhiteSpace(macAddress)) { var puntoVentas = this.ObtenerVistaPuntosVenta(); if (puntoVentas != null && puntoVentas.Any()) { puntoVenta = puntoVentas.FirstOrDefault(p => p.MacAddress != null && p.MacAddress.Trim().Equals(macAddress.Trim(), StringComparison.InvariantCultureIgnoreCase)); } } return(puntoVenta); }
/// <summary> /// Obtener valor de PuntoVentas. /// </summary> /// <returns></returns> public List <vwPuntoVenta> ObtenerVistaPuntosVenta() { List <vwPuntoVenta> lstPuntoVentas = new List <vwPuntoVenta>(); string mensajeError = string.Empty; var dtInfo = this.ObtenerVistaPuntoVentas(ref mensajeError); if (string.IsNullOrWhiteSpace(mensajeError)) { foreach (DataRow rowInfo in dtInfo.Rows) { vwPuntoVenta PuntoVenta = new vwPuntoVenta(rowInfo); lstPuntoVentas.Add(PuntoVenta); } } return(lstPuntoVentas); }
/// <summary> /// Insertar configuracion de punto de venta. /// </summary> /// <param name="puntoVenta">punto de </param> public string InsertarConfiguracionPuntoVenta(vwPuntoVenta puntoVenta) { string mensajeError = string.Empty; try { using (var mavemRepository = new GenericRepository(this.DbConnectionString, typeof(System.Data.SqlClient.SqlConnection).Namespace)) { var procedureName = "SP_CC_PUNTO_VENTA_CONFIG_LOG"; ICollection <DbParameterItem> inputParameters = new List <DbParameterItem>() { new DbParameterItem { Name = "@ID_PUNTO_VENTA", Type = DbType.Int64, Value = puntoVenta.IdPuntoVenta, Direction = ParameterDirection.Input }, new DbParameterItem { Name = "@MAC_ADDRESS", Type = DbType.String, Value = puntoVenta.MacAddress, Size = 100, Direction = ParameterDirection.Input } }; mavemRepository.ExecuteNonQuery(procedureName, inputParameters); } } catch (Exception exc) { mensajeError = exc.Message; } return(mensajeError); }
/// <summary> /// Insertar configuracion de punto de venta. /// </summary> /// <param name="puntoVenta">punto de </param> public string InsertarConfiguracionPuntoVenta(vwPuntoVenta puntoVenta) { return(this.PuntoVentaDAL.InsertarConfiguracionPuntoVenta(puntoVenta)); }