Exemple #1
0
 public Opportunity GetOpportunity(int id)
 {
     try
     {
         return(_repository.Get(id));
     }
     catch
     {
         return(null);
     }
 }
        public ModelResponse Get(UserInfo user, long id)
        {
            OpportunityVm r;

            try
            {
                //Authorization
                if (user == null)
                {
                    return(new ModelResponse(101));
                }
                if (!DalFactory.Singleton.DataService.IsAdmin(user.UserId))
                {
                    if (!user.IsApproved || user.IsIndividual || user.OrgContactId == null)
                    {
                        return(new ModelResponse(101));
                    }
                    if (!Repo.IsByOrgContact(id, (long)user.OrgContactId))
                    {
                        return(new ModelResponse(101));
                    }
                }

                r = Repo.Get(id);
                if (r == null)
                {
                    return(new ModelResponse(101));
                }
            }
            catch (Exception ex)
            {
                return(new ModelResponse(ex));
            }

            return(new ModelResponse(0, r));
        }
Exemple #3
0
 public OpportunityEntity Get(string id)
 {
     return(_repository.Get(id));
 }