Exemple #1
0
        private void getLeft()
        {
            string        connectstring = WebConfigurationManager.ConnectionStrings["tayanaConnectionString"].ToString();
            SqlConnection connect       = new SqlConnection(connectstring);

            string sqlstring = "SELECT  * FROM country";

            SqlCommand getsql = new SqlCommand(sqlstring, connect);

            connect.Open();
            SqlDataAdapter adapter = new SqlDataAdapter(getsql);
            DataTable      table   = new DataTable();

            adapter.Fill(table);
            LeftList.DataSource = table;
            LeftList.DataBind();
        }
Exemple #2
0
 private void CalculatePuzzleBounds()
 {
     for (int i = PuzzleSize - 1; i < PuzzleEndState.Count; i += PuzzleSize)
     {
         RightList.Add(i);
     }
     for (int i = 0; i < PuzzleEndState.Count; i += PuzzleSize)
     {
         LeftList.Add(i);
     }
     for (int i = 0; i < PuzzleSize; i++)
     {
         UpList.Add(i);
     }
     for (int i = PuzzleEndState.Count - PuzzleSize; i < PuzzleEndState.Count; i++)
     {
         DownList.Add(i);
     }
 }
Exemple #3
0
        private void getleft()
        {
            string        connecting = WebConfigurationManager.ConnectionStrings["tayanaConnectionString"].ToString();
            SqlConnection connect    = new SqlConnection(connecting);

            string sqlstring = @"SELECT  yachts.id, yachts.type, yachtsDetails.detailID, yachtsDetails.typeID, yachtsDetails.serial, yachtsDetails.date
            FROM yachts INNER JOIN
            yachtsDetails ON yachts.id = yachtsDetails.typeID";


            SqlCommand command = new SqlCommand(sqlstring, connect);

            connect.Open();
            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataTable      table   = new DataTable();

            adapter.Fill(table);
            LeftList.DataSource = table;
            LeftList.DataBind();
        }
Exemple #4
0
        private Node Left(Node fromNode)
        {
            Node LeftOfNode = new Node()
            {
                ParentNode = fromNode, Direction = Direction.Left, Length = fromNode.Length + 1, State = NodeState.Untested
            };
            List <int> CurrentPuzzleState = new List <int>();

            CurrentPuzzleState = fromNode.PuzzleState.ToList();

            int Location = 0;
            int WhitePuzzlePieceLocation       = new int();
            int LeftOfWhitePuzzlePieceLocation = new int();

            foreach (int item in CurrentPuzzleState)
            {
                if (item == MoveablePiece)
                {
                    WhitePuzzlePieceLocation       = Location;
                    LeftOfWhitePuzzlePieceLocation = Location - 1;
                }
                Location++;
            }
            if (!LeftList.Contains(WhitePuzzlePieceLocation))
            {
                CurrentPuzzleState = SwapLocation(CurrentPuzzleState, WhitePuzzlePieceLocation, LeftOfWhitePuzzlePieceLocation);
                LeftOfNode         = SetNodeInfo(LeftOfNode, CurrentPuzzleState);
                //Debug.WriteLine("Left");
            }
            else
            {
                LeftOfNode.IsMoveable = false;
                LeftOfNode.State      = NodeState.Closed;
            }
            if (CheckCompletion(CurrentPuzzleState) == true)
            {
                LeftOfNode.Direction = Direction.None;
                EndingNode           = LeftOfNode;
            }
            return(LeftOfNode);
        }