public void LoadFromRow(DataRow row) { try { ID = Convert.ToInt32(row["JudgeID"]); UserID = Convert.ToInt32(row["UserID"]); _Notes = row["Notes"].ToString(); if (row.Table.Columns.Contains("Status")) _Status = (JudgeStatus)Convert.ToInt32(row["Status"]); if (row.Table.Columns.Contains("JudgeName")) JudgeName = Convert.ToString(row["JudgeName"]); if (row.Table.Columns.Contains("Allocated")) _Allocated = Convert.ToInt32(row["Allocated"]); if (row.Table.Columns.Contains("RingID")) _ringID = Convert.ToInt32(row["RingID"]); if (row.Table.Columns.Contains("ShowDetailsID") && row["ShowDetailsID"] != DBNull.Value) { ShowDetailsID = Convert.ToInt32(row["ShowDetailsID"]); } if (row.Table.Columns.Contains("ShowDate") && row["ShowDate"] != DBNull.Value) { ShowDate = Convert.ToDateTime(row["ShowDate"]); } if (row.Table.Columns.Contains("RingOrder")) { RingOrder = Convert.ToInt32(row["RingOrder"]); } _user = new User(UserID); _ring = new Rings(_ringID); } catch (Exception e ) { AppException.LogEvent("Judge.LoadFromRow:" + e.Message); } }
public JsonResult GetJudge(int judgeId) { var js = new JudgeStatus {Judge = new Judge(judgeId)}; js.User = new User(js.Judge.UserID); return Json(new { Status = 0, js.Judge, js.User }); }