public Contact GetContact(decimal ID , bool Fetch)
 {
     Contact contact=new Contact(ID , this._owner);
     if(Fetch)
         contact.Fetch();
     return contact;
 }
        public Contact GetContact(decimal ID, bool Fetch)
        {
            Contact contact = new Contact(ID, this._owner);

            if (Fetch)
            {
                contact.Fetch();
            }
            return(contact);
        }
        public void SendDistribution(decimal distributionId, DateTime getCacheFrom, Guid olapTaskGuid, out bool isFromCache)
        {
            try
            {
                isFromCache = false;

                FI.DataAccess.Distributions dacObj = DataAccessFactory.Instance.GetDistributionsDA();
                decimal userId = dacObj.GetDistributionOwnerId(distributionId);
                if (userId <= 0)
                {
                    return;
                }

                User         user   = new User(userId, true);
                Distribution distr  = user.DistributionSystem.GetDistribution(distributionId, true);
                Report       report = distr.Report;

                if (report.IsProxy)
                {
                    report.Open();
                }

                if (report.State == Report.StateEnum.Open)
                {
                    OlapReport olapRpt = report as OlapReport;
                    if (olapRpt != null)
                    {
                        olapRpt.Execute(olapTaskGuid);
                    }
                    else
                    {
                        report.Execute();
                    }
                }

                Contact contact = distr.Contact;
                if (contact.IsProxy)
                {
                    contact.Fetch();
                }


                SendReport(report, new Contact[] { contact }, distr.Format, getCacheFrom, out isFromCache);
            }
            catch (Exception exc)
            {
                Common.LogWriter.Instance.WriteEventLogEntry(exc);
                throw exc;
            }
        }