Example #1
0
        public LeadPresentation UpdateLeadPresentation(LeadPresentation objLeadPresentation)
        {
            try
            {
                objLeadPresentation.updateDate = DateTime.Now;
                using (var context = new FitnessCenterEntities())
                {
                    context.LeadPresentations.Attach(context.LeadPresentations.Single(varL => varL.ID == objLeadPresentation.ID));
                    context.LeadPresentations.ApplyCurrentValues(objLeadPresentation);

                    context.SaveChanges();
                    return(objLeadPresentation);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public LeadPresentation InsertLeadPresentation(LeadPresentation objLeadPresentation)
        {
            try
            {
                objLeadPresentation.insertDate = DateTime.Now;
                objLeadPresentation.isActive   = true;
                objLeadPresentation.isDeleted  = false;

                using (var context = new FitnessCenterEntities())
                {
                    context.LeadPresentations.AddObject(objLeadPresentation);
                    context.SaveChanges();
                    return(objLeadPresentation);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }