Welcome!
This community is for professionals and enthusiasts of the Genio platform.
Share your questions and challenges, and help your partners!
Create a MANWIN USER_IMAGE
E.g. Login for two different kinds of people
(for one type you just need the first branch of
the if statement)
//Para validar se existe EPH pretendido
if (user.Ephs != null &&
user.Ephs.ContainsKey("ALU_ACESSO_ALUNO"))
{
string[] eph = (string[])user.Ephs["ALU_ACESSO_ALUNO"];
SelectQuery
selquery = new SelectQuery()
.Select(CSGenioAaluno.FldNome)
.Select(CSGenioAaluno.FldFoto)
.Select(CSGenioAaluno.FldNrmecano)
.From(Area.AreaALUNO)
.Where(Quidgest.Persistence.GenericQuery.CriteriaSet.And()
.Equal(CSGenioAaluno.FldCodaluno, eph[0])
);
DataMatrix
data = sp.Execute(selquery);
if (data.NumRows > 0)
{
fullname = data.GetString(0, 0);
image = data.GetBinary(0, 1);
position = data.GetString(0, 2);
}
}
else
if (user.Ephs != null &&
user.Ephs.ContainsKey("UMI_DOCENTE"))
{
string[] eph = (string[])user.Ephs["UMI_DOCENTE"];
SelectQuery
selquery = new SelectQuery()
.Select(CSGenioApesso.FldNome)
.Select(CSGenioApesso.FldPhotogra)
.Select(CSGenioApesso.FldEmail)
.From(Area.AreaPESSO)
.Where(Quidgest.Persistence.GenericQuery.CriteriaSet.And()
.Equal(CSGenioApesso.FldCodpesso, eph[0])
);
DataMatrix
data = sp.Execute(selquery);
if (data.NumRows > 0)
{
fullname = data.GetString(0, 0);
image = data.GetBinary(0, 1);
position = data.GetString(0, 2);
}
}
---------------------------------------------------------------------------------------------------------------
To extend to all system its be necessary to specify the module name
E.g.
//Choose Modulo name and concatenate with eph name
string ephName = user.CurrentModule == "BAC" ? "BAC_UTILIZADORES" : "OUT_UTILIZADORES";
string[] eph = (string[])user.Ephs[ephName];
SelectQuery selquery = new SelectQuery()
.Select(CSGenioAinsti.FldNomeinst)
.Select(CSGenioAinsti.FldLogo)
.Select(CSGenioAinsti.FldEmail)
.From(Area.AreaINSTI)
.Join(Area.AreaPW_IN)
.On(Quidgest.Persistence.GenericQuery.CriteriaSet.And()
.Equal(CSGenioApw_in.FldCodinsti, CSGenioAinsti.FldCodinsti))
.Where(Quidgest.Persistence.GenericQuery.CriteriaSet.And()
.Equal(CSGenioApw_in.FldCodpw_in, eph[0])
);
DataMatrix data = sp.Execute(selquery);
if (data.NumRows > 0)
{
fullname = data.GetString(0, 0);
image = data.GetBinary(0, 1);
position = data.GetString(0, 2);
}
Keep Informed
About the Community
Question tools
Stats
Asked: 3/30/21, 9:47 AM |
Seen: 1615 times |
Last updated: 8/6/21, 10:29 AM |