public bool deleteDashboardItem(int itemID)
 {
     try
     {
         StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext();
         dbmlObject.DeleteDashboardItem(itemID);
         dbmlObject.SubmitChanges();
     }
     catch (Exception e) { throw e; }
     return(true);
 }
 public bool deleteDashboard(int dashboardID)
 {
     try
     {
         StoredProcedureDataContext dbmlobject = new StoredProcedureDataContext();
         var result = dbmlobject.RetreiveExistingDashboardItems(dashboardID, "nothing").ToList();
         foreach (var item in result)
         {
             dbmlobject.DeleteDashboardItem(item.ItemID);
         }
         dbmlobject.DeleteDashboard(dashboardID);
         dbmlobject.SubmitChanges();
     }
     catch (Exception e) { throw e; }
     return(true);
 }
 public bool AddDashboardItem(DashboardItem Item, int[] Sources, int[] WorkingTeams)
 {
     try
     {
         StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext();
         if (Item.ItemID != 0) //if it is a Edit Option
         {
             dbmlObject.DeleteDashboardItem(Item.ItemID);
         }
         var resItemID = dbmlObject.AddDataItem(Item.ItemName, Item.StartDate, Item.EndDate, Item.DashboardID, Item.StatusID).ToList();
         dbmlObject.SubmitChanges();
         int itemID = Convert.ToInt32(resItemID.FirstOrDefault().Column1);
         AddDashboardItemTeams(WorkingTeams, itemID);
         AddDashboardItemSource(Sources, itemID);
     }
     catch (Exception e) { Console.WriteLine(e); }
     return(true);
 }