Exemplo n.º 1
0
        private void fillinScreen()
        {
            users_login user = new users_login().SelectByID(this.PKID);

            ddlRole.SelectedValue = user.role_id.ToString();
            txtUser.Text          = user.username;
            txtPassword.Text      = user.password;
            txtEmail.Text         = user.email;

            if (!String.IsNullOrEmpty(user.responsible_test) && user.responsible_test.Length > 0)
            {
                String[] repo = user.responsible_test.Split(Constants.CHAR_COMMA);



                lstTypeOfTest.SelectionMode = ListSelectionMode.Multiple;
                foreach (ListItem item in lstTypeOfTest.Items)
                {
                    foreach (String r in repo)
                    {
                        if (item.Value == r)
                        {
                            item.Selected = true;
                        }
                    }
                }
            }

            ddlTitle.SelectedValue = user.personal_title.ToString();
            txtFirstName.Text      = user.first_name;
            txtLastName.Text       = user.last_name;
        }
Exemplo n.º 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txtEmail.Text))
            {
                users_login user = new users_login().SelectByEmail(txtEmail.Text);
                if (user != null)
                {
                    //force change password
                    user.password = CustomUtils.EncodeMD5("1234");
                    user.is_force_change_password = true;
                    user.Update();

                    removeSession();
                    txtEmail.Text = String.Empty;
                    Message       = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>Account information has been sent to you email.</span></div>";
                }
                else
                {
                    Message = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>This email is not found.</span></div>";
                }
            }
            else
            {
                Message = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>Please enter email.</span></div>";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            users_login user = new users_login().SelectByID(userLogin.id);

            txtUsername.Text = user.username;
            //txtPassword.Text = user.password;
        }
Exemplo n.º 4
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            //try
            //{
            try
            {
                //The code that causes the error goes here.
                users_login user = objUser.Login();
                if (user != null)
                {
                    Session.Add(Constants.SESSION_USER, user);
                    if (!Convert.ToBoolean(user.is_force_change_password))
                    {
                        removeSession();
                        Response.Redirect(Constants.LINK_SEARCH_JOB_REQUEST);
                    }
                    else
                    {
                        Response.Redirect("ForceChangePassword.aspx");
                    }
                }
                else
                {
                    Message = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>Enter any username and passowrd.</span></div>";
                }
            }
            catch (ReflectionTypeLoadException ex)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Exception exSub in ex.LoaderExceptions)
                {
                    sb.AppendLine(exSub.Message);
                    FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
                    if (exFileNotFound != null)
                    {
                        if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
                        {
                            sb.AppendLine("Fusion Log:");
                            sb.AppendLine(exFileNotFound.FusionLog);
                        }
                    }
                    sb.AppendLine();
                }
                string errorMessage = sb.ToString();
                //Display or log the error based on your application.
                Message = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>" + errorMessage + "</span></div>";
            }


            //}
            //catch (Exception ex)
            //{
            //    Message = "<div class=\"alert alert-error\"><button class=\"close\" data-dismiss=\"alert\"></button><span>"+ex.Message+"</span></div>";
            //}
        }
Exemplo n.º 5
0
        protected void gvResult_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            this.PKID = int.Parse(e.Keys[0].ToString().Split(Constants.CHAR_COMMA)[0]);

            users_login user = new users_login().SelectByID(this.PKID);

            if (user != null)
            {
                user.Delete();
                //Commit
                GeneralManager.Commit();

                bindingData();
            }
        }