iT邦幫忙

0

VS__C#__LINQ__抓資料問題

要作單位跟職稱的GRID,人員統計,如下圖
https://ithelp.ithome.com.tw/upload/images/20180926/20108584rsMJXMbb2z.jpg

目前主管說,21個職稱就21個欄位+21個對應人數+單位PK,一個單位添加一次

我想問看看,有沒其他方法?

看更多先前的討論...收起先前的討論...
小魚 iT邦大師 1 級 ‧ 2018-09-26 12:08:21 檢舉
聽起來很合理啊,
幾個職稱不是就要幾個欄位嗎?
除非你能夠再合併成一大類.
優悠 iT邦新手 3 級 ‧ 2018-09-26 13:35:08 檢舉
CLASS有點長,看看有沒有其他簡便的作法

public class XXXInfo
{
public int UnitPK { get; set; }
public string UnitName { get; set; }
public int Sum { get; set; }

public string TitleCode01 { get; set; }
public string TitleCode02 { get; set; }
public string TitleCode03 { get; set; }
public string TitleCode04 { get; set; }
public string TitleCode05 { get; set; }

public string Title01 { get; set; }
public string Title02 { get; set; }
public string Title03 { get; set; }
public string Title04 { get; set; }
public string Title05 { get; set; }

public int Count01 { get; set; }
public int Count02 { get; set; }
public int Count03 { get; set; }
public int Count04 { get; set; }
public int Count05 { get; set; }
}
5個就這麼長了!
public List<string> TitleCodeList { get; set; }
public List<string>TitleList { get; set; }
public List<int> CountList { get; set; }
優悠 iT邦新手 3 級 ‧ 2018-10-04 10:37:35 檢舉
gn00044255 其實最後要在JQGRID上顯示資料,用您的方式,最後還要用迴圈變成一列,乾脆一次到位比較好,謝謝您的回答
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答