public int UpdateWidget(Guid widgetID, string name, string description) { var list = GetList(x => x.ID == widgetID); if (list == null || list.Count == 0) { return(0); } list[0].Name = name; list[0].Description = description; WidgetsMapperService widgetsService = new WidgetsMapperService(); try { widgetsService.Save(list[0]); } catch { return(0); } return(1); }
public void RemoveWidgets(Guid portletID) { IList <WidgetsNHibernate> widgets = GetQuery().Where(x => x.PortletID == portletID).ToList(); WidgetsMapperService widgetsService = new WidgetsMapperService(); foreach (WidgetsNHibernate w in widgets) { widgetsService.Delete(w); } }