コード例 #1
0
        public IActionResult CompleteRegistration(string email, string username, string password)
        {
            Models.Users.UserModel user;

            if (logic.Register(email, username, password) != null)
            {
                user = new Logic.User(_configuration).Register(email, username, password);

                HttpContext.Session.SetString("currentUser", JsonConvert.SerializeObject(user));
            }

            return(RedirectToAction("Index", "Home"));
        }
コード例 #2
0
ファイル: UserDTO.cs プロジェクト: IAmLex/BookOverflowASP
 public UserDTO(Logic.User user)
 {
     this.Id         = user.Id;
     this.Image      = user.Image;
     this.Password   = user.Password;
     this.FirstName  = user.FirstName;
     this.Insertion  = user.Insertion;
     this.LastName   = user.LastName;
     this.Permission = (int)user.Permission;
     this.ZipCode    = user.ZipCode;
     this.CreatedAt  = user.CreatedAt;
     this.DeletedAt  = user.DeletedAt;
     this.DeletedBy  = user.DeletedBy.Id;
 }
コード例 #3
0
ファイル: UserControlGroup.cs プロジェクト: m12k/Files
        private void SetControlListingAccessRights()
        {
            try
            {
                using (var user = new Logic.User(Common.Core.ConnectionString))
                {
                    var result = user.GetAccessRights(Common.Core.UserId, BTSS.Common.Core.Module.MODULE);

                    userControlListing.CanEdit = result.CanEdit.Value;
                }

            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: m12k/Files
    private void Initialize()
    {
        try
        {
            user = new User(Core.ConnectionString);
            Validation = new Validation();
            timerConnected = new Timer();
            timerConnected.Tick += new EventHandler(TimerConnected_Ticks);
            
            Validation.Validate(this);
            toolStripStatusLabelUserName.Text = "User: "******"Refresh Database List");
            toolTipMain.SetToolTip(buttonConnect, "Connect to Database");

            SetAccessRights();

            StringBuilder sb = new StringBuilder();
            Text = sb.Append(Text).Append(" ").Append(Application.ProductVersion).ToString();          
        }
        catch (Exception)
        {
            throw;
        }
    }
コード例 #5
0
ファイル: FormLogin.cs プロジェクト: m12k/Files
        private void Initialize()
        {
            try
            {
                user = new BTSS.Logic.User(Common.Core.ConnectionString);
 
                string authentication;
                authentication = System.Configuration.ConfigurationManager.AppSettings["Authentication"];

                windowsUserName = Environment.UserDomainName + "\\" + Environment.UserName;

                if (authentication == "Application Authentication")
                { 
                    string value;
                    value = System.Configuration.ConfigurationManager.AppSettings["RememberMe"];
                     
                    if (value != null)
                    {
                        checkBoxRememberMe.Checked = Convert.ToBoolean(value);
                        textBoxUserName.Text = System.Configuration.ConfigurationManager.AppSettings["UserName"];
                        comboBoxAuthentication.SelectedIndex = 1; 
                        textBoxPassword.Focus();                    
                    }
                }
                else
                {
                    comboBoxAuthentication.SelectedIndex = 0;
                    textBoxUserName.Text = windowsUserName;
                }


               
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #6
0
 public UserController(IConfiguration configuration)
 {
     _configuration = configuration;
     logic          = new Logic.User(_configuration);
 }