コード例 #1
0
 /// <summary>
 /// Metodo para agregar el log
 /// </summary>
 /// <param name="item">dto a guardar en xml</param>
 /// <param name="fileName">nombre del archivo</param>
 public int Add(T item, string fileName)
 {
     try
     {
         string path = new ConfigGeneralesCajaTiendaRepository().GetConfig(token.CodeBox, token.CodeStore, token.CodeEmployee).RutaLogTransacciones;
         System.Xml.Serialization.XmlSerializer writer =
             new System.Xml.Serialization.XmlSerializer(typeof(T));
         string dir = DateTime.Now.ToString("dd_MM_yyyy");
         path = string.Format("{0}//{1}", path, dir);
         System.IO.DirectoryInfo infoDirectory = new System.IO.DirectoryInfo(path);
         if (!infoDirectory.Exists)
         {
             infoDirectory.Create();
         }
         path = string.Format("{0}//{1}.xml", path, fileName);
         System.IO.FileStream file = System.IO.File.Create(path);
         writer.Serialize(file, item);
         file.Close();
         return(1);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #2
0
        public void GetBotonCnfgTest()
        {
            var cnfbtn = new ConfigGeneralesCajaTiendaRepository();
            var result = cnfbtn.GetBotonCnfg(3, 3021);

            Assert.IsTrue(result.ConfiguracionBotones != null);
        }
コード例 #3
0
        public void GetCnfgGralTest()
        {
            var cnfbtn = new ConfigGeneralesCajaTiendaRepository();
            var result = cnfbtn.GetConfig(3, 3021, 1717);

            Assert.IsTrue(result != null);
        }
コード例 #4
0
 /// <summary>
 /// Busqueda de tarjetas
 /// </summary>
 /// <param name="folioTarjeta"></param>
 /// <returns></returns>
 public ResponseBussiness <ProductsResponse[]> Busqueda(string folioTarjeta)
 {
     return(tryCatch.SafeExecutor(() =>
     {
         ProxyTarjetasRegalo.Respuesta respuesta = new ProxyTarjetasRegalo.Respuesta();
         respuesta = proxy.ConsultaTarjeta(this.token.CodeStore, this.token.CodeBox, folioTarjeta);
         ConfigGeneralesCajaTiendaRepository repositoryConfiguracion = new ConfigGeneralesCajaTiendaRepository();
         Dto.General.ConfigGeneralesCajaTiendaResponse config = repositoryConfiguracion.GetConfigSinBotonera(this.token.CodeBox, this.token.CodeStore, 0);
         List <ProductsResponse> list = new List <ProductsResponse>();
         if (respuesta.sError == "")
         {
             ProductsResponse product = new ProductsResponse();
             product.Articulo.Sku = config.SkuTarjetaRegalo;
             product.Articulo.PrecioConImpuestos = respuesta.dSaldo;
             product.Articulo.InformacionTarjetaRegalo.Estatus = respuesta.sEstatus;
             product.Articulo.InformacionTarjetaRegalo.Descripcion = respuesta.sMensaje;
             product.Articulo.InformacionTarjetaRegalo.FolioTarjeta = int.Parse(folioTarjeta);
             list.Add(product);
         }
         return list.ToArray();
     }));
 }
コード例 #5
0
 /// <summary>
 /// Constructor por default
 /// </summary>
 public ConfigGeneralesCajaTiendaBusiness(TokenDto token)
 {
     this.repository = new ConfigGeneralesCajaTiendaRepository();
     this.token      = token;
 }