Example #1
0
        /* problems */
        /// <summary>
        /// Get all problems' AC status.
        /// </summary>
        /// <returns></returns>
        public static List <ProblemSolved> GetsProblemSolved()
        {
            // list
            List <ProblemSolved> ret = new List <ProblemSolved>();

            string sql =
                "SELECT team_id, num, NULL FROM problem_saved " +
                "UNION " +
                "SELECT team_id, num, sender FROM sending " +
                "UNION " +
                "SELECT team_id, num, sender FROM sent";

            var ds = MySQLHelper.ExecuteDataSet(sql);

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                var ps = new ProblemSolved()
                {
                    team_id = row.ItemArray[0].ToString(),
                    num     = int.Parse(row.ItemArray[1].ToString())
                };
                if (!string.IsNullOrEmpty(row.ItemArray[2].ToString()))
                {
                    ps.sender = row.ItemArray[2].ToString();
                }
                ret.Add(ps);
            }

            // return the list
            return(ret);
        }
 public IActionResult Resolve([FromBody] ProblemSolved solution)
 {
     return(NoContent());
 }