ãªãã»ã©ãã¤ã³ãã³ãã«åºã¥ãé層æ§é ã®å¦çãè¤éãªãã¤ã³ããªã®ã§ããã
ããå ·ä½çã«æ´çãã¦ã¿ã¾ãããã
Â
以ä¸ã®ãããªã±ã¼ã¹ãæ³å®ãã¦ããã¨ç解ãã¾ããï¼
```
[ã¤ã³ãã³ã0] è³ç£åè¨ â å¤A
 [ã¤ã³ãã³ã1] æµåè³ç£åè¨ â å¤B
  [ã¤ã³ãã³ã2] ç¾é â å¤C
  [ã¤ã³ãã³ã2] 売æé â å¤D
```
Â
ãã®ãããªé層æ§é ã«ããã¦ï¼
1. ã¤ã³ãã³ãã¬ãã«ãå¤ããéã®å¦ç
2. 親é ç®ã¨åé ç®ã®é¢ä¿æ§ã®ç®¡ç
3. ãããã³ã°å¤ã®æ¸ãæãã«ã¼ã«
Â
ããããæ確ã«ããå¿ è¦ãããã¾ããã
Â
C#ã§ã®è¨è¨ã¢ããã¼ãã¨ãã¦ã以ä¸ã®ãããªæ§é ãææ¡ãã¾ãï¼
Â
1. ãã¼ã¿ã¢ãã«è¨è¨
```csharp
class AccountItemÂ
{
  public string Name { string; set; } // ç§ç®å
  public int IndentLevel { get; set; } // ã¤ã³ãã³ãã¬ãã«
  public string MappedValue { get; set; } // ãããã³ã°å¤
  public AccountItem Parent { get; set; } // 親é ç®ã¸ã®åç §
  public List<AccountItem> Children { get; set; } // åé ç®ãªã¹ã
  public int RowIndex { get; set; } // Excelä¸ã®è¡çªå·
}
```
Â
2. å¦çããã¼ã®æ´ç
- ã¤ã³ãã³ãåå¾å¦ç
 - Excelã®ã»ã«æ¸å¼ããã¤ã³ãã³ãã¬ãã«ãåå¾
 - ã¾ãã¯å·¦ä½ç½ã®ãã¯ã»ã«æ°ããç®åº
Â
- é層æ§é æ§ç¯å¦ç
 - åå¾ã®è¡ã®ã¤ã³ãã³ãã¬ãã«ãæ¯è¼
 - 親åé¢ä¿ã®è¨å®
 - å å¼é ç®ã®ç¹å®
Â
- ãããã³ã°å¤æ´æ°å¦ç
 - é層æ§é ã«åºã¥ããããã³ã°å¤ã®ä¼æ
 - ä¸ä½é ç®ã¸ã®å½±é¿ã®èæ ®
Â
è¨è¨è³æã¨ãã¦ã以ä¸ã®è¦ç´ ã追å ã§æ´çããã¨è¯ãã¨æãã¾ãï¼
Â
1. ã¤ã³ãã³ãå¦çã®è©³ç´°ããã¼å³
2. é層æ§é ã®ç®¡çã«ã¼ã«
3. ãããã³ã°å¤ã®æ´æ°è¦å
4. ã¨ãã¸ã±ã¼ã¹ã®å®ç¾©ã¨å¦çæ¹é
Â
å ·ä½çã«ç¢ºèªãããç¹ãããã¾ãï¼
- ã¤ã³ãã³ãã¬ãã«ã¯ä½æ®µéããå¾ã¾ããï¼
- ãããã³ã°å¤ã®æ¸ãæãã«ã¼ã«ã¯ãã©ã®ãããªæ¡ä»¶ã§çºçãã¾ããï¼
- ä¾å¤çãªãã¿ã¼ã³ï¼é£ã³é層ãªã©ï¼ã¯ããã¾ããï¼