Пример #1
0
        public void sendText(string phoneNo, string msg)
        {
            ServiceReference1.SUSMSClient isuService = new ServiceReference1.SUSMSClient();

            UserDao dao = new UserDaoImpl();
            User u = dao.getUserByPhone(phoneNo);

            if (u!=null)
            {
                if(u.Text)
                {
                    try
                    {
                        string response = isuService.sendSMS(u.Carrier, u.Phone, msg);
                        Console.Write(response);
                    }
                    catch(Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }

                }

            }
        }
Пример #2
0
        public User getProfileInfo(string email)
        {
            UserDaoImpl uDao = new UserDaoImpl();
            User currentUser = uDao.getUserByEmail(email);

            return currentUser;
        }
Пример #3
0
        protected void EditProfileBtn_Click(object sender, EventArgs e)
        {
            int rows = 0;
            UserDaoImpl dao = new UserDaoImpl();
            u = new User();
            u.Email = email.Text;
            u.Address = address.Text;
            u.City = city.Text;
            u.LastName = lastName.Text;
            u.Phone = MobilePhone.Text;
            u.FirstName = firstName.Text;
            u.State = DropDownList1.SelectedValue;
            u.Zip = Convert.ToInt32(zipCode.Text);
            u.Text = checkToText.Checked;
            u.Carrier = CarrierList.SelectedValue;

            //Verifies correct password was input to modify profile info
            if (userControl.authenticate(email.Text, password1.Text))
            {
                rows = dao.updateUser(u);
            }
            else
            {
                ResultLabel.Text = "Password was incorrect.  Please try again.";
                return;
            }
            //Upon successful update of profile user is redirected back to Auction.asp
            if (rows == 1)
                ResultLabel.Text = "Changes Successfully Saved!";
            else
            {
                ResultLabel.Text = "Unable to update your profile at this time.";
            }
        }
Пример #4
0
 public bool authenticate(string userEmail, string pass)
 {
     UserDaoImpl userDao = new UserDaoImpl();
     Credentials creds = userDao.getCredentialsByEmail(userEmail);
     if (creds.Password.Equals(pass))
     {
         return true;
     }
     else
         return false;
 }
Пример #5
0
        public bool signIn(Credentials c)
        {
            bool valid = false;
            UserDao = new UserDaoImpl();
            Credentials = userDao.getCredentialsByEmail(c.Email);

            if(Credentials != null && Credentials.Equals(c))
            {
                User = userDao.getUserByEmail(c.Email);
                valid = true;
            }
            return valid;
        }
Пример #6
0
        public bool authenticate(string userEmail, string pass)
        {
            bool valid = false;
            UserDaoImpl user = new UserDaoImpl();
            Credentials c = user.getCredentialsByEmail(userEmail);
            Credentials inputCreds = new Credentials(userEmail, pass);

            if (c.Password.Equals(inputCreds.Password) && c.Email.Equals(inputCreds.Email))
            {
                User u = user.getUserByEmail(c.Email);
                valid = true;
            }
            return valid;
        }
Пример #7
0
        public void approveRequest(List<int> requestIDList)
        {
            UserDaoImpl userDao = new UserDaoImpl();
            List<Request> requestList = new List<Request>();
            foreach(int id in requestIDList)
            {
                requestList.Add(userDao.getRequestByID(id));
            }

            foreach(Request r in requestList)
            {
                userDao.approveRequest(r);
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                UserDaoImpl dao = new UserDaoImpl();
                //ItemDaoImpl dao = new ItemDaoImpl();

                //Credentials creds = dao.getCredentialsByEmail(TextBox1.Text.ToString());
                //User user = dao.getUserByEmail(TextBox1.Text.ToString());
                //List<Item> list = dao.getItemsByCategory(TextBox1.Text.ToString());
                //Item item = dao.getItemByNumber(TextBox1.Text.ToString());
                //Response.Write(list.Count);
                //list.ForEach(printItem );
                //Response.Write(item.ToString());

                //Item i = new Item()
                //{
                //    CategoryID = "CP",
                //    UserID = 100,
                //    ItemName = "TestItem",
                //    ItemValue = 100,
                //    AngelPrice = 75,
                //    MinBid = 50,
                //    Paid = false
                //};

                User u = new User()
                {
                    Email = "*****@*****.**",
                    FirstName = "Tim",
                    LastName = "Lenahan",
                    Address = "123 Easy st",
                    City = "Normal",
                    State = "IL",
                    Zip = 61761,
                    Admin = true,
                    Committee = false,
                    Donor = false,
                    Phone = "6303106285",
                    Text = true
                };
                dao.createUser(u);

                //int newID = dao.createItem(i);
                //Response.Write(i.ItemID);

            }
        }
