public static string GetTarjetaNine(string lngClienteID, DateTime fecha) { string functionReturnValue = ""; try { objCapaDatos = new ClsCapaDatos(); objCapaDatos.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ConnectionString; DataSet Ds; string strSQL = null; if (lngClienteID != "-1") { strSQL = "SELECT tarj.NumTarjeta FROM N_CLIENTES_GENERAL cg WITH (NOLOCK) INNER JOIN N_CLIENTES_TARJETAS_FIDELIDAD tarj WITH (NOLOCK) "; strSQL += " ON cg.Id_cliente=tarj.IdCliente WHERE cg.Id_Cliente=" + lngClienteID; strSQL += " AND tarj.FechaCaducidad >= CONVERT(DATETIME,'" + fecha.ToShortDateString() + "',103) AND ISNULL(tarj.IdBaja,0)=0 ORDER BY tarj.IdTarjeta DESC "; Ds = objCapaDatos.GEtSQLDataset(strSQL); if (Ds.Tables[0].Rows.Count > 0) { functionReturnValue = Ds.Tables[0].Rows[0]["NumTarjeta"].ToString().Trim(); } else { functionReturnValue = ""; } Ds.Dispose(); } else { functionReturnValue = ""; } } catch (Exception ex) { log.Error(ex); } return(functionReturnValue); }
public static int checkTiendaCamper() { int valor = 0; int TiendaCamper = 0; try { objCapaDatos = new ClsCapaDatos(); objCapaDatos.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ConnectionString; DataSet Ds; string strSQL = ""; strSQL = "select Valor from CONFIGURACIONES_TPV_AVANZADO WHERE NombreCampo='UsoCliente9' and IdTienda =(Select Tienda from configuraciones_tpv)"; Ds = objCapaDatos.GEtSQLDataset(strSQL); if (Ds.Tables[0].Rows.Count > 0) { valor = Convert.ToInt32(Ds.Tables[0].Rows[0][0].ToString()); if (valor == 0) { TiendaCamper = 1; } } Ds.Dispose(); } catch (Exception ex) { log.Error(ex); } return(TiendaCamper); }