i looking set employee list insert multiple items of data. example, want give employee id, name, , list of technology skills , list of personal skills. not employees have same amount of technology skills or personal skills have ability have multiples of each
so example be:
employeeid, employeename, techskill1, techskill2, persskill1 employeeid, employeename, techskill1, persskill1, persskill2 employeeid, employeename, techskill1, techskill2, techskill3, persskill1
is possible?
use class:
public class employee { /// <summary> /// employee's id /// </summary> public int id { get; set; } /// <summary> /// employuee's name /// </summary> public string name { get; set; } /// <summary> /// list of personal skills /// </summary> public list<string> persskills { get; private set; } /// <summary> /// list of tecnical skills /// </summary> public list<string> techskills { get; private set; } /// <summary> /// конструктор /// </summary> public employee() { this.persskills = new list<string>(); this.techskills = new list<string>(); } /// <summary> /// конструктор /// </summary> public employee(int id, string name, string[] persskills, string[] techskills) { this.id = id; this.name = name; this.persskills = new list<string>(persskills); this.techskills = new list<string>(techskills); } }
usage:
list<employee> employees = new list<employee>(); employees.add(new employee(1, "ivan", new string[] { "good friend" }, new string[] { "engineer" })); employees.add(new employee(2, "boris", new string[] { "personnel management", "tolerance" }, new string[] { "engineer", "programmer" }));
Comments
Post a Comment