示例#1
0
 private void UpdatePosition(PositionNames newPosition, Controls.TodoItem target)
 {
     _areas[target.Position].Controls.Remove(target);
     target.Position = newPosition;
     _areas[newPosition].Controls.Add(target);
     _service.Update(target.ID, newPosition, target.Description, target.ItemName);
 }
示例#2
0
 public void LoadData(Notepad.Dtos.TodoItem todoItem)
 {
     Id = todoItem.Id;
     this.txtName.Text        = todoItem.Name;
     this.txtDescription.Text = todoItem.Description;
     Position = todoItem.Position;
 }
示例#3
0
        private static void RemoveNumberFromPosition(PositionNames which, PositionPoint where)
        {
            int pos_x = 0, pos_y = 0;

            switch (which)
            {
            case PositionNames.One:
            case PositionNames.Four:
            case PositionNames.Seven:
                pos_x = where.One[(int)Pos.X];
                break;

            case PositionNames.Two:
            case PositionNames.Five:
            case PositionNames.Eight:
                pos_x = where.Two[(int)Pos.X];
                break;

            case PositionNames.Three:
            case PositionNames.Six:
            case PositionNames.Nine:
                pos_x = where.Three[(int)Pos.X];
                break;
            }
            switch (which)
            {
            case PositionNames.One:
            case PositionNames.Two:
            case PositionNames.Three:
                pos_y = where.One[(int)Pos.Y];
                break;

            case PositionNames.Four:
            case PositionNames.Five:
            case PositionNames.Six:
                pos_y = where.Four[(int)Pos.Y];
                break;

            case PositionNames.Seven:
            case PositionNames.Eight:
            case PositionNames.Nine:
                pos_y = where.Seven[(int)Pos.Y];
                break;
            }

            string chosen_string = planning_board[pos_y];
            var    char_version  = chosen_string.ToCharArray();

            char_version[pos_x]   = ' ';
            chosen_string         = new string(char_version);
            planning_board[pos_y] = chosen_string;
        }
示例#4
0
    public static SoccerPosition CreatePositionForName(PositionNames positionName, TeamManagement team)
    {
        Dictionary <PositionNames, SoccerPosition> PositionNameMap = new Dictionary <PositionNames, SoccerPosition>
        {
            { PositionNames.CenterForward, new CenterForward(team) },
            { PositionNames.LeftMidfielder, new LeftMidfielder(team) },
            { PositionNames.RightMidfielder, new RightMidfielder(team) },
            { PositionNames.LeftDefender, new LeftDefender(team) },
            { PositionNames.RightDefender, new RightDefender(team) },
        };

        return(PositionNameMap[positionName]);
    }
示例#5
0
        public void Update(int id, PositionNames position, string description, string name)
        {
            var parsedPosition = position.ToString();
            var sql            = $"update Todos set Description='{description}', name='{name}', position='{parsedPosition}' where id={id}";

            using (var connection = new SQLiteConnection(_connectionString))
            {
                connection.Open();
                using (var command = new SQLiteCommand(sql, connection))
                {
                    command.ExecuteNonQuery();
                }
                connection.Close();
            }
        }
示例#6
0
 void SliderEdit(PositionNames s, PositionNames g)
 {
     using (var change = new EditorGUI.ChangeCheckScope())
     {
         for (int i = (int)s; i < (int)g + 1; i++)
         {
             GUILayout.Space(10);
             muscles[i] = EditorGUILayout.Slider(((PositionNames)i).ToString(), muscles[i], -1, 1, GUILayout.Width(400));
         }
         if (change.changed)
         {
             SetMuscle();
             SetAnim();
         }
     }
 }
示例#7
0
        public int CreateToDoItem(string name, string description, PositionNames position)
        {
            var sql = $"insert into Todos (name, description, position) values('{name}','{description}','{position}')";

            using (var connection = new SQLiteConnection(_connectionString))
            {
                connection.Open();
                using (var command = new SQLiteCommand(sql, connection))
                {
                    command.ExecuteNonQuery();
                }

                connection.Close();
            }

            return(GetId(name));
        }
