Created
August 28, 2018 04:04
-
-
Save alfonsomozkoh/6afb27c28dac93f69a65a4c2bb9c22da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [ZGastosInversion] | |
GO | |
/****** Object: StoredProcedure [dbo].[usp_Gastos05_AgregarCuentaC] Script Date: 07/19/2018 10:27:25 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
ALTER Procedure [dbo].[usp_Gastos05_AgregarCuentaC] | |
( | |
@UCI varchar(20), | |
@Name varchar(100), | |
@strPerfil varchar(20), | |
@intStatus bit, | |
@intAccion int | |
) | |
AS | |
Begin | |
DECLARE @strPwd varchar(10) | |
IF @intAccion = 1 --ALTA | |
BEGIN | |
IF (Select COUNT(*) FROM Tbl001_Usuarios WHERE Usuario = @strUser) = 0 | |
BEGIN | |
IF @strPerfil = 'ADM' | |
BEGIN | |
SET @strPerfil = 'XXXXXXX' | |
END | |
IF @strPerfil <> 'ADM' | |
BEGIN | |
SET @strPerfil = 'OM9999' | |
END | |
SET @strPwd = 'Oxiteno1$' | |
Insert Into Tbl001_Usuarios Values (@strUser, @strPwd, @Name, @strPerfil, @intStatus) | |
END | |
END | |
IF @intAccion = 2 --Baja | |
BEGIN | |
Update Tbl001_Usuarios | |
SET Status = 0 | |
Where Usuario = @strUser | |
END | |
IF @intAccion = 3 --CAMBIO | |
BEGIN | |
SET @strPwd = 'Oxiteno1$' | |
Update Tbl001_Usuarios | |
SET Status = 1, | |
Password = @strPwd | |
Where Usuario = @strUser | |
END | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment