public static Dictionary <string, object> GetSearch(Dictionary <string, object> _paramSearch)
    {
        Dictionary <string, object> _loginResult  = SCHUtil.GetInfoLogin("", "");
        Dictionary <string, object> _searchResult = new Dictionary <string, object>();
        DataSet _ds = new DataSet();

        DataRow[] _dr          = null;
        string    _username    = _loginResult["Username"].ToString();
        string    _userlevel   = _loginResult["Userlevel"].ToString();
        string    _systemGroup = _loginResult["SystemGroup"].ToString();

        string[]      _scholarshipsTypeGroup = _paramSearch["ScholarshipsId"].ToString().Split(':');
        int           _recordCount           = 0;
        int           _recordCountPrimary    = 0;
        StringBuilder _list    = new StringBuilder();
        StringBuilder _navPage = new StringBuilder();

        _ds                 = SCHDB.GetListTranStudentManageScholarship(_username, _userlevel, _systemGroup, _paramSearch);
        _dr                 = _ds.Tables[0].Select("rowNum >= " + _paramSearch["StartRow"] + " AND rowNum <= " + _paramSearch["EndRow"]);
        _recordCount        = _ds.Tables[0].Rows.Count;
        _recordCountPrimary = _ds.Tables[0].Rows.Count;
        if (_paramSearch["ScholarshipsTypeGroup"].Equals(""))
        {
            _list = SCHManageScholarshipUI.ListUI.GetMain(_dr);
        }
        if (_paramSearch["ScholarshipsTypeGroup"].Equals(SCHUtil.SUBJECT_ICL))
        {
            _list = SCHManageScholarshipUI.ICLUI.ListUI.GetMain(_dr);
        }
        _navPage = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), SCHUtil.PAGE_MANAGESCHOLARSHIP_MAIN, (int)(_paramSearch["RowPerPage"]));

        _ds.Dispose();

        _searchResult.Add("RecordCount", _recordCount);
        _searchResult.Add("RecordCountPrimary", _recordCountPrimary);
        _searchResult.Add("Sum", 0);
        _searchResult.Add("List", _list);
        _searchResult.Add("NavPage", _navPage);

        return(_searchResult);
    }
        public static StringBuilder GetMain(string _id)
        {
            Dictionary <string, object> _loginResult = SCHUtil.GetInfoLogin("", "");
            StringBuilder _str = new StringBuilder();
            Dictionary <string, object> _paramSearch       = new Dictionary <string, object>();
            Dictionary <string, object> _valueDataRecorded = SCHUtil.SetValueDataRecorded(SCHUtil.PAGE_REGISTERSCHOLARSHIPSTUDENTCV_MAIN, _id, null);
            Dictionary <string, object> _dataRecorded      = (_valueDataRecorded != null ? (Dictionary <string, object>)_valueDataRecorded["DataRecorded" + SCHUtil.SUBJECT_REGISTERSCHOLARSHIPSTUDENTCV] : null);
            string _username         = _loginResult["Username"].ToString();
            string _userlevel        = _loginResult["Userlevel"].ToString();
            string _systemGroup      = _loginResult["SystemGroup"].ToString();
            string _studentCode      = _dataRecorded["StudentCode"].ToString();
            string _fullNameTH       = SCHUtil.GetFullName(_dataRecorded["TitleInitialsTH"].ToString(), _dataRecorded["TitleFullNameTH"].ToString(), _dataRecorded["FirstName"].ToString(), _dataRecorded["MiddleName"].ToString(), _dataRecorded["LastName"].ToString());
            string _fullNameEN       = SCHUtil.GetFullName(_dataRecorded["TitleInitialsEN"].ToString(), _dataRecorded["TitleFullNameEN"].ToString(), _dataRecorded["FirstNameEN"].ToString(), _dataRecorded["MiddleNameEN"].ToString(), _dataRecorded["LastNameEN"].ToString()).ToUpper();
            string _facultyNameTH    = _dataRecorded["FacultyNameTH"].ToString();
            string _facultyNameEN    = _dataRecorded["FacultyNameEN"].ToString();
            string _programNameTH    = _dataRecorded["ProgramNameTH"].ToString();
            string _programNameEN    = _dataRecorded["ProgramNameEN"].ToString();
            string _statusTypeNameTH = _dataRecorded["StatusTypeNameTH"].ToString();
            string _statusTypeNameEN = _dataRecorded["StatusTypeNameEN"].ToString();
            string _row = String.Empty;
            string _scholarshipsNameTH = String.Empty;
            string _scholarshipsNameEN = String.Empty;
            string _responsibleAgency  = String.Empty;
            string _registerDate       = String.Empty;
            string _scholarshipsYear   = String.Empty;
            string _semester           = String.Empty;

            _str.AppendLine(GetValue(_valueDataRecorded).ToString());
            _str.AppendLine("<div class='ui form'>");
            _str.AppendLine("   <div class='ui right aligned header'>");
            _str.AppendLine("       <i class='close icon link font-th regular black btnclose'></i>");
            _str.AppendLine("   </div>");
            _str.AppendLine("</div>");
            _str.AppendLine("<div class='view paddingTop5'>");
            _str.AppendLine("   <div class='iform'>");
            _str.AppendLine("       <div class='iform-row'>");
            _str.AppendLine("           <div class='col1 iform-col'>");
            _str.AppendLine("               <div class='avatar profilepicture'>");
            _str.AppendLine("                   <div class='watermark'></div>");
            _str.AppendLine("                   <img />");
            _str.AppendLine("               </div>");
            _str.AppendLine("           </div>");
            _str.AppendLine("           <div class='col2 iform-col'>");
            _str.AppendLine("               <div class='iform'>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>รหัสนักศึกษา</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Student ID</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendFormat("                         <span class='lang lang-th f10 font-th regular blue'>{0}</span>", _studentCode);
            _str.AppendFormat("                         <span class='lang lang-en f10 font-en regular blue'>{0}</span>", _studentCode);
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>ชื่อ - สกุล</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Full Name</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendFormat("                         <span class='lang lang-th f10 font-th regular blue'>{0}</span>", _fullNameTH);
            _str.AppendFormat("                         <span class='lang lang-en f10 font-en regular blue'>{0}</span>", _fullNameEN);
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>คณะ</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Faculty</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendFormat("                         <span class='lang lang-th f10 font-th regular blue'>{0}</span>", _facultyNameTH);
            _str.AppendFormat("                         <span class='lang lang-en f10 font-en regular blue'>{0}</span>", _facultyNameEN);
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>หลักสูตร</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Program</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendFormat("                         <span class='lang lang-th f10 font-th regular blue'>{0}</span>", _programNameTH);
            _str.AppendFormat("                         <span class='lang lang-en f10 font-en regular blue'>{0}</span>", _programNameEN);
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>ทุน</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Scholarship</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendLine("                           <div class='info-list'>");
            _str.AppendLine("                               <ul>");

            _paramSearch.Clear();
            _paramSearch.Add("Keyword", _studentCode);

            DataSet _ds1 = SCHDB.GetListTranStudentManageScholarship(_username, _userlevel, _systemGroup, _paramSearch);

            foreach (DataRow _dr1 in _ds1.Tables[0].Rows)
            {
                _row = _dr1["rowNum"].ToString();
                _scholarshipsNameTH = _dr1["scholarshipsNameTH"].ToString();
                _scholarshipsNameEN = (!String.IsNullOrEmpty(_dr1["scholarshipsNameEN"].ToString()) ? _dr1["scholarshipsNameEN"].ToString() : (!String.IsNullOrEmpty(_scholarshipsNameTH) ? _scholarshipsNameTH : ""));
                _responsibleAgency  = _dr1["responsibleAgency"].ToString();
                _registerDate       = (!String.IsNullOrEmpty(_dr1["registerDate"].ToString()) ? DateTime.Parse(_dr1["registerDate"].ToString()).ToString("dd/MM/yyyy") : "");
                _scholarshipsYear   = _dr1["scholarshipsYear"].ToString();
                _semester           = _dr1["semester"].ToString();

                _str.AppendLine("                               <li class='blue'>");
                _str.AppendFormat("                                 <span class='lang lang-th f10 font-th regular blue'>{0}</span><span class='lang lang-th f10 font-th regular blue opacity05'>{1}</span><span class='lang lang-th f10 font-th regular blue'> ( {2} - {3} / {4} )</span>", _scholarshipsNameTH, (!String.IsNullOrEmpty(_responsibleAgency) ? (" - " + _responsibleAgency) : ""), _registerDate, _scholarshipsYear, _semester);
                _str.AppendFormat("                                 <span class='lang lang-en f10 font-en regular blue'>{0}</span><span class='lang lang-en f10 font-en regular blue opacity05'>{1}</span><span class='lang lang-en f10 font-en regular blue'> ( {2} - {3} / {4} )</span>", _scholarshipsNameEN, (!String.IsNullOrEmpty(_responsibleAgency) ? (" - " + _responsibleAgency) : ""), _registerDate, _scholarshipsYear, _semester);
                _str.AppendLine("                               </li>");
            }

            _ds1.Dispose();

            _str.AppendLine("                               </ul>");
            _str.AppendLine("                           </div>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='col21 iform-col label-col left aligned'>");
            _str.AppendLine("                           <span class='lang lang-th f10 font-th regular black'>สถานภาพ</span>");
            _str.AppendLine("                           <span class='lang lang-en f10 font-en regular black'>Student Status</span>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                       <div class='col22 iform-col input-col left aligned'>");
            _str.AppendFormat("                         <span class='lang lang-th f10 font-th regular blue'>{0}</span>", _statusTypeNameTH);
            _str.AppendFormat("                         <span class='lang lang-en f10 font-en regular blue'>{0}</span>", _statusTypeNameEN);
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("               </div>");
            _str.AppendLine("               <div class='iform'>");
            _str.AppendLine("                   <div class='iform-row'>");
            _str.AppendLine("                       <div class='iform-col'>");
            _str.AppendLine("                           <div class='ui segment list-grade'>");
            _str.AppendLine("                               <div class='ui middle aligned divided list'>");
            _str.AppendLine("                                   <div class='item'>");
            _str.AppendLine("                                       <div class='content'>");
            _str.AppendLine("                                           <div class='col1 list-col left floated left aligned header'>");
            _str.AppendLine("                                               <span class='lang lang-th f9 font-th regular black'>ภาคการศึกษา</span>");
            _str.AppendLine("                                               <span class='lang lang-en f9 font-en regular black'>Semester</span>");
            _str.AppendLine("                                           </div>");
            _str.AppendLine("                                           <div class='col2 list-col left aligned header'>");
            _str.AppendLine("                                               <span class='lang lang-th f9 font-th regular black'>เกรดเฉลี่ย</span>");
            _str.AppendLine("                                               <span class='lang lang-en f9 font-en regular black'>GPA</span>");
            _str.AppendLine("                                           </div>");
            _str.AppendLine("                                       </div>");
            _str.AppendLine("                                   </div>");

            DataSet _ds2 = SCHDB.GetStudentGPA(_dataRecorded["StudentCode"].ToString());

            foreach (DataRow _dr2 in _ds2.Tables[0].Rows)
            {
                _str.AppendLine("                               <div class='item'>");
                _str.AppendLine("                                   <div class='col1 list-col left floated left aligned content'>");
                _str.AppendFormat("                                     <span class='lang lang-th f10 font-th regular black'>{0}</span>", _dr2["sem"].ToString());
                _str.AppendFormat("                                     <span class='lang lang-en f10 font-en regular black'>{0}</span>", _dr2["sem"].ToString());
                _str.AppendLine("                                   </div>");
                _str.AppendLine("                                   <div class='col2 list-col left aligned content'>");
                _str.AppendFormat("                                     <span class='lang lang-th f10 font-th regular black'>{0}</span>", _dr2["cGPA"].ToString());
                _str.AppendFormat("                                     <span class='lang lang-en f10 font-en regular black'>{0}</span>", _dr2["cGPA"].ToString());
                _str.AppendLine("                                   </div>");
                _str.AppendLine("                               </div>");
            }

            _ds2.Dispose();

            _str.AppendLine("                               </div>");
            _str.AppendLine("                           </div>");
            _str.AppendLine("                       </div>");
            _str.AppendLine("                   </div>");
            _str.AppendLine("               </div>");
            _str.AppendLine("           </div>");
            _str.AppendLine("       </div>");
            _str.AppendLine("   </div>");
            _str.AppendLine("</div>");

            return(_str);
        }