示例#8
0
        public (int, int) getActionInput(RefListens to)
        {
            if (RefListens.DoublePosition == to)
            {
                bool inputOne  = false;
                int  numeroUno = -1;
                Console.WriteLine("Which spot do you want to pick from?");
                while (inputOne == false)
                {
                    var userGives = Console.ReadLine();
                    try
                    {
                        if (PlayBoard.PositionNames.Contains(userGives.ToLower()))
                        {
                            numeroUno = (PlayBoard.PositionNames.IndexOf(userGives.ToLower()));
                            inputOne  = true;
                        }
                        else
                        {
                            Console.WriteLine("Player: Sorry that isnt a board positions, try again");
                        }
                    }
                    catch
                    {
                        Console.WriteLine("Player: please input correct co-ordinate you would like to move from. Eg a4");
                    }
                }
                Console.WriteLine("Which spot do you want to go to?");
                while (true)
                {
                    var userGives = Console.ReadLine();
                    try
                    {
                        if (PlayBoard.PositionNames.Contains(userGives.ToLower()))
                        {
                            return(numeroUno, PlayBoard.PositionNames.IndexOf(userGives.ToLower()));
                        }
                        else
                        {
                            Console.WriteLine("Player: Sorry that isnt a board positions, try again");
                        }
                    }
                    catch
                    {
                        Console.WriteLine("Player: please input correct co-ordinate you would like to move to. Eg d7");
                    }
                }
            }
            else if (RefListens.SinglePosition == to)
            {
                // tell the player to pick
                Console.WriteLine("Which spot do you want to pick?");

                while (true)
                {
                    var userGives = Console.ReadLine();
                    try
                    {
                        if (PlayBoard.PositionNames.Contains(userGives.ToLower()))
                        {
                            return(-1, PlayBoard.PositionNames.IndexOf(userGives.ToLower()));
                        }
                        else
                        {
                            Console.WriteLine("Player: Sorry that isnt a board positions, try again");
                        }
                    }
                    catch
                    {
                        Console.WriteLine("Player: please input correct co-ordinate. Eg a7");
                    }
                }
            }

            return(-1, -1);
        }
示例#9
0
 public void Update(int id, PositionNames position, string description, string name)
 {
     _sqliteDbTodoAdapter.Update(id, position, description, name);
 }
示例#10
0
 public void Update(int Id, PositionNames Position, string Description, string Name)
 {
     _repository.Update(Id, Position, Description, Name);
 }
示例#11
0
        public string GetServiceUrl()
        {
            var filter = new List <string>();

            var idFilter = new List <string>();

            if (NetworkIds != null && NetworkIds.Length > 0)
            {
                var networkIdFilter = NetworkIds.Where(n => !string.IsNullOrWhiteSpace((n ?? string.Empty))).Select(n => string.Format("toupper(NetworkID) eq '{0}'", n.ToUpperInvariant().Replace("'", "''"))).ToArray();
                if ((networkIdFilter?.Length ?? 0) > 0)
                {
                    idFilter.AddRange(networkIdFilter);
                    //filter.Add(string.Format("({0})", string.Join(" or ", networkIdFilter)));
                }
            }

            if (TimekeeperIds != null && TimekeeperIds.Length > 0)
            {
                var timekeeperIdFilter = TimekeeperIds.Where(n => !string.IsNullOrWhiteSpace((n ?? string.Empty))).Select(n => string.Format("toupper(TimekeeperID) eq '{0}'", n.ToUpperInvariant().Replace("'", "''"))).ToArray();
                if ((timekeeperIdFilter?.Length ?? 0) > 0)
                {
                    idFilter.AddRange(timekeeperIdFilter);
                    //filter.Add(string.Format("({0})", string.Join(" or ", timekeeperIdFilter)));
                }
            }

            if ((idFilter?.Count ?? 0) > 0)
            {
                filter.Add(string.Format("({0})", string.Join(" or ", idFilter)));
            }

            if (DepartmentCodes != null && DepartmentCodes.Length > 0)
            {
                var departmentCodeFilter = DepartmentCodes.Where(n => !string.IsNullOrWhiteSpace(n)).Select(n => string.Format("toupper(DepartmentCode) eq '{0}'", n.ToUpperInvariant().Replace("'", "''")));

                filter.Add(string.Format("({0})", string.Join(" or ", departmentCodeFilter)));
            }

            if (PositionNames != null && PositionNames.Length > 0)
            {
                var positionNameFilter = PositionNames.Where(n => !string.IsNullOrWhiteSpace(n)).Select(n => string.Format("toupper(PositionName) eq '{0}'", n.ToUpperInvariant().Replace("'", "''")));

                filter.Add(string.Format("({0})", string.Join(" or ", positionNameFilter)));
            }

            if (CurrentOnly)
            {
                filter.Add("EmploymentStatusID eq 1 ");
            }

            if (PartnerOnly)
            {
                filter.Add("Partner eq TimekeeperID");
            }

            if (ProfileTypes != null && ProfileTypes.Length > 0)
            {
                var profileTypeFilter = ProfileTypes.Select(n => string.Format("EmpTypeID eq {0}", (int)n));

                filter.Add(string.Format("({0})", string.Join(" or ", profileTypeFilter)));
            }
            if (!string.IsNullOrWhiteSpace(Keyword))
            {
                string   escapedString = Keyword.ToUpperInvariant().Replace("'", "''");
                string[] fieldsToPerformKeywordSearch = { "FirstName", "LastName", "MiddleName", "OfficeLocationName", "NetworkID", "TimekeeperID" };
                var      keywordFilter = fieldsToPerformKeywordSearch.Select(f => string.Format("indexof(toupper({0}), '{1}') gt -1", f, escapedString));

                filter.Add(string.Format("({0})", string.Join(" or ", keywordFilter)));
            }

            return(filter != null && filter.Count > 0 ? string.Join(" and ", filter) : null);
        }