public static int existeUsuario(String cuit)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();

            Dictionary <String, Object> param = new Dictionary <string, object>();

            bool salida = false;

            param.Add("provee_cuit", cuit);
            param.Add("existe output", salida);
            SqlCommand command;

            try
            {
                SqlDataReader reader = spManager.executeSPWithParameters("MR_ANDERSON.sp_existe_cuit", param, out command);
                return((int)Int32.Parse(command.Parameters["@existe"].Value.ToString()));
            }
            catch (Exception e)
            {
                spManager.Close();
                return(0);
            }

            spManager.Close();
            return(1);
        }
        public static int existeUsuario(String cuit)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();

            Dictionary<String, Object> param = new Dictionary<string, object>();

            bool salida = false;
            param.Add("provee_cuit", cuit);
            param.Add("existe output", salida);
            SqlCommand command;

            try
            {
                SqlDataReader reader = spManager.executeSPWithParameters("MR_ANDERSON.sp_existe_cuit", param, out command);
                return (int)Int32.Parse(command.Parameters["@existe"].Value.ToString());
            }
            catch (Exception e)
            {
                spManager.Close();
                return 0;
            }

            spManager.Close();
            return 1;
        }
Exemple #3
0
        public void validateUser()
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();
               Dictionary<String, Object> parameters = new Dictionary<string, object>();
               parameters.Add("username_sended", userName);
               parameters.Add("user_password_sended", password);
               parameters.Add("result output", "");
               SqlCommand command;
               string resultado = "";
               try
               {
               SqlDataReader reader = spManager.executeSPWithParameters("MR_ANDERSON.sp_login", parameters, out command);
               resultado = (string)command.Parameters["@result"].Value;
               reader.Close();
               }
               catch
               {

               }
               spManager.Close();

               if (!resultado.Equals("LOGIN_OK"))
               {
               throw new Exception(resultado);
               }
        }
Exemple #4
0
        public void validateUser()
        {
            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("username_sended", userName);
            parameters.Add("user_password_sended", password);
            parameters.Add("result output", "");
            SqlCommand command;
            string     resultado = "";

            try
            {
                SqlDataReader reader = spManager.executeSPWithParameters("MR_ANDERSON.sp_login", parameters, out command);
                resultado = (string)command.Parameters["@result"].Value;
                reader.Close();
            }
            catch
            {
            }
            spManager.Close();


            if (!resultado.Equals("LOGIN_OK"))
            {
                throw new Exception(resultado);
            }
        }
        public List <CuponesStringContainer> historialCuponesPara(int dni, String fecha1, String fecha2)
        {
            List <CuponesStringContainer> listResultado = new List <CuponesStringContainer>();

            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("dni", dni);
            parameters.Add("fecha_inicio", fecha1);
            parameters.Add("fecha_final", fecha2);
            SqlDataReader reader = spManager.executeSPWithParameters("MR_ANDERSON.historial_compra", parameters);

            while (reader.Read())
            {
                CuponesStringContainer objResultado = new CuponesStringContainer();
                if (!Convert.IsDBNull(reader["codigo"]))
                {
                    objResultado.Codigo = Convert.ToString(reader["codigo"]);
                }
                if (!Convert.IsDBNull(reader["estado"]))
                {
                    objResultado.Estado = Convert.ToString(reader["estado"]);
                }
                if (!Convert.IsDBNull(reader["id_compra"]))
                {
                    objResultado.IdCompra = Convert.ToString(reader["id_compra"]);
                }

                listResultado.Add(objResultado);
            }

            reader.Close();
            spManager.Close();
            return(listResultado);
        }
Exemple #6
0
 public void setPasswordOldUser()
 {
     DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();
        Dictionary<String, Object> parameters = new Dictionary<string, object>();
        parameters.Add("username", this.userName);
        parameters.Add("password", this.password);
        spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_cambiar_password", parameters);
        spManager.Close();
 }
Exemple #7
0
        public void setPasswordOldUser()
        {
            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("username", this.userName);
            parameters.Add("password", this.password);
            spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_cambiar_password", parameters);
            spManager.Close();
        }
Exemple #8
0
        public void validateUser()
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();
            Dictionary<String, Object> parameters = new Dictionary<string,object>();
            parameters.Add("UserName", userName);
            parameters.Add("Password", password);

            //SqlDataReader dataReader = spManager.executeSPWithParameters("Log In", parameters);
            //dataReader.GetString(0);

            //            dataReader.Close();
            spManager.Close();
        }
Exemple #9
0
        public void validateUser()
        {
            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("UserName", userName);
            parameters.Add("Password", password);

            //SqlDataReader dataReader = spManager.executeSPWithParameters("Log In", parameters);
            //dataReader.GetString(0);

//            dataReader.Close();
            spManager.Close();
        }
        public static String Registrar(String codigo, String dni, String cuit)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();

            Dictionary <String, Object> param = new Dictionary <string, object>();

            param.Add("fecha_actual", AdministradorConfiguracion.obtenerFecha());
            param.Add("id_compra", Decimal.Parse(codigo));
            param.Add("provee_cuit", cuit);
            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_registra_consumo_cupon", param);
            }
            catch (Exception e)
            {
                return("Se produjo el siguiente error: " + e.Message);
            }
            spManager.Close();
            return("Se registró correctamente.");
        }
        public static String Registrar(String codigo, String dni, String cuit)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();

            Dictionary<String, Object> param = new Dictionary<string, object>();

            param.Add("fecha_actual", AdministradorConfiguracion.obtenerFecha());
            param.Add("id_compra", Decimal.Parse(codigo));
            param.Add("provee_cuit", cuit);
            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_registra_consumo_cupon", param);
            }
            catch(Exception e)
            {
                return "Se produjo el siguiente error: " + e.Message;
            }
            spManager.Close();
            return "Se registró correctamente.";
        }