public ActionResult Create(string email, string firstName, string lastName, string userName, string permissionProfileId, string groupId)
        {
            // Obtain your OAuth token
            var accessToken    = RequestItemsService.User.AccessToken;
            var basePath       = RequestItemsService.Session.AdminApiBasePath;
            var accountId      = RequestItemsService.Session.AccountId;
            var organizationId = RequestItemsService.OrganizationId;

            try
            {
                // Call the Admin API to create a new user
                var user = CreateUser.CreateNewUser(accessToken, basePath, Guid.Parse(accountId),
                                                    organizationId, firstName, lastName, userName, email, Int64.Parse(permissionProfileId), Int64.Parse(groupId));

                //Show results
                ViewBag.h1          = "Create a new eSignature user";
                ViewBag.message     = "Results from eSignUserManagement:createUser method:";
                ViewBag.Locals.Json = JsonConvert.SerializeObject(user, Formatting.Indented);

                return(View("example_done"));
            }
            catch (ApiException apiException)
            {
                ViewBag.errorCode    = apiException.ErrorCode;
                ViewBag.errorMessage = apiException.Message;

                return(View("Error"));
            }
        }
Ejemplo n.º 2
0
        //New User Create
        private void button3_Click(object sender, EventArgs e)
        {
            string username = usernameBox.Text;
            string password = passwordBox.Text;

            if (username == "" || password == "")
            {
                MessageBox.Show("Username or password is empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                cr_user.CreateNewUser(username, password);
                CleanBox();
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
Start:
            //Display user with options to choose
            Console.Clear();
            Console.WriteLine("1. Create User:"******"2. Login User:"******"Please enter your choice");
            string opt = Console.ReadLine();

            //Display user with options to choose
            Console.Clear();
            Console.WriteLine("Please enter your Username");
            string username = Console.ReadLine();

            Console.WriteLine("Please enter your Password");
            string password = Console.ReadLine();

            if (Convert.ToInt32(opt) < 1 && Convert.ToInt32(opt) > 2)
            {
                Console.WriteLine("Please choose numbers between 1 and 2"); goto Start;
            }

            string message;

            if (Convert.ToInt32(opt) == 1)
            {
                CreateUser createUser = new CreateUser();
                message = createUser.CreateNewUser(username, password);
            }
            else
            {
                LoginUser loginUser = new LoginUser();
                message = loginUser.Login(username, password);
            }
            Console.WriteLine(message);
        }