Exemplo n.º 1
0
        public Stream ShowEmpImage(int userId)
        {
            try
            {

                UserEntity newEntity = new UserEntity();
                UserService newService = new UserService();

                newEntity = newService.GetOne(userId);

                return new MemoryStream(newEntity.Picture);
            }
            catch
            {
                return null;
            }
            finally
            {

            }
        }
        protected void submit_Click(object sender, EventArgs e)
        {
            serv = new UserService();

            string email = txtEmail.Text.Trim();
            string password = serv.GetPassword(email);

            if (String.IsNullOrEmpty(password))
            {
                ClientScript.RegisterStartupScript(GetType(), "UserMsg", "<script>alert('Oooppss, email does not exist yet...');if(alert){ window.location='ForgetPassword.aspx';}</script>");

            } else {
                string body = string.Format(@"<p>Hi there old champ,</p>
                            <p>Here is you precious password that you seem to forgot: <strong>{0}</strong></p>
                            <p>Please don't forget it again, ok? Good, have a nice day!</p>
                            <p>Thanks!</p>", password);

                Utility.Send("MoneyLoandering.com - Forgot Password", body, email, true);

                ClientScript.RegisterStartupScript(GetType(), "UserMsg", "<script>alert('Password Successfully Sent. Please check your email for the password.');if(alert){ window.location='Login.aspx';}</script>");

            }
        }
        private void LoadUsers()
        {
            UserService usrSrv = new UserService();

            DataTable oTable = usrSrv.GetUsersForDropdown();
            ddlUser.DataSource = oTable;
            ddlUser.DataTextField = "desc";
            ddlUser.DataValueField = "id";
            ddlUser.DataBind();

            ddlUser.Items.Insert(0, new ListItem("-- Select --", "0"));
            ddlUser.SelectedIndex = 0;
        }
        private void PopulateFields(int id)
        {
            newEntity = new InvestorEntity();
            newEntity = newService.GetOne(id);

            UserEntity usrEnt = new UserEntity();
            UserService usrSrv = new UserService();
            usrEnt = usrSrv.GetOne(newEntity.UserId);

            txtAmount.Text = newEntity.Amount.ToString();
            txtNotes.Text = newEntity.Notes;
            ddlUser.SelectedValue = newEntity.UserId.ToString();
        }