Пример #1
0
        private Video CreateVideo()
        {
            Video video = new Video();

            video.video_id    = textBoxId.Text;
            video.title       = textBoxTitle.Text;
            video.description = textBoxDescription.Text;
            video.submit_date = dateTimePickerSubmit.Value;
            RankPoint point = new RankPoint();

            checked
            {
                point.view   = (int)numericUpDownViewCount.Value;
                point.res    = (int)numericUpDownCommentCount.Value;
                point.mylist = (int)numericUpDownMylistCount.Value;
            }
            video.point  = point;
            video.length = GetLengthString(lengthInput.LengthValue);

            foreach (TagLockPair pair in tag_controls_)
            {
                TextBox  text_box  = pair.TagTextBox;
                CheckBox check_box = pair.LockCheckBox;

                if (!string.IsNullOrEmpty(text_box.Text))
                {
                    video.tag_set.Add(text_box.Text, check_box.Checked);
                }
            }

            return(video);
        }
Пример #2
0
        public ActionResult <IEnumerable <string> > PostEvaluateRank([FromBody] TestAnswerDTO answer)
        {
            RankPoint rp = SystemDAO.EvaluateRank(context, answer);

            if (rp == null)
            {
                return(new JsonResult(rm.Error("Evaluate Failed")));
            }
            return(new JsonResult(rm.Success("Evaluate successful", rp)));
        }