Пример #9
0
        public bool signUp(User u, Credentials c)
        {
            bool valid = false;
            userDao = new UserDaoImpl();

            if (userDao.createUser(u))
            {
                User = u;
                if (userDao.createCredentials(c))
                {
                    Credentials = c;
                    valid = true;
                }
            }
            return valid;
        }
        public void sendInvoiceEmail(string email, DataSet ds)
        {
            UserDao dao = new UserDaoImpl();
            User toUser = dao.getUserByEmail(email);

            string toAddress = toUser.Email; // not ", "
            string[] toArray = toAddress.Split(',');

            string newUserId = toUser.UserID.ToString();
            string newUserfName = toUser.FirstName;
            string newUserlName = toUser.LastName;

            string senderEmail = "*****@*****.**";
            string senderName = "The Baby Fold Festival of Trees";

            MailAddress messageFrom = new MailAddress(senderEmail.ToLower(), senderName);
            //                    MailAddress messageTo = new MailAddress(to.Text);
            MailMessage emailMessage = new MailMessage();
            emailMessage.From = messageFrom;
            for (int i = 0; i < toArray.Length; ++i)
            {
                MailAddress messageTo = new MailAddress(toArray[i]);
                emailMessage.To.Add(messageTo.Address);
            }

            string html = @"<html><body><img src=""cid:LogoId""><div>Hello " + newUserfName + " " + newUserlName + ",<br /> Thank you so much for coming to Festival of Trees.<br />"
            + getHtml(ds)
            + "<br />Thank you for your support,"
            + "<br />  Festivel Of Trees Team</body></html>";
            AlternateView altView = AlternateView.CreateAlternateViewFromString(html, null, MediaTypeNames.Text.Html);

            LinkedResource yourPictureRes = new LinkedResource(HttpContext.Current.Server.MapPath("~\\assets\\image\\Email.jpg"), MediaTypeNames.Image.Jpeg);
            yourPictureRes.ContentId = "LogoId";
            altView.LinkedResources.Add(yourPictureRes);

            emailMessage.AlternateViews.Add(altView);

            string messageSubject = "Festival Of Trees: Your Invoice";
            string messageBody = html;
            emailMessage.Subject = messageSubject;
            emailMessage.Body = messageBody;
            SmtpClient mailClient = new SmtpClient("smtp.ilstu.edu");

            mailClient.UseDefaultCredentials = true;
            mailClient.Send(emailMessage);
        }
Пример #11
0
        public bool signUp(User u, Credentials c)
        {
            bool valid = false;
            UserDaoImpl userDao = new UserDaoImpl();
            userDao.createUser(u);

            if (true)
            {
                userDao.createCredentials(c);
                if (true)
                {
                    Credentials creds = c;

                    valid = true;
                    Session["StartTime"] = DateTime.UtcNow;
                    Session["Name"] = userEmailTxt.Text;
                    Session["Admin"] = "No";
                    Response.Redirect("Profile.aspx");
                }
            }
            return valid;
        }
Пример #12
0
 public SignUpController()
 {
     userDao = new UserDaoImpl();
 }
Пример #13
0
 public LoginController()
 {
     user = new UserDaoImpl();
 }
Пример #14
0
        public bool isAdmin(string userEmail, string pass)
        {
            bool admin = false;
            UserDaoImpl user = new UserDaoImpl();
            Credentials c = user.getCredentialsByEmail(userEmail);

            if (c != null)
            {
                User u = user.getUserByEmail(c.Email);
                if (u.Admin)
                {
                    admin = true;
                }
            }
            return admin;
        }
Пример #15
0
 public SearchUserController()
 {
     userDaoImpl = new UserDaoImpl();
 }
Пример #16
0
 public User getBuyerInfo(string userId)
 {
     UserDaoImpl user = new UserDaoImpl();
     return user.getUserByNum(userId);
 }
Пример #17
0
 public void createRequest(Request request)
 {
     UserDaoImpl uDao = new UserDaoImpl();
     uDao.createRequest(request);
 }