示例#1
0
 public AmplifyingReportView GetById(int id)
 {
     try
     {
         using (AmplifyingReportRepository ARRepo = new AmplifyingReportRepository())
         {
             AmplifyingReportView ARViewModel = new AmplifyingReportView();
             {
                 ARViewModel = ARRepo.Get <AmplifyingReportView>(id);
                 return(ARViewModel);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        public bool Delete(int id)
        {
            try
            {
                using (AmplifyingReportRepository ARRepo = new AmplifyingReportRepository())
                {
                    var ARExisting = ARRepo.Get <AmplifyingReport>(id);
                    if (ARExisting == null)
                    {
                        return(false);
                    }

                    else
                    {
                        ARRepo.Delete <AmplifyingReport>(id);
                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }