public bool EditDashboard(Dashboard dashboardDetails, int UserDetails, string[] newSource, int[] deletedSource, DashboardStatus[] newStatus, int[] deletedStatus) { try { StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext(); dbmlObject.EditDashboard(dashboardDetails.DashboardId, dashboardDetails.DashboardName, dashboardDetails.StartMonth, dashboardDetails.StartYear, dashboardDetails.EndMonth, dashboardDetails.EndYear, dashboardDetails.Description); int dashboardID = dashboardDetails.DashboardId; foreach (var source in newSource) { dbmlObject.AddDashboardSources(source, dashboardID); } foreach (int sid in deletedSource) { dbmlObject.DeleteDashboardSource(sid); } foreach (var status in newStatus) { dbmlObject.AddDashboardStatus(status.Status, status.Color, dashboardID); } foreach (int sid in deletedStatus) { dbmlObject.DeleteDashboardStatus(sid); } dbmlObject.SubmitChanges(); } catch (Exception e) { throw e; } return(true); }