Beispiel #1
0
        /// <summary>
        /// Open a form to delete a new report
        /// </summary>
        private void DeleteExecute()
        {
            try
            {
                if (AllReport != null)
                {
                    MessageBoxResult dialog = MessageBox.Show("Do you want to delete the selected row?", "Delete Reports", MessageBoxButton.YesNo);

                    if (dialog == MessageBoxResult.Yes)
                    {
                        Service s = new Service();

                        int  reportID = AllReport.ReportID;
                        bool isReport = s.IsReportID(reportID);
                        if (isReport == true)
                        {
                            s.DeleteReport(reportID);
                            AllReportList = s.GetAllReport().ToList();
                            PersonalReports personalReports = new PersonalReports();
                            personalReports.RefreshPersonal();
                        }
                        else
                        {
                            MessageBox.Show("Unable to delete selected row.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #2
0
        public PersonalReportsViewModel(PersonalReports personalReports)
        {
            this.personalReports = personalReports;

            Service s = new Service();

            ReportList = s.GetAllReportIDtbl(LoggedEmployee.ID).ToList();
        }