Example #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (User.Username != null)
         {
             if (BusinessLogicLayer.Adduser(User.Username, User.Password))
             {
                 MessageBox.Show("user added successfully");
             }
             else
             {
                 MessageBox.Show("something went wrong");
             }
         }
         else
         {
             MessageBox.Show("select user to add");
         }
     }
     catch (Exception f)
     {
         MessageBox.Show(f.Message);
     }
 }
Example #2
0
        //to Add user
        public static void AddUser(string username, string password)
        {
            if (username != null)
            {
                Console.WriteLine(username + " requested for user login id");
                Console.WriteLine("username :"******"password : "******"press 1 to add user ");
                Console.WriteLine("press 2 to exit");
                int Userid = int.Parse(Console.ReadLine());
                if (Userid == 1)
                {
                    if (Business.Adduser(username, password))
                    {
                        Console.WriteLine("user added successfully");
                    }
                    else
                    {
                        Console.WriteLine("user not added opps!!!");
                    }
                }
                else
                {
                    Console.WriteLine("thank you");
                }
            }
            else
            {
                Console.WriteLine("no Request for Adding user");
            }
        }