Example #1
0
 public OutsideInterest selectOutsideInterest(OutsideInterest obj)
 {
     try
     {
         IOutsideSvc svc = (IOutsideSvc)this.getService(typeof(IOutsideSvc).Name);
         return svc.selectOutsideInterest(obj);
     }
     catch (ServiceLoadException ex)
     {
         throw ex;
     }
 }
Example #2
0
        public bool insertOutsideInterest(OutsideInterest obj)
        {
            using (RealReportContext db = new RealReportContext())
            {
                try
                {
                    db.OutsideInterests.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Example #3
0
 public Boolean updateOutside(OutsideInterest obj)
 {
     try
     {
         IOutsideSvc svc = (IOutsideSvc)this.getService(typeof(IOutsideSvc).Name);
         if (obj.isDataEntered())
         {
             return svc.updateOutsideInterest(obj);
         }
         else
         {
             throw new BusinessValidationException(CustomErrors.REQUIRED_FIELD);
         }
     }
     catch (ServiceLoadException ex)
     {
         throw ex;
     }
 }
Example #4
0
        public bool deleteOutsideInterest(OutsideInterest obj)
        {
            using (RealReportContext db = new RealReportContext())
            {
                try
                {
                    IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests
                                                                      where outsideInterest.ID == obj.ID
                                                                      select outsideInterest;

                    if ((OutsideInterestList.ToArray().Length > 0))
                    {

                        db.OutsideInterests.Remove((OutsideInterestList.ToArray()[0]));

                        #region Database Submission

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
Example #5
0
        public OutsideInterest selectOutsideInterest(OutsideInterest obj)
        {
            RealReportContext db = new RealReportContext();

            try
            {
                IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests
                                                                  where outsideInterest.ID == obj.ID
                                                                  select outsideInterest;

                return (OutsideInterestList.ToList())[0];
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Example #6
0
        public bool updateOutsideInterest(OutsideInterest obj)
        {
            using (RealReportContext db = new RealReportContext())
            {
                try
                {

                    IQueryable<OutsideInterest> OutsideInterestList = from outsideInterest in db.OutsideInterests
                                                                      where outsideInterest.ID == obj.ID
                                                                      select outsideInterest;

                    if ((OutsideInterestList.ToArray()).Length > 0)
                    {
                        foreach (OutsideInterest OutsideInterest in OutsideInterestList)
                        {
                            //Modify Attributes
                        }

                        #region Database Submission with Rollback

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }
                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }