Пример #1
0
        //validate data
        private void ValidateAndSubmit()
        {
            string tbStudentName = this.tbSearch.Text.Trim();

            if (tbStudentName.Equals(string.Empty) || tbStudentName.Equals(ResourceCulture.GetString(SEARCH_MES)))
            {
                this.studentName = null;
            }
            else
            {
                tbStudentName    = EscapeSpecialCharacter.EscapeDatabaseCharacter(tbStudentName);
                this.studentName = tbStudentName;
            }

            paginationUtils.CurrentPage = 1;
            GetAllExamData();
        }
        //search student exam result
        private void SearchOperation()
        {
            string tbExamName = this.tbSearch.Text.Trim();

            if (this.dtpFrom.Text.Equals(string.Empty) && this.dtpTo.Text.Equals(string.Empty))
            {
                this.dtpFrom.Text = fromDate.ToString(DATE_FORMAT);
                this.dtpTo.Text   = DateTime.Now.ToString(DATE_FORMAT);
            }

            if (!this.dtpFrom.Text.Equals(string.Empty) && this.dtpTo.Text.Equals(string.Empty))
            {
                this.dtpTo.Text = this.dtpFrom.Text;
            }

            if (this.dtpFrom.Text.Equals(string.Empty) && !this.dtpTo.Text.Equals(string.Empty))
            {
                this.dtpFrom.Text = this.dtpTo.Text;
            }

            DateTime from = DateTime.Parse(this.dtpFrom.Text);
            DateTime to   = DateTime.Parse(this.dtpTo.Text);

            this.fromDate = from;
            this.toDate   = to;

            if (tbExamName.Equals(string.Empty) || tbExamName.Equals(ResourceCulture.GetString(SEARCH_MES)))
            {
                this.examName = null;
            }
            else
            {
                tbExamName    = EscapeSpecialCharacter.EscapeDatabaseCharacter(tbExamName);
                this.examName = tbExamName;
            }

            paginationUtils.CurrentPage = 1;
            GetAllExamData();
        }