Example #1
0
        private void UpdateWinList(string playerName, string team, int score)
        {
            WinEntry entry = WinList.SingleOrDefault(x => x.PlayerName == playerName && x.Team == team);

            if (entry == null)
            {
                entry = new WinEntry
                {
                    PlayerName = playerName,
                    Team       = team,
                    Score      = 0
                };
                _winList.Add(entry);
            }
            entry.Score += score;
        }
Example #2
0
        public ActionResult ExcelUpload(WinEntry model)
        {
            string message = "완료되었습니다.";
            List <Dictionary <string, object> > saveDataList = null;

            try {
                if (model.Data == null)
                {
                    throw new Exception("업로드할 파일을 선택해주세요.");
                }
                var excelData = model.Data;
                saveDataList = common.ExcelUpload(excelData, true);
                repository.CreateChristmas2015WinSettings(saveDataList);
            } catch (Exception e) {
                message = e.Message;
            }
            return(RedirectToAction("WinList", "Admin2015Christmas", new { returnMsg = message }));
        }