Beispiel #1
0
            public List <ConsultantItem> GetAllReferrals(ConsultantItem cItem, List <ConsultantItem> list)
            {
                List <ConsultantItem> children = new List <ConsultantItem>();
                var referrals = list.Where(i => i.ReferrerID == cItem.ID).ToList();

                if (referrals != null & referrals.Count != 0)
                {
                    children.AddRange(referrals);

                    foreach (var referral in referrals)
                    {
                        children.AddRange(GetAllReferrals(referral, list));
                    }
                }

                return(children);
            }
 public ActionResult ConsultantDelete([DataSourceRequest] DataSourceRequest request, ConsultantItem consultantItem)
 {
     if (consultantItem != null)
     {
         service.DeleteConsultant(consultantItem);
     }
     return(Json(new[] { consultantItem }.ToDataSourceResult(request, ModelState)));
 }