Exemplo n.º 1
0
        public int IsUserExist(MemberUserObject user)
        {
            bool flag = false;

            con.Open();
            SqlCommand command = new SqlCommand("Select u_id From Users Where u_name='" + user.u_name + "' And u_password='******'", con);

            return(Convert.ToInt32(command.ExecuteScalar()));
        }
Exemplo n.º 2
0
        public void AddEmpDetails(MemberUserObject EmpDetails)
        {
            try
            {
                con.Open();
                SqlCommand command = new SqlCommand("INSERT INTO ShoppingCart.Users (u_name,u_adress,u_id,u_password,u_email) VALUES (" + EmpDetails.u_name + "," + EmpDetails.u_adress + ", " + EmpDetails.u_id + "," + EmpDetails.u_password + "," + EmpDetails.u_email + "); ", con);
                flag = Convert.ToBoolean(command.ExecuteScalar());

                if (flag)
                {
                    Console.WriteLine("welcome");
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                con.Dispose();
                con.Close();
            }
        }