public int resetPassword(String emailAddress, String password)
        {
            using (var db = new PRMDataContext())
            {
                var query = (from data in db.Users
                             where data.Email == emailAddress
                             select data).SingleOrDefault();

                query.Password = password;

                db.SaveChanges();
                return(1);
            }
        }
        public void ProcessEmailRequests(List <long> list)
        {
            using (var ctx = new PRMDataContext())
            {
                foreach (var id in list)
                {
                    var dto = new EmailRequest()
                    {
                        EmailRequestID = id, EmailRequestStatus = (int)EmailRequestStatus.Processed
                    };
                    ctx.EmailRequests.Attach(dto);
                    var entry = ctx.Entry(dto);
                    entry.State = EntityState.Unchanged;
                    entry.Property(e => e.EmailRequestStatus).IsModified = true;
                }

                ctx.SaveChanges();
            }
        }