Exemplo n.º 1
0
        /// <summary>
        /// DeleteEmailsContext - Will do a soft delete (make inactive) by EmailID
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public void DeleteEmailsContext(sp_Email_DM _cEmail)
        {
            using (VolTeerEntities context = new VolTeerEntities())
            {
                var EmailsToRemove = (from n in context.tblVolEmails where n.EmailID == _cEmail.EmailID select n).FirstOrDefault();
                //context.tblVolEmails.Remove(EmailsToRemove);
                EmailsToRemove.ActiveFlg = false;
                context.sp_Vol_Email_Update(EmailsToRemove.EmailID, EmailsToRemove.VolID, EmailsToRemove.EmailAddr,
                    EmailsToRemove.ActiveFlg, EmailsToRemove.PrimaryFlg);
                context.SaveChanges();

            }
        }