/*Delete*/ public string DelGestionUsuario(BEManagementUser objBE) { string respuesta = string.Empty; try { using (DbCommand dbCmd = dbSQL.GetStoredProcCommand("SP_MANT_USERS_DEL")) { dbSQL.AddInParameter(dbCmd, "@codUser", DbType.String, objBE.codUser); using (IDataReader dataReader = dbSQL.ExecuteReader(dbCmd)) { int index1 = dataReader.GetOrdinal("respuesta"); object[] values = new object[dataReader.FieldCount]; while (dataReader.Read()) { dataReader.GetValues(values); respuesta = values[index1] == DBNull.Value ? string.Empty : values[index1].ToString(); } } return(respuesta.Substring(0, 1)); } } catch (Exception ex) { ExceptionManager.SaveError("Ocurrio un error en el logo", string.Empty, string.Empty, ex, "validateLoginUser", true, false); return("0"); } finally { } }
/*Select*/ public List <BEManagementUser> GetUsers(string cfullName) { string respuesta = string.Empty; try { List <BEManagementUser> Users = new List <BEManagementUser>(); BEManagementUser User = new BEManagementUser(); using (DbCommand dbCmd = dbSQL.GetStoredProcCommand("SP_MANT_USUARIOS_GET")) { dbSQL.AddInParameter(dbCmd, "@fullName", DbType.String, cfullName); using (IDataReader dataReader = dbSQL.ExecuteReader(dbCmd)) { int index1 = dataReader.GetOrdinal("respuesta"); int index2 = dataReader.GetOrdinal("codUser"); int firstName = dataReader.GetOrdinal("firstName"); int lastName = dataReader.GetOrdinal("lastName"); int lastName2 = dataReader.GetOrdinal("lastName2"); int fullName = dataReader.GetOrdinal("fullName"); int codLocal = dataReader.GetOrdinal("codLocal"); int nomLocal = dataReader.GetOrdinal("nomLocal"); int codRol = dataReader.GetOrdinal("codRol"); int userName = dataReader.GetOrdinal("userName"); int userPassword = dataReader.GetOrdinal("userPassword"); object[] values = new object[dataReader.FieldCount]; while (dataReader.Read()) { dataReader.GetValues(values); User = new BEManagementUser(); User.Respuesta = values[index1] == DBNull.Value ? string.Empty : values[index1].ToString(); User.UserCod = values[index2] == DBNull.Value ? string.Empty : values[index2].ToString(); User.firstName = values[firstName] == DBNull.Value ? string.Empty : values[firstName].ToString(); User.lastName = values[lastName] == DBNull.Value ? string.Empty : values[lastName].ToString(); User.lastName2 = values[lastName2] == DBNull.Value ? string.Empty : values[lastName2].ToString(); User.fullName = values[fullName] == DBNull.Value ? string.Empty : values[fullName].ToString(); User.codLocal = values[codLocal] == DBNull.Value ? string.Empty : values[codLocal].ToString(); User.nomLocal = values[nomLocal] == DBNull.Value ? string.Empty : values[nomLocal].ToString(); User.codRol = values[codRol] == DBNull.Value ? string.Empty : values[codRol].ToString(); User.UserName = values[userName] == DBNull.Value ? string.Empty : values[userName].ToString(); User.UserPassword = values[userPassword] == DBNull.Value ? string.Empty : values[userPassword].ToString(); Users.Add(User); } } return(Users); } } catch (Exception ex) { ExceptionManager.SaveError("Ocurrio un error en el logo", string.Empty, string.Empty, ex, "validateLoginUser", true, false); return(null); } finally { } }
public static string Del(BEManagementUser objBE) { IUsers IService = new IUsers(); return(IService.IDelete(objBE)); }
public static string InsUpd(BEManagementUser objBE) { IUsers IService = new IUsers(); return(objBE.codUser == "0" ? IService.IInsert(objBE) : IService.IUpdate(objBE)); }
/*Delete*/ public string Delete(BEManagementUser objBE) { return(DA.DelGestionUsuario(objBE)); }
/*Update*/ public string Update(BEManagementUser objBE) { return(DA.UpdGestionUsuario(objBE)); }
/*Insert*/ public string Insert(BEManagementUser objBE) { return(DA.InsGestionUsuario(objBE)); }
/*Delete*/ public string IDelete(BEManagementUser objBE) { return(BL.Delete(objBE)); }
/*Update*/ public string IUpdate(BEManagementUser objBE) { return(BL.Update(objBE)); }
/*Insert*/ public string IInsert(BEManagementUser objBE) { return(BL.Insert(objBE)); }