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
| public class clsZAC : DependencyObject
{
private long _lngZACId, _lngVERId, _lngCMPId;
public static DependencyProperty ZACIdProperty = DependencyProperty.Register("ZACId", typeof(long), typeof(clsZAC));
public static DependencyProperty VERIdProperty = DependencyProperty.Register("VERId", typeof(long), typeof(clsZAC));
public static DependencyProperty CMPIdProperty = DependencyProperty.Register("CMPId", typeof(long), typeof(clsZAC));
public static DependencyProperty VERProperty = DependencyProperty.Register("VER", typeof(clsVER), typeof(clsZAC));
public static DependencyProperty CMPProperty = DependencyProperty.Register("CMP", typeof(clsCMP), typeof(clsZAC));
public clsZAC() : base()
{
ZACId = -1;
}
public long ZACId
{
get { return (long)GetValue(ZACIdProperty); }
set { SetValue(ZACIdProperty, value); }
}
public long CMPId
{
get { return (long)GetValue(CMPIdProperty); }
set
{
SetValue(CMPIdProperty, value);
SetValue(CMPProperty, clsCMP.GetBusinessObjectByDataRow(clsCrud.GetCrud().SelectCMPbyId(value)));
}
}
public long VERId
{
get { return (long)GetValue(VERIdProperty); }
set
{
SetValue(VERIdProperty, value);
SetValue(VERProperty, clsVER.GetBusinessObjectByDataRow(clsCrud.GetCrud().SelectVERbyId(value)));
}
}
public clsVER VER
{
get { return (clsVER)GetValue(VERProperty); }
set
{
SetValue(VERProperty, value);
SetValue(VERIdProperty, value.VERId);
}
}
public clsCMP CMP
{
get { return (clsCMP)GetValue(CMPProperty); }
set
{
SetValue(CMPProperty, value);
SetValue(CMPIdProperty, value.CMPId);
}
}
/// <summary>
/// retourne un objet de cette classe en fonction de la DataRow passer en parametre
/// </summary>
/// <param name="r"></param>
/// <param name="crud"></param>
/// <returns></returns>
public static clsZAC GetBusinessObjectByDataRow(DATA_ACCESS.DTS_CVMANAGER.ZAC_CMP_VERRow r)
{
if (r != null)
{
return new clsZAC() { CMPId = r.CMP_ID, VERId = r.VER_ID, ZACId = r.ZAC_ID };
}
else
return null;
}
} |
Partager