public void UpdateNSOCovenant(ProxyNSOCovenant covenant)
        {
            CacheHelper.ClearCache();
            //using (Xrm.XrmServiceContext context = new Xrm.XrmServiceContext("Xrm"))
            //{
            var c = (from s in this.xrm.new_nsocovenantSet
                     where s.Id == covenant.ID
                     select s).FirstOrDefault();

            if (c != null)
            {
                //c.new_Status = covenant.Status;
                //c.new_CompliedWith = Convert.ToInt32(covenant.CompliedWith);


                //c.new_Description = covenant.CovenantDescription;
                //c.new_CovenantType = covenant.CovenantType;
                c.new_CompliedWith = covenant.CompliedWithID;
                c.new_Status       = covenant.StatusID;
                c.new_DueDate      = covenant.DueDate;
                //c.new_FrequencyofReview = covenant.FrequencyOfReview;
                //c.new_name = covenant.Name;
                //covenant.
                c.new_SubmissionDate = covenant.SubmissionDate;

                this.xrm.UpdateObject(c);
                this.xrm.SaveChanges();
            }
            //}
        }
        public Entity.ProxyNSOCovenant GetOneNSOCovenant(Guid id)
        {
            CacheHelper.ClearCache();
            ProxyNSOCovenant covenant = null;
            //using (Xrm.XrmServiceContext context = new Xrm.XrmServiceContext("Xrm"))
            //{
            var c = this.xrm.new_nsocovenantSet.Where(i => i.Id == id).FirstOrDefault();

            if (c != null)
            {
                covenant = ObjectConverter.SingleConvertToNSOCovenant(c);
            }
            //}
            return(covenant);
        }