Пример #1
0
        static void Main(string[] args)
        {
            Program     p  = new Program();
            Sherin_Heer sh = new Sherin_Heer();
            Customer    c  = new Customer();

            Console.WriteLine("*********************WELCOME TO SHERIAL BEAUTY PARLOUR*********************");
            Console.WriteLine("(1) Login");
            Console.WriteLine("(2) Registration");
            Console.WriteLine("Where u wanna go ? Select no.: ");
            int n = Convert.ToInt32(Console.ReadLine());

            switch (n)
            {
            case 1:
                c.login();
                break;

            case 2:
                c.registration();
                c.login();
                break;

            default:
                Console.WriteLine("Choose correct number...");
                break;
            }
        }
Пример #2
0
        public override void login()
        {
            try
            {
abcd:
                Sherin_Heer sh = new Sherin_Heer();
                SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\hiral\sem 6\dot net\Sherial\Sherial\sherial.mdf;Integrated Security=True;User Instance=True");
                con.Open();
                SqlCommand com = new SqlCommand("select count(*) from Registration where Email=@email and Password=@Password", con);

                Console.WriteLine("Login:--");
                Console.WriteLine("Enter Email: ");
                email = Console.ReadLine();
                Console.WriteLine("Enter Password: "******"@email", email);
                com.Parameters.AddWithValue("@Password", password);
                int result = (int)com.ExecuteScalar();

                if (result > 0)
                {
                    //Console.WriteLine("", id);
                    fetch_id();
                    Console.WriteLine("Successfully logged in...");
                    Console.WriteLine("Where u want to go?");
                    Console.WriteLine("1. Time Schedule");
                    Console.WriteLine("2. Logout");
                    int j = Convert.ToInt32(Console.ReadLine());
                    switch (j)
                    {
                    case 1:
                        if (email == "*****@*****.**" && password == "admin")
                        {
                            sh.itimeschedule();
                        }
                        else
                        {
                            timeschedule();
                            booking();
                        }
                        break;

                    case 2:
                        logout();
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("U havnt registered yet..Or enter the correct email and password.. Try again...");
                    goto abcd;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }