connecter ==fonction
Transcript of connecter ==fonction
-
8/17/2019 connecter ==fonction
1/3
LES METHODES
class CMachine
public int ID_Machine { get; set; }
public string Description { get; set; }public int N_Serie { get; set; }
public int ID_Moel { get; set; }
public ouble !ri"#chat { get; set; }
public int ID_lot { get; set; }
public int ID_Etat { get; set; }
LES CONST$%CTE%$
_public CMachine&' { }
_public CMachine&CMachine M'
{
this(ID_Machine ) M(ID_Machine;
this(Description ) M(Description;
this(N_Serie ) M(N_Serie;
this(ID_Moel ) M(ID_Moel;
this(!ri"#chat ) M(!ri"#chat;
this(ID_lot ) M(ID_lot;
this(ID_Etat ) M(ID_Etat;
}
_public CMachine&intID_Machine*string Description*int
N_Serie*int ID_Moel*ouble
!ri"#chat*int ID_lot*int ID_Etat'
{
this(ID_Machine ) ID_Machine;
this(Description ) Description;
this(N_Serie ) N_Serie;
this(ID_Moel ) ID_Moel;
this(!ri"#chat ) !ri"#chat;
this(ID_lot ) ID_lot;
this(ID_Etat ) ID_Etat;
}
public +oi #,outer&'
{
cn"(Close&';
S-lCo..an c. ) ne/ S-lCo..an&0insert into .achine +alues&01ID_Machine10*201Description102*01N_Serie10*01ID_Moel10*01!ri"#chat10*01ID
_lot10*01ID_Moel10'0* cn"';
cn"(Open&';
c.(E"ecuteNon3uer4&';
cn"(Close&';
}
-
8/17/2019 connecter ==fonction
2/3
public +oi Suppri.er&'
{
cn"(Close&';
S-lCo..an c. ) ne/ S-lCo..an&0elete 5ro. .achine /here i_.achine)0 1
ID_Machine * cn"';
cn"(Open&';
c.(E"ecuteNon3uer4&';
cn"(Close&';
}
public int Co.pter&'
{
cn"(Close&';
int Count ) 6;
S-lCo..an c. ) ne/ S-lCo..an&0select count&7' 5ro. .achine0* cn"';
cn"(Open&';Count )&int'c.(E"ecuteScalar&';
cn"(Close&';
return Count;
}
public S-lData$eaer #55ichage&'
{
cn"(Close&';
S-lData$eaer $eaer;
S-lCo..an c. ) ne/ S-lCo..an&0select 7 5ro. .achine0* cn"';
cn"(Open&';$eaer )c.(E"ecute$eaer&';
return $eaer;
#,outer
c ) ne/
CMachine&int(!arse&.achine(Te"t'*
escription(Te"t* int(!arse&nu.(Te"t'*
int(!arse&.oele(Selecte8alue(ToStri
ng&''* ouble(!arse&pri"(Te"t'*
int(!arse&lot(Selecte8alue(ToString&''
*
int(!arse&etat(Selecte8alue(ToString&
''';
c(#,outer&';
99ata:ri8ie/(DataSource ):etData&c(#55ichage&'';
Suppri.er
i5 &c
-
8/17/2019 connecter ==fonction
3/3
DataTable :etData&S-lData$eaer $'
{
DataTable t ) ne/ DataTable&';5or &int i ) 6; i > $(?ielCount; i11'
{ t(Colu.ns(#&ne/ DataColu.n&$(:etNa.e&i'''; }
/hile &$($ea&''
{ Data$o/ $/ ) t(Ne/$o/&';
5or&int i ) 6; i > t(Colu.ns(Count; i11'
{ $/@iA ) $@iA; }
t($o/s(#&$/';
}
return t;
CMachine c;