• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.UserRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SocioBoard.Model.UserRepository的典型用法代码示例。如果您正苦于以下问题:C# UserRepository类的具体用法?C# UserRepository怎么用?C# UserRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserRepository类属于SocioBoard.Model命名空间,在下文中一共展示了UserRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Login

        public string Login(string EmailId, string Password)
        {
            //
            try
            {
                UserRepository userrepo = new UserRepository();
                Registration regObject = new Registration();
                User user = userrepo.GetUserInfo(EmailId, regObject.MD5Hash(Password));

                if (user != null)
                {
                    return new JavaScriptSerializer().Serialize(user);
                }
                else
                {
                    return "Invalid user name or password";
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return null;
            }
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:25,代码来源:UserService.asmx.cs


示例2: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            UserRepository objUerRepo = new UserRepository();
            if (!IsPostBack)
            {
                try
                {
                   chkUser.DataSource = objUerRepo.getAllUsers();
                    chkUser.DataTextField = "UserName";
                    chkUser.DataValueField = "Id";
                    chkUser.DataBind();
                    if (Request.QueryString["Id"] != null)
                    {
                        NewsLetterRepository objNewsRepo = new NewsLetterRepository();
                        NewsLetter news = objNewsRepo.getNewsLetterDetailsbyId(Guid.Parse(Request.QueryString["Id"].ToString()));
                        txtSubject.Text = news.Subject;
                        Editor.Text = news.NewsLetterDetail;
                        txtSendDate.Text = news.SendDate.ToString();

                      //  datepicker.Text = news.ExpiryDate.ToString();
                      //  ddlStatus.SelectedValue = news.Status.ToString();
                    }
                }
                catch (Exception Err)
                {
                    logger.Error(Err.Message);
                    Response.Write(Err.StackTrace);
                }
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:30,代码来源:AddNewsLetter.aspx.cs


示例3: btnForgotPwd_Click

        protected void btnForgotPwd_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                bool exist = false;
                UserRepository objUserRepo = new UserRepository();
                Registration regObject = new Registration();

                if (!string.IsNullOrEmpty(txtEmail.Text.Trim()))
                {
                    string strUrl = string.Empty;
                    // c.customer_email = txtEmail.Text.Trim();
                    // exist = custrepo.ExistedCustomerEmail(c);
                    User usr = objUserRepo.getUserInfoByEmail(txtEmail.Text);

                    if (usr != null)
                    {
                        string URL = Request.Url.AbsoluteUri;
                        //strUrl = Server.MapPath("~/ChangePassword.aspx") + "?str=" + txtEmail.Text + "&type=forget";
                        strUrl = URL.Replace("ForgetPassword.aspx", "ChangePassword.aspx" + "?str=" + regObject.MD5Hash(txtEmail.Text) + "&type=forget");
                        strUrl = (strUrl + "?userid=" + usr.Id).ToString();

                        string MailBody = "<body bgcolor=\"#FFFFFF\"><!-- Email Notification from SocioBoard.com-->" +
                    "<table id=\"Table_01\" style=\"margin-top: 50px; margin-left: auto; margin-right: auto;\"" +
                    " align=\"center\" width=\"650px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ><tr>" +
                   "<td height=\"20px\" style=\"background-color: rgb(222, 222, 222); text-align: center; font-size: 15px; font-weight: bold; font-family: Arial; color: rgb(51, 51, 51); float: left; width: 100%; margin-top: 7px; padding-top: 10px; border-bottom: 1px solid rgb(204, 204, 204); padding-bottom: 10px;\">" +
                       "SocioBoard</td></tr><!--Email content--><tr>" +
                   "<td style=\"background-color: #dedede; padding-top: 10px; padding-left: 25px; padding-right: 25px; padding-bottom: 30px; font-family: Tahoma; font-size: 14px; color: #181818; min-height: auto;\"><p>Hi , " + usr.UserName + "</p><p>" +
                       "Please click <a href=" + strUrl + " style=\"text-decoration:none;\">here</a> to proceed for password Reset</td></tr><tr>" +
                   "<td style=\"background-color: rgb(222, 222, 222); margin-top: 10px; padding-left: 20px; height: 20px; color: rgb(51, 51, 51); font-size: 15px; font-family: Arial; border-top: 1px solid rgb(204, 204, 204); padding-bottom: 10px; padding-top: 10px;\">Thanks" +
                   "</td></tr></table><!-- End Email Notification From SocioBoard.com --></body>";

                        string username = ConfigurationManager.AppSettings["username"];
                        string host = ConfigurationManager.AppSettings["host"];
                        string port = ConfigurationManager.AppSettings["port"];
                        string pass = ConfigurationManager.AppSettings["password"];
                        string from = ConfigurationManager.AppSettings["fromemail"];

                        //   string Body = mailformat.VerificationMail(MailBody, txtEmail.Text.ToString(), "");
                        string Subject = "Forget Password Socio Board account";
                        //MailHelper.SendMailMessage(host, int.Parse(port.ToString()), username, pass, txtEmail.Text.ToString(), string.Empty, string.Empty, Subject, MailBody);
                        MailHelper.SendSendGridMail(host, Convert.ToInt32(port), from, "", txtEmail.Text.ToString(), string.Empty, string.Empty, Subject, MailBody, username, pass);

                        lblerror.Text = "Please check your mail for the instructions.";
                    }
                    else
                    {
                        lblerror.Text = "Your Email is wrong Please try another one";
                    }
                }
                //else
                //{
                //    lblerror.Text = "Please enter your Email-Id";
                //}
            }
            catch (Exception Err)
            {
                logger.Error(Err.StackTrace);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:60,代码来源:ForgotPassword.aspx.cs


示例4: changePassoword

        public void changePassoword(object sender, EventArgs e)
        {
            if (txtPassword.Text != "" && txtConfirmPassword.Text != "")
            {
                if (txtPassword.Text == txtConfirmPassword.Text)
                {
                    User user = (User)Session["LoggedUser"];
                    Registration regpage = new Registration();
                    string changedpassword = regpage.MD5Hash(txtConfirmPassword.Text);
                    UserRepository userrepo = new UserRepository();
                    userrepo.ChangePassword(changedpassword, user.Password, user.EmailId);
                    txtConfirmPassword.Text = string.Empty;
                    txtPassword.Text = string.Empty;
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Your password has been changed successfully.')", true);
                }
                else
                {

                }
            }
            else
            {

            }
        }
开发者ID:Kiranub313,项目名称:socioboard,代码行数:25,代码来源:PersonalSettings.aspx.cs


示例5: btnLogin_Click

        protected void btnLogin_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtEmail.Text) && !string.IsNullOrEmpty(txtPassword.Text))
                {
                    SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
                          UserRepository userrepo = new UserRepository();
                    Registration regObject = new Registration();
                    User user = userrepo.GetUserInfo(txtEmail.Text, regObject.MD5Hash(txtPassword.Text));
                    if (user == null)
                    {
                        Response.Write("user is null");
                    }

                    if (user.PaymentStatus == "unpaid")
                    {
                        if (DateTime.Compare(DateTime.Now, user.ExpiryDate) < 0)
                        {
                            if (user != null)
                            {
                                Session["LoggedUser"] = user;
                                FormsAuthentication.SetAuthCookie(user.UserName, true);
                                Response.Redirect("/Home.aspx", false);
                            }
                            else
                            {
                                //  txterror.Text = "Invalid UserName Or Password";
                            }
                        }
                        else
                        {
                            Response.Redirect("Settings/Billing.aspx");
                        }
                    }
                    else
                    {
                        Session["LoggedUser"] = user;
                        FormsAuthentication.SetAuthCookie(user.UserName, true);
                        Response.Redirect("/Home.aspx", false);

                    }

                }
            }
            catch (Exception ex)
            {

                logger.Error(ex.StackTrace);

                Console.WriteLine(ex.StackTrace);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:53,代码来源:Login.aspx.cs


示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {

            try
                {
                        byte[] parameters = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
                        PaymentTransaction paymentTransaction = new PaymentTransaction();
                        PaymentTransactionRepository paymentRepo = new PaymentTransactionRepository();

                        if (parameters.Length > 0)
                        {
                            IPNMessage ipn = new IPNMessage(parameters);
                            bool isIpnValidated = ipn.Validate();
                            string transactionType = ipn.TransactionType;
                            NameValueCollection map = ipn.IpnMap;
                            
                            paymentTransaction.AmountPaid = map["payment_gross"];
                            paymentTransaction.PayPalTransactionId = map["txn_id"];
                            paymentTransaction.UserId = Guid.Parse(map["custom"].ToString());
                            paymentTransaction.Id = Guid.NewGuid();
                            paymentTransaction.IPNTrackId = map["ipn_track_id"];
                            
                            paymentTransaction.PayerEmail = map["payer_email"];
                            paymentTransaction.PayerId = map["payer_id"];
                            paymentTransaction.PaymentStatus = map["payment_status"];

                            
                            
                                logger.Info("Payment Status : " + paymentTransaction.PaymentStatus);
                                logger.Info("User Id : " +paymentTransaction.UserId);
                            

                            paymentTransaction.PaymentDate = DateTime.Now;
                            paymentTransaction.PaypalPaymentDate = map["payment_date"];
                            paymentTransaction.ReceiverId = map["receiver_id"];
                            paymentRepo.SavePayPalTransaction(paymentTransaction);
                            UserRepository userrepo = new UserRepository();
                            if (paymentTransaction.PaymentStatus == "Completed")
                            {
                                userrepo.changePaymentStatus(paymentTransaction.UserId, "paid");
                            }
                        }
                    }
                
                catch (System.Exception ex)
                {
                    logger.Error(ex.StackTrace);
                }
            
            
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:51,代码来源:IPNHandler.aspx.cs


示例7: changePassoword

        public void changePassoword(object sender, EventArgs e)
        {
            try
            {
                Registration regpage = new Registration();
                string OldPassword = regpage.MD5Hash(txtOldPassword.Text);
                if (txtOldPassword.Text != "")
                {
                    if (txtPassword.Text.Trim() != "" && txtConfirmPassword.Text.Trim() != "" && txtOldPassword.Text != "")
                    {
                        if (txtPassword.Text == txtConfirmPassword.Text)
                        {
                            User user = (User)Session["LoggedUser"];
                            if (OldPassword == user.Password)
                            {

                                string changedpassword = regpage.MD5Hash(txtConfirmPassword.Text);
                                UserRepository userrepo = new UserRepository();
                                userrepo.ChangePassword(changedpassword, user.Password, user.EmailId);
                                txtConfirmPassword.Text = string.Empty;
                                txtPassword.Text = string.Empty;
                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Your password has been changed successfully.')", true);
                            }
                            else
                            {
                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Your password is Incorrect.')", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Password Mismatch.')", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Invalid Password.')", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Please enter your old password.')", true);
                }
            }
            catch (Exception ex)
            {

                Console.WriteLine(ex.Message);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:49,代码来源:PersonalSettings.aspx.cs


示例8: IsUserValid

        /// <summary>
        /// This function check Is User Exist or Not created by Abhay Kr 5-2-2014
        /// </summary>
        /// <param name="UserId"></param>
        /// <returns>bool</returns>
        public bool IsUserValid(string UserId, ref User user)
        {
            bool ret = false;
            try
            {

                UserRepository objUserRepository = new UserRepository();
                user = objUserRepository.getUsersById(Guid.Parse(UserId));
                if (user != null)
                    ret = true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                logger.Error(ex.Message);
            }
            return ret;
        }
开发者ID:rathika1,项目名称:socioboard,代码行数:23,代码来源:Registration.aspx.cs


示例9: btnForgotPwd_Click

        protected void btnForgotPwd_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                bool exist = false;
                UserRepository objUserRepo = new UserRepository();
                Registration regObject = new Registration();

                if (!string.IsNullOrEmpty(txtEmail.Text.Trim()))
                {
                    string strUrl = string.Empty;
                    User usr = objUserRepo.getUserInfoByEmail(txtEmail.Text);
                    if (usr != null)
                    {
                        string URL = Request.Url.AbsoluteUri;
                        strUrl = URL.Replace("ForgetPassword.aspx", "ChangePassword.aspx" + "?str=" + regObject.MD5Hash(txtEmail.Text) + "&type=forget");
                        strUrl = (strUrl + "?userid=" + usr.Id).ToString();
                        string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/ResetPassword.htm");
                        string MailBody = File.ReadAllText(mailpath);
                        MailBody = MailBody.Replace("%replink%", strUrl);
                        MailBody = MailBody.Replace("%name%", usr.UserName);
                        string username = ConfigurationManager.AppSettings["username"];
                        string host = ConfigurationManager.AppSettings["host"];
                        string port = ConfigurationManager.AppSettings["port"];
                        string pass = ConfigurationManager.AppSettings["password"];
                        string from = ConfigurationManager.AppSettings["fromemail"];

                        //   string Body = mailformat.VerificationMail(MailBody, txtEmail.Text.ToString(), "");
                        string Subject = "Forget Password SocioBoard account";
                        //MailHelper.SendMailMessage(host, int.Parse(port.ToString()), username, pass, txtEmail.Text.ToString(), string.Empty, string.Empty, Subject, MailBody);
                        MailHelper.SendSendGridMail(host, Convert.ToInt32(port), from, "", txtEmail.Text.ToString(), string.Empty, string.Empty, Subject, MailBody, username, pass);
                        lblerror.Text = "Please check your mail for the instructions.";
                    }
                    else
                    {
                        lblerror.Text = "Your Email is wrong Please try another one";
                    }
                }
            }
            catch (Exception Err)
            {
                logger.Error(Err.StackTrace);
            }
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:44,代码来源:ForgotPassword.aspx.cs


示例10: SetPaymentStatus

        public int SetPaymentStatus(Guid guid)
        {
            int res = 0;
            try
            {
                UserRepository objUserRepository = new UserRepository();
                User user = new Domain.User();
                user.Id = guid;
                user.PaymentStatus = "paid";

                res=objUserRepository.UpdatePaymentStatusByUserId(user);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return res;
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:19,代码来源:SuccessPaypal.aspx.cs


示例11: Register

        public string Register(string EmailId, string Password, string AccountType, string FirstName, string LastName)
        {

            try
            {
                UserRepository userrepo = new UserRepository();
                if (!userrepo.IsUserExist(EmailId))
                {
                    Registration regObject = new Registration();
                    User user = new User();
                    user.AccountType = AccountType;
                    user.EmailId = EmailId;
                    user.CreateDate = DateTime.Now;
                    user.ExpiryDate = DateTime.Now.AddMonths(1);
                    user.Password = regObject.MD5Hash(Password);
                    user.PaymentStatus = "unpaid";
                    user.ProfileUrl = string.Empty;
                    user.TimeZone = string.Empty;
                    user.UserName = FirstName + " " + LastName;
                    user.UserStatus = 1;
                    user.Id = Guid.NewGuid();
                    UserRepository.Add(user);
                    MailSender.SendEMail(user.UserName,Password, EmailId);
                    return new JavaScriptSerializer().Serialize(user);
                }
                else
                {
                    return "Email Already Exists";
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }



        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:40,代码来源:UserService.asmx.cs


示例12: btnResetPwd_Click

        protected void btnResetPwd_Click(object sender, EventArgs e)
        {
            try
            {
                Registration regpage = new Registration();
                string changedpassword = regpage.MD5Hash(txtpass.Text);
                UserRepository userrepo = new UserRepository();
                if (userrepo.ResetPassword(Guid.Parse(userid.ToString()), changedpassword.ToString()) > 0)
                {
                    lblerror.Text = "Password Reset Successfully";
                }
                else
                {
                    lblerror.Text = "Problem Password Reset";
                }

            }
            catch (Exception Err)
            {
                logger.Error(Err.StackTrace);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:22,代码来源:ResetPassword.aspx.cs


示例13: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString != null)
                {
                    try
                    {
                        string custom = Request.QueryString["custom"];
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error : " + ex.StackTrace);
                    }
                }

                if (Request.Form != null)
                {

                    //Get O/P >> Request.Form {mc_gross=89.00&protection_eligibility=Eligible&address_status=confirmed&payer_id=HYNG9RCLH48WC&tax=0.00&address_street=1+Main+St&payment_date=04%3a05%3a11+Feb+14%2c+2014+PST&payment_status=Completed&charset=windows-1252&address_zip=95131&first_name=Babita&mc_fee=2.88&address_country_code=US&address_name=Babita+Sinha&notify_version=3.7&custom=256f9c69-6b6a-4409-a309-b1f6d1f8e43b&payer_status=unverified&business=pbpraveen%40globussoft.com&address_country=United+States&address_city=San+Jose&quantity=1&payer_email=babitasinha102%40yahoo.com&verify_sign=AudjwUiCo.wy3HNpdy6W2f1OTj7HAMzUhH.XfOvEQoXh3Jg8DE1dsZLc&txn_id=20X29418LJ642962P&payment_type=instant&last_name=Sinha&address_state=CA&receiver_email=pbpraveen%40globussoft.com&payment_fee=2.88&receiver_id=AF2RVCTNXRVHA&txn_type=web_accept&item_name=Deluxe&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=256f9c69-6b6a-4409-a309-b1f6d1f8e43b&payment_gross=89.00&shipping=0.00&merchant_return_link=click+here&auth=AWBkWTCIt.vP.rsV.Pgb3ZpjH10upSH98oRXgsj.ZmWOGUNmMf50qaZ4Jq.rEcQNtFpYp0DJpbStsLJlkXfYxig}

                    Guid custom =Guid.Parse(Request.Form["custom"].ToString());
                    int res = SetPaymentStatus(custom);

                    UserRepository objUserRepository = new UserRepository();

                    Session["LoggedUser"] = objUserRepository.getUsersById(custom);

                    Response.Redirect("Home.aspx");
                }

                
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:38,代码来源:SuccessPaypal.aspx.cs


示例14: ChangePassword

        public string ChangePassword(string EmailId, string Password, string NewPassword)
        {
            try
            {
                User user = new User();
                UserRepository userrepo = new UserRepository();
                int i = userrepo.ChangePassword(NewPassword, Password, EmailId);
                if (i == 1)
                {
                    return "Password Changed Successfully";
                }
                else
                {
                    return "Invalid EmailId";
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Please Try Again";
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:23,代码来源:UserService.asmx.cs


示例15: changePassoword

 public void changePassoword(object sender, EventArgs e)
 {
     try
     {
         if (txtPassword.Text != "" && txtConfirmPassword.Text != "")
         {
             if (txtPassword.Text == txtConfirmPassword.Text)
             {
                 User user = (User)Session["LoggedUser"];
                 Registration regpage = new Registration();
                 string changedpassword = regpage.MD5Hash(txtConfirmPassword.Text);
                 UserRepository userrepo = new UserRepository();
                 userrepo.ChangePassword(changedpassword, user.Password, user.EmailId);
                 txtConfirmPassword.Text = string.Empty;
                 txtPassword.Text = string.Empty;
             }
         }
     }
     catch (Exception Err)
     {
         Console.Write(Err.Message);
     }
 }
开发者ID:utkarshx,项目名称:socioboard,代码行数:23,代码来源:PersonalSettings.aspx.cs


示例16: GetTwitterFeedsAPI

 public void GetTwitterFeedsAPI(string UserId, string TwitterId)
 {
     try
     {
         Guid userId = Guid.Parse(UserId);
         UserRepository userrepo = new UserRepository();
         TwitterAccountRepository twtAccRepo = new TwitterAccountRepository();
         TwitterAccount twtAcc = twtAccRepo.getUserInformation(userId, TwitterId);
         oAuthTwitter oAuth = new oAuthTwitter();
         oAuth.AccessToken = twtAcc.OAuthToken;
         oAuth.AccessTokenSecret = twtAcc.OAuthSecret;
         oAuth.ConsumerKey = ConfigurationManager.AppSettings["consumerKey"];
         oAuth.ConsumerKeySecret = ConfigurationManager.AppSettings["consumerSecret"];
         oAuth.TwitterUserId = twtAcc.TwitterUserId;
         oAuth.TwitterScreenName = twtAcc.TwitterScreenName;
         TwitterHelper twtHelper = new TwitterHelper();
         twtHelper.getUserFeed(oAuth, twtAcc, userId);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
     }
 }
开发者ID:utkarshx,项目名称:socioboard,代码行数:23,代码来源:TwitterService.asmx.cs


示例17: btnSignup_Click

        protected void btnSignup_Click(object sender, ImageClickEventArgs e)
        {
            User user = new User();
            UserRepository userrepo = new UserRepository();

            try
            {
                if (txtPassword.Text == txtConfirmPassword.Text)
                {
                    user.AccountType = "free";
                    user.CreateDate = DateTime.Now;
                    user.ExpiryDate = DateTime.Now.AddMonths(1);
                    user.Id = Guid.NewGuid();
                    user.UserName = txtUserName.Text;
                    user.Password = this.MD5Hash(txtPassword.Text);
                    user.EmailId = txtEmail.Text;
                    user.UserStatus = 1;
                    if (!userrepo.IsUserExist(user.EmailId))
                    {
                        UserRepository.Add(user);
                        MailSender.SendEMail(txtUserName.Text, txtPassword.Text, txtEmail.Text);
                        lblerror.Text = "registered successfully !" + "<a href=\"login.aspx\">login</a>";
                    }
                    else
                    {
                        lblerror.Text = "email already exists " + "<a href=\"login.aspx\">login</a>";
                    }
                }

            }
            catch (Exception ex)
            {
                lblerror.Text = "Please Insert Correct Information";
                Console.WriteLine(ex.StackTrace);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:36,代码来源:Registration.aspx.cs


示例18: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            string ret = string.Empty;
            try
            {
                User objUser = new User();
                UserRepository objUserRepository = new UserRepository();
                scheduling objscheduling = new scheduling();
                ScheduledMessage objScheduledMessage = new ScheduledMessage();
                ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository();
                List<ScheduledTracker> lstScheduledTracker = objScheduledMessageRepository.GetAllScheduledDetails();
                foreach (ScheduledTracker item in lstScheduledTracker)
                {
                    try
                    {
                        //List<ScheduledMessage> lstScheduledMessage = objScheduledMessageRepository.getAllMessagesOfUser(Guid.Parse(item._Id));
                        List<ScheduledMessage> lstUnsentScheduledMessage = objScheduledMessageRepository.getAllIUnSentMessagesOfUser(Guid.Parse(item._Id));
                        objUser = objUserRepository.getUsersById(Guid.Parse(item._Id));
                        ret += "<tr class=\"gradeX\"><td><a href=\"ScheduledMessageDetail.aspx?id=" + objUser.Id + "\">" + objUser.UserName + "</a></td><td>" + item._count + "</td><td>" + (item._count - lstUnsentScheduledMessage.Count()) + "</td><td>" + lstUnsentScheduledMessage.Count() + "</td></tr>";

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                     
                    }
                }
            }
            catch (Exception ex)
            {

                Console.WriteLine(ex.Message);
            }

            Response.Write(ret);
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:36,代码来源:Ajaxscheduled.aspx.cs


示例19: btnRegister_Click

        protected void btnRegister_Click(object sender, ImageClickEventArgs e)
        {
            Session["login"] = null;
            Registration regpage = new Registration();
            User user = (User)Session["LoggedUser"];

            if (user != null)
            {
                user.EmailId = txtEmail.Text;
                user.UserName = txtFirstName.Text + " " + txtLastName.Text;
              
                UserRepository userrepo = new UserRepository();
                if (userrepo.IsUserExist(user.EmailId))
                {

                    try
                    {
                        user.AccountType = Request.QueryString["type"];
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                        Console.WriteLine(ex.StackTrace);
                    }
                    if (string.IsNullOrEmpty(user.Password))
                    {
                        user.Password = regpage.MD5Hash(txtPassword.Text);
                        userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName,user.AccountType);
                        MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text);
                    }
                }
                Session["LoggedUser"] = user;

                Response.Redirect("Home.aspx");
            }
        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:36,代码来源:SNL.aspx.cs


示例20: ProcessRequest

        public void ProcessRequest()
        {
            if (Request.QueryString["op"] == "login")
            {
                try
                {
                    string email = Request.QueryString["username"];
                    string password = Request.QueryString["password"];
                    Registration regpage = new Registration();
                    password = regpage.MD5Hash(password);
                    SocioBoard.Helper.SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
                    UserRepository userrepo = new UserRepository();
                    LoginLogs objLoginLogs = new LoginLogs();
                    LoginLogsRepository objLoginLogsRepository = new LoginLogsRepository();
                    User user = userrepo.GetUserInfo(email, password);
                    if (user == null)
                    {
                        Response.Write("Invalid Email or Password");
                    }
                    else
                    {
                        if (user.UserStatus == 1)
                        {
                            Session["LoggedUser"] = user;
                            // List<User> lstUser = new List<User>();
                            if (Session["LoggedUser"] != null)
                            {
                                //SocioBoard.Domain.User.lstUser.Add((User)Session["LoggedUser"]);
                                //Application["OnlineUsers"] = SocioBoard.Domain.User.lstUser;
                                //objLoginLogs.Id = new Guid();
                                //objLoginLogs.UserId = user.Id;
                                //objLoginLogs.UserName = user.UserName;
                                //objLoginLogs.LoginTime = DateTime.Now.AddHours(11.50);
                                //objLoginLogsRepository.Add(objLoginLogs);
                                Groups objGroups = new Groups();
                                GroupRepository objGroupRepository = new GroupRepository();
                                Team objteam = new Team();
                                TeamRepository objTeamRepository = new TeamRepository();
                                objGroups = objGroupRepository.getGroupDetail(user.Id);
                                if (objGroups == null)
                                {
                                    //================================================================================
                                    //Insert into group

                                    try
                                    {
                                        objGroups = new Groups();
                                        objGroups.Id = Guid.NewGuid();
                                        objGroups.GroupName = ConfigurationManager.AppSettings["DefaultGroupName"];
                                        objGroups.UserId = user.Id;
                                        objGroups.EntryDate = DateTime.Now;
                                        objGroupRepository.AddGroup(objGroups);

                                        objteam.Id = Guid.NewGuid();
                                        objteam.GroupId = objGroups.Id;
                                        objteam.UserId = user.Id;
                                        objteam.EmailId = user.EmailId;
                                        // teams.FirstName = user.UserName;
                                        objTeamRepository.addNewTeam(objteam);

                                        SocialProfile objSocialProfile = new SocialProfile();
                                        SocialProfilesRepository objSocialProfilesRepository = new SocialProfilesRepository();

                                        List<SocialProfile> lstSocialProfile = objSocialProfilesRepository.getAllSocialProfilesOfUser(user.Id);
                                        if (lstSocialProfile != null)
                                        {
                                            if (lstSocialProfile.Count > 0)
                                            {
                                                foreach (SocialProfile item in lstSocialProfile)
                                                {
                                                    try
                                                    {
                                                        TeamMemberProfile objTeamMemberProfile = new TeamMemberProfile();
                                                        Team 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SocketIO.SocketIOEvent类代码示例发布时间:2022-05-26
下一篇:
C# Domain.User类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap