Exemplo n.º 1
0
        public ActionResult EditorFor(EditorValue model)
        {
            //Editor For
            EditorProperties editor = new EditorProperties();

            editor.EnableStrictMode = true;
            ViewData["editmodel"]   = editor;

            //Mask Edit
            MaskEditProperties maskmodel = new MaskEditProperties();

            maskmodel.WatermarkText = "watermark";
            maskmodel.MaskFormat    = "99-99-99999";
            ViewData["MaskModel"]   = maskmodel;

            return(View(model));
        }
        public async Task <IActionResult> GetMeetingDetails(string questionId, string meetingId)
        {
            try
            {
                var questions = meetingId;
                if (questions == null)
                {
                    return(NotFound());
                }

                var latestValue = new EditorValue();

                if (_meetingDetails == null)
                {
                    MeetingDetails meetingDetails = CreateNewMeeting(meetingId);

                    _meetingDetails.Add(meetingDetails);
                    latestValue.Value = null;
                }

                else
                {
                    var data = _meetingDetails.Find(e => e.MeetingId == meetingId);
                    if (data == null)
                    {
                        MeetingDetails meetingDetails = CreateNewMeeting(meetingId);

                        latestValue.Value = null;
                        _meetingDetails.Add(meetingDetails);
                    }

                    else
                    {
                        var questionData = data.Questions.FirstOrDefault(item => item.QuestionId == questionId);
                        latestValue.Value = questionData.Value;
                    }
                }

                return(Ok(latestValue));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }