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
| int count = pagingList.Count;
int idx = 0;
Func<MonObject, int, string> chooser = (e, index) =>
{
if (index == 0)
{
return "<input type='button' id='upCourse' onclick='ajaxUpCoursChosenList(\"" + e.clefCours + "\",\"" + e.campaign_id + "\",\"" + e.set_id + "\");' class='button_up'/>"; //--- Actions Ht
}
else if (index == count - 1)
{
return "<input type='button' id='dwCourse' onclick='ajaxDwCoursChosenList(\"" + e.clefCours + "\",\"" + e.campaign_id + "\",\"" + e.set_id + "\");' class='button_down'/>"; //--- Actions Dw
}
else
{
return "<input type='button' id='delCourse' onclick='ajaxDlCoursChosenList(\"" + e.clefCours + "\",\"" + e.campaign_id + "\",\"" + e.set_id + "\");' class='button_del'/>"; //--- Actions Del
}
};
var showDatas = from element in pagingList
select new[] { Convert.ToString(element.campaignCourse.priority), //--- Priorite
element.nomCours, //--- Nom du cours
Convert.ToString(element.nombreCredits), //--- Nombre de credit
element.strIntervenantsNames, //--- Liste des intervenants
chooser(element,idx++)
}; |
Partager