1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
[WebMethod(Description="synchronisaton de la liste des programmes")]
public ListPrg SyncPrg(string MatAgent)
{
ListPrg ParamPrg = new ListPrg();
try
{
DTO.DTOprg dtprg = new DTO.DTOprg();
DevExpress.Data.Filtering.CriteriaOperator c = DevExpress.Data.Filtering.CriteriaOperator.Parse("AGENT.MAT_AGENT='" + MatAgent + "'");
XPCollection<ABRecouv.Objects.cPrgEtObj> prg = dtprg.SelData(session, c);
foreach (ABRecouv.Objects.cPrgEtObj a in prg)
{
DTO.Prg _Prg = new DTO.Prg();
_Prg.Oid = a.Oid;
_Prg.Num = a.Num_PRG;
_Prg.DT_PRG = a.DT_PRG;
_Prg.LstPrgLg=SyncPrgLg("Entete.Oid=" + _Prg.Oid); COLOR="Red"]//je crois que le pb est ici[/COLOR]
ParamPrg.LstPrg.Add(_Prg);
}
ParamPrg.Err.errStatut = eErreurStatut.Succès;
return ParamPrg;
}
catch (Exception ex)
{
ParamPrg = new ListPrg();
ParamPrg.Err.errStatut = eErreurStatut.Echoue;
ParamPrg.Err.Message = ex.Message;
return ParamPrg;
}
}
public List<PrgLg> SyncPrgLg(string condition)
{
ListPrgLg ParamPrgLg = new ListPrgLg();
try
{
DTO.DTOPrgLg dtLG = new DTO.DTOPrgLg();
CriteriaOperator c = CriteriaOperator.Parse(condition);
XPCollection<ABRecouv.Objects.cPrgLgObj> LG = dtLG.SelData(session, c);
foreach (ABRecouv.Objects.cPrgLgObj e in LG)
{
PrgLg lg = new PrgLg();
lg.Oid = e.Oid;
lg.OidPrg = e.Entete.Oid;
lg.Num = e.Entete.Num_PRG;
ParamPrgLg.LstPlg.Add(lg);
}
ParamPrgLg.Err.errStatut = eErreurStatut.Succès;
return ParamPrgLg.LstPlg;
}
catch (Exception ex)
{
ParamPrgLg = new ListPrgLg();
ParamPrgLg.Err.errStatut = eErreurStatut.Echoue;
ParamPrgLg.Err.Message = ex.Message;
return ParamPrgLg.LstPlg;
}
}
public class ListPrg
{
public ListPrg()
{
LstPrg = new List<Prg>();
Err = new Erreur();
}
public List<Prg> LstPrg;
public Erreur Err;
}
public class Prg
{
public Guid Oid;
public int Num;
public DateTime DT_PRG;
public List<PrgLg> LstPrgLg;
}
public class ListPrgLg
{
public ListPrgLg()
{
LstPlg = new List<PrgLg>();
Err = new Erreur();
}
public List<PrgLg> LstPlg;
public Erreur Err;
}
public class PrgLg
{
public Guid OidPrg;
public int Num;
public Guid Oid;
} |
Partager