예제 #1
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();
 }
예제 #2
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();
        }
예제 #3
0
        public string publicarCupon(String codigo)
        {
            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("codigo", codigo);

            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_publicar_cupon", parameters);
                return("Publicación exitosa");
            }
            catch (Exception e)
            {
                return("Error en compra");
            }
        }
예제 #4
0
        /*
         * create procedure MR_ANDERSON.sp_pedir_devolucion (@ numeric(18), @codigo nvarchar(50), @ DATETIME,
         *                      @ NVARCHAR(255), @ numeric )
         * */
        public string devolverCupon(String dni, String codigo, DateTime fecha, String motivo, String idCompra)
        {
            DataAccess.SPManager        spManager  = new GrouponDesktop.DataAccess.SPManager();
            Dictionary <String, Object> parameters = new Dictionary <string, object>();

            parameters.Add("dni", Int32.Parse(dni));
            parameters.Add("fecha_devolucion", fecha);
            parameters.Add("motivo", motivo);
            parameters.Add("id_compra", Int32.Parse(idCompra));

            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_pedir_devolucion", parameters);
                return("Devolución exitosa");
            }
            catch (SqlException e)
            {
                return("Error en la devolución: " + e.Message);
            }
        }
        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.";
        }
예제 #7
0
        public string publicarCupon(String codigo)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();
            Dictionary<String, Object> parameters = new Dictionary<string, object>();
            parameters.Add("codigo", codigo);

            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_publicar_cupon", parameters);
                return "Publicación exitosa";
            }
            catch (Exception e)
            {
                return "Error en compra";
            }
        }
예제 #8
0
        /*
         * create procedure MR_ANDERSON.sp_pedir_devolucion (@ numeric(18), @codigo nvarchar(50), @ DATETIME,
                                @ NVARCHAR(255), @ numeric )
         * */
        public string devolverCupon(String dni, String codigo, DateTime fecha, String motivo, String idCompra)
        {
            DataAccess.SPManager spManager = new GrouponDesktop.DataAccess.SPManager();
            Dictionary<String, Object> parameters = new Dictionary<string, object>();
            parameters.Add("dni", Int32.Parse(dni));
            parameters.Add("fecha_devolucion", fecha);
            parameters.Add("motivo", motivo);
            parameters.Add("id_compra", Int32.Parse(idCompra));

            try
            {
                spManager.executeSPWithParametersWithOutReturn("MR_ANDERSON.sp_pedir_devolucion", parameters);
                return "Devolución exitosa";
            }
            catch (SqlException e)
            {
                return "Error en la devolución: " + e.Message;
            }
        }