示例#1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            Result result = _userAdminManager.Add(new UserAdmin
            {
                Password = txtPassword.Text,
                UserName = txtUserName.Text
            });

            if (result.ResultState == ResultState.Erorr)
            {
                MessageBox.Show(result.Message, "Hata işlem yapılamadı");
            }
            else
            {
                DataGridFill();
            }
        }
示例#2
0
        public async Task <ActionResult> Create(UserViewModel viewModel)
        {
            try
            {
                // TODO: Add insert logic here
                IdentityUser user = new IdentityUser
                {
                    Email    = viewModel.UserName,
                    UserName = viewModel.UserName
                };
                await _userAdminManager.Add(viewModel.Password, user, viewModel.Role).ConfigureAwait(false);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DirectoryHelper directoryHelper = new DirectoryHelper("C:\\", "SiparisOtomasyonuDb");

            if (!directoryHelper.DirectoryExists())
            {
                directoryHelper.Create();
            }
            UserAdminManager manager = UserAdminManager.CreateAsSingleton(PathHelper.UserAdminPathModel);
            UserAdmin        admin   = manager.Entities.Find(I => I.UserName == "admin" && I.Password == "12345");

            if (admin == null)
            {
                manager.Add(new UserAdmin {
                    UserName = "******", Password = "******"
                });
            }
            Application.Run(new MDIForm());
        }