Esempio n. 1
0
            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();
                int           _recordCount        = 0;
                int           _recordCountPrimary = 0;
                object        _sum                = 0;
                StringBuilder _list               = new StringBuilder();

                _ds                 = SCHDB.GetListTranStudentFinanceScholarshipSavePeopleApproved(_username, _userlevel, _systemGroup, _paramSearch);
                _dr                 = _ds.Tables[0].Select();
                _recordCount        = _ds.Tables[0].Rows.Count;
                _recordCountPrimary = _ds.Tables[0].Rows.Count;
                _sum                = _ds.Tables[0].Compute("SUM(tuition)", "");
                _list               = SCHFinanceScholarshipUI.ICLUI.SavePeopleApprovedUI.ListUI.GetMain(_dr);

                _ds.Dispose();

                _searchResult.Add("RecordCount", _recordCount);
                _searchResult.Add("RecordCountPrimary", _recordCountPrimary);
                _searchResult.Add("Sum", (!String.IsNullOrEmpty(_sum.ToString()) ? _sum : 0));
                _searchResult.Add("List", _list);
                _searchResult.Add("NavPage", new StringBuilder());

                return(_searchResult);
            }
Esempio n. 2
0
            public static Dictionary <string, object> GetSearch(Dictionary <string, object> _paramSearch)
            {
                Dictionary <string, object> _searchResult = new Dictionary <string, object>();
                DataSet _ds = new DataSet();

                DataRow[]     _dr                 = null;
                int           _recordCount        = 0;
                int           _recordCountPrimary = 0;
                StringBuilder _list               = new StringBuilder();
                StringBuilder _navPage            = new StringBuilder();
                string        _page               = String.Empty;

                _ds                 = SCHDB.GetListApprovalReceiveFinance(_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(SCHUtil.SUBJECT_ICL))
                {
                    _list = SCHFinanceScholarshipUI.ICLUI.ApprovalReceiveFinanceUI.ListUI.GetMain(_dr);
                    _page = SCHUtil.PAGE_FINANCESCHOLARSHIPTYPEGROUPICLAPPROVALRECEIVEFINANCE_MAIN;
                }
                _navPage = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), _page, (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);
            }
Esempio n. 3
0
    public static StringBuilder DDLProgram(string _idSelect, string _degreeLevelId, string _facultyId)
    {
        Dictionary<string, object> _loginResult = SCHUtil.GetInfoLogin("", "");
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        StringBuilder _str = new StringBuilder();
        string _username = _loginResult["Username"].ToString();
        string _systemGroup = _loginResult["SystemGroup"].ToString();
        string _userprogram = _loginResult["Userprogram"].ToString();
        int _i = 0;

        _paramSearch.Clear();
        _paramSearch.Add("DegreeLevelId",   _degreeLevelId);
        _paramSearch.Add("FacultyId",       _facultyId);
        _paramSearch.Add("ProgramId",       _userprogram);

        DataSet _ds = SCHDB.GetListProgram(_username, _systemGroup, _paramSearch);

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = _dr["programId"].ToString();
            _optionTextTH[_i]   = ((_dr["programCode"].ToString() + " " + _dr["majorCode"].ToString() + " " + _dr["groupNum"].ToString()) + " : " + _dr["programNameTH"].ToString());
            _optionTextEN[_i]   = ((_dr["programCode"].ToString() + " " + _dr["majorCode"].ToString() + " " + _dr["groupNum"].ToString()) + " : " + _dr["programNameEN"].ToString());

            _i++;
        }
        
        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
    public static Dictionary <string, object> GetSearch(Dictionary <string, object> _paramSearch)
    {
        Dictionary <string, object> _searchResult = new Dictionary <string, object>();
        DataSet _ds = new DataSet();

        DataRow[]     _dr                 = null;
        int           _recordCount        = 0;
        int           _recordCountPrimary = 0;
        StringBuilder _list               = new StringBuilder();
        StringBuilder _navPage            = new StringBuilder();

        _ds                 = SCHDB.GetListScholarships(_paramSearch);
        _dr                 = _ds.Tables[0].Select();
        _recordCount        = _ds.Tables[0].Rows.Count;
        _recordCountPrimary = _ds.Tables[0].Rows.Count;
        _list               = SCHScholarshipUI.ListUI.GetMain(_dr);

        _ds.Dispose();

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

        return(_searchResult);
    }
Esempio n. 5
0
    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();
        int           _recordCount        = 0;
        int           _recordCountPrimary = 0;
        StringBuilder _list               = new StringBuilder();
        StringBuilder _navPage            = new StringBuilder();

        _ds                 = SCHDB.GetListStudent(_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;
        _list               = SCHRegisterScholarshipUI.ListUI.GetMain(_dr);
        _navPage            = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), SCHUtil.PAGE_REGISTERSCHOLARSHIP_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);
    }
Esempio n. 6
0
    public static StringBuilder DDLLotNoApprovalReceiveFinance(string _idSelect, string _scholarshipsTypeGroup, string _scholarshipsYear, string _semester)
    {
        StringBuilder _str = new StringBuilder();
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        int _i = 0;

        _paramSearch.Clear();
        _paramSearch.Add("ScholarshipsTypeGroup",   _scholarshipsTypeGroup);
        _paramSearch.Add("ScholarshipsYear",        _scholarshipsYear);
        _paramSearch.Add("Semester",                _semester);

        DataSet _ds = SCHDB.GetListApprovalReceiveFinance(_paramSearch);

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = _dr["lotNo"].ToString();
            _optionTextTH[_i]   = _dr["lotNo"].ToString();
            _optionTextEN[_i]   = _dr["lotNo"].ToString();

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 7
0
    public static StringBuilder DDLGroupReceiver(string _idSelect, string _classify)
    {    
        StringBuilder _str = new StringBuilder();
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        int _i = 0;

        _paramSearch.Clear();
        _paramSearch.Add("Classify", _classify);
        
        DataSet _ds = SCHDB.GetListGroupReceiver(_paramSearch);

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = _dr["id"].ToString();
            _optionTextTH[_i]   = _dr["groupReceiverNameTH"].ToString();
            _optionTextEN[_i]   = _dr["groupReceiverNameEN"].ToString();

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 8
0
    public static StringBuilder DDLScholarships(string _idSelect)
    {
        StringBuilder _str = new StringBuilder();
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        int _i = 0;

        _paramSearch.Clear();
        _paramSearch.Add("Status", "Y");

        DataSet _ds = SCHDB.GetListScholarships(_paramSearch);

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = (_dr["id"].ToString() + ":" + _dr["scholarshipsTypeGroup"].ToString());
            _optionTextTH[_i]   = _dr["scholarshipsNameTH"].ToString();
            _optionTextEN[_i]   = (!String.IsNullOrEmpty(_dr["scholarshipsNameEN"].ToString()) ? _dr["scholarshipsNameEN"].ToString() : _optionTextTH[_i]);

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 9
0
    public static StringBuilder DDLPayChequeYearSemester(string _idSelect, string _scholarshipsTypeGroup)
    {
        StringBuilder _str = new StringBuilder();
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        int _i = 0;

        _paramSearch.Clear();
        _paramSearch.Add("ScholarshipsTypeGroup", _scholarshipsTypeGroup);

        DataSet _ds = SCHDB.GetListPayChequeYearSemester(_paramSearch);

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = (_dr["acaYear"].ToString() + ":" + _dr["semester"].ToString());
            _optionTextTH[_i]   = (_dr["acaYear"].ToString() + " / " + _dr["semesterNameTH"].ToString());
            _optionTextEN[_i]   = (_dr["acaYear"].ToString() + " / " + _dr["semesterNameEN"].ToString());

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 10
0
            public static Dictionary <string, object> GetSearch(Dictionary <string, object> _paramSearch)
            {
                Dictionary <string, object> _searchResult = new Dictionary <string, object>();
                DataSet _ds = new DataSet();

                DataRow[]     _dr                 = null;
                int           _recordCount        = 0;
                int           _recordCountPrimary = 0;
                StringBuilder _list               = new StringBuilder();
                StringBuilder _navPage            = new StringBuilder();

                _ds                 = SCHDB.GetListCheque(_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;
                _list               = SCHFinanceScholarshipUI.ICLUI.PayChequeUI.ListUI.GetMain(_dr);
                _navPage            = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), SCHUtil.PAGE_FINANCESCHOLARSHIPTYPEGROUPICLPAYCHEQUE_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);
            }
Esempio n. 11
0
    public static StringBuilder DDLYearEntry(string _idSelect)
    {
        StringBuilder _str = new StringBuilder();
        int _i = 0;
        int _j = 0;
        int _yearStart = 0;
        DataSet _ds = SCHDB.GetListYearEntry();

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count + 20];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count + 20];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count + 20];

        _yearStart = (int.Parse(_ds.Tables[0].Rows[0]["yearEntry"].ToString()) + 20);

        for (_i = 0; _i < 20; _i++)
        {
            _optionValue[_i]   = (_yearStart - _i).ToString();
            _optionTextTH[_i]  = (_yearStart - _i).ToString();
            _optionTextEN[_i]  = (_yearStart - _i).ToString();
        }            

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = _dr["yearEntry"].ToString();
            _optionTextTH[_i]   = _dr["yearEntry"].ToString();
            _optionTextEN[_i]   = _dr["yearEntry"].ToString();

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 12
0
    public static StringBuilder DDLFaculty(string _idSelect)
    {
        Dictionary<string, object> _loginResult = SCHUtil.GetInfoLogin("", "");
        Dictionary<string, object> _paramSearch = new Dictionary<string, object>();
        StringBuilder _str = new StringBuilder();
        string _username = _loginResult["Username"].ToString();
        string _systemGroup = _loginResult["SystemGroup"].ToString();
        string _userfaculty = _loginResult["Userfaculty"].ToString();
        int _i = 0;

        _paramSearch.Add("FacultyId", _userfaculty);

        DataSet _ds     = SCHDB.GetListFaculty(_username, _systemGroup, _paramSearch);
        DataRow[] _dr   = _ds.Tables[0].Select("facultyId <> 'MU-01'");

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr1 in _dr)
        {            
            _optionValue[_i]    = _dr1["facultyId"].ToString();
            _optionTextTH[_i]   = (_dr1["facultyCode"].ToString() + " : " + _dr1["facultyNameTH"].ToString());
            _optionTextEN[_i]   = (_dr1["facultyCode"].ToString() + " : " + _dr1["facultyNameEN"].ToString());

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }    
        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();
            int           _recordCount        = 0;
            int           _recordCountPrimary = 0;
            object        _sum                = 0;
            StringBuilder _list               = new StringBuilder();
            StringBuilder _navPage            = new StringBuilder();

            _ds                 = SCHDB.GetListTranStudentFinanceScholarshipClassificationRecipient(_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;
            _sum                = _ds.Tables[0].Compute("SUM(tuition)", "");
            _list               = SCHReportScholarshipUI.ListOfPeopleApprovedFinanceFromICLUI.ListUI.GetMain(_dr);
            _navPage            = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), SCHUtil.PAGE_REPORTLISTOFPEOPLEAPPROVEDFINANCEFROMICL_MAIN, (int)(_paramSearch["RowPerPage"]));

            _ds.Dispose();

            _searchResult.Add("RecordCount", _recordCount);
            _searchResult.Add("RecordCountPrimary", _recordCountPrimary);
            _searchResult.Add("Sum", (!String.IsNullOrEmpty(_sum.ToString()) ? _sum : 0));
            _searchResult.Add("List", _list);
            _searchResult.Add("NavPage", _navPage);

            return(_searchResult);
        }
        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.StudentCancelUI.ListUI.GetMain(_dr);
            }
            if (_paramSearch["ScholarshipsTypeGroup"].Equals(SCHUtil.SUBJECT_ICL))
            {
                _list = SCHManageScholarshipUI.ICLUI.StudentCancelUI.ListUI.GetMain(_dr);
            }
            _navPage = SCHUtil.GetNavPage(_recordCount, (int)(_paramSearch["CurrentPage"]), SCHUtil.PAGE_MANAGESCHOLARSHIPSTUDENTCANCEL_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);
        }
Esempio n. 15
0
    public static StringBuilder DDLScholarshipsType(string _idSelect)
    {
        StringBuilder _str = new StringBuilder();
        int _i = 0;
        DataSet _ds = SCHDB.GetListScholarshipsType();

        string[] _optionValue   = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextTH  = new string[_ds.Tables[0].Rows.Count];
        string[] _optionTextEN  = new string[_ds.Tables[0].Rows.Count];

        foreach (DataRow _dr in _ds.Tables[0].Rows)
        {            
            _optionValue[_i]    = _dr["id"].ToString();
            _optionTextTH[_i]   = _dr["scholarshipsTypeNameTH"].ToString();
            _optionTextEN[_i]   = _dr["scholarshipsTypeNameEN"].ToString();

            _i++;
        }

        _ds.Dispose();

        return GetSelect(_idSelect, "เลือก", "Select", _optionValue, _optionTextTH, _optionTextEN);
    }
Esempio n. 16
0
    public static StringBuilder GetFrmNotice(string _page)
    {
        StringBuilder _str = new StringBuilder();
        List<string> _lsTH = new List<string>();
        List<string> _lsEN = new List<string>();

        _str.AppendLine("<div class='view' >");
        _str.AppendLine("   <div class='iform' >");
        _str.AppendLine("       <div class='iform-row'>");
        _str.AppendLine("           <div class='iform-col input-col left aligned'>");

        _lsTH = SCHDB.GetListText("TH", "MeaningOfScholarshipPayType.txt");
        _lsEN = SCHDB.GetListText("EN", "MeaningOfScholarshipPayType.txt");

        if (_page.Equals(SCHUtil.PAGE_MEANINGOFSCHOLARSHIPPAYTYPE_MAIN))
        {
            _str.AppendLine("           <div>");
            _str.AppendLine("               <ul class='notstyle'>");
            _str.AppendLine("                   <li>");
            _str.AppendFormat("                     <span class='lang lang-th f10 font-th regular black'>{0}</span>", _lsTH[0]);
            _str.AppendFormat("                     <span class='lang lang-en f10 font-en regular black'>{0}</span>", _lsEN[0]);
            _str.AppendLine("                   </li>");
            _str.AppendLine("                   <li>");
            _str.AppendFormat("                     <span class='lang lang-th f10 font-th regular black'>{0}</span>", _lsTH[1]);
            _str.AppendFormat("                     <span class='lang lang-en f10 font-en regular black'>{0}</span>", _lsEN[1]);
            _str.AppendLine("                   </li>");
            _str.AppendLine("               </ul>");
            _str.AppendLine("          </div>");
        }

        _str.AppendLine("           </div>");
        _str.AppendLine("       </div>");
        _str.AppendLine("   </div>");
        _str.AppendLine("</div>");
         
        return _str;
    }
        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);
        }
        public static StringBuilder GetMain(Dictionary <string, object> _infoLogin, DataRow[] _dr)
        {
            StringBuilder _str                = new StringBuilder();
            string        _username           = _infoLogin["Username"].ToString();
            string        _userlevel          = _infoLogin["Userlevel"].ToString();
            string        _systemGroup        = _infoLogin["SystemGroup"].ToString();
            string        _personId           = String.Empty;
            string        _studentCode        = String.Empty;
            string        _fullNameTH         = String.Empty;
            string        _fullNameEN         = String.Empty;
            string        _scholarshipsId     = String.Empty;
            string        _scholarshipsNameTH = String.Empty;
            string        _scholarshipsNameEN = String.Empty;
            string        _responsibleAgency  = String.Empty;
            string        _scholarshipsYear   = String.Empty;
            string        _semester           = String.Empty;
            string        _tuition            = String.Empty;
            string        _remark             = String.Empty;
            string        _fontColor          = String.Empty;

            string[] _msgTH       = new string[5];
            string[] _msgEN       = new string[5];
            int      _error       = 0;
            int      _row         = 0;
            int      _i           = 0;
            int      _j           = 0;
            int      _indexArray  = 0;
            int      _recordCount = (_dr.GetLength(0) - 1);

            _str.AppendFormat("<div class='paddingTop10'>");
            _str.AppendLine("   <div class='ui horizontal segments table-title'>");
            _str.AppendLine("       <div class='ui segment left floated grey inverted'>");
            _str.AppendFormat("         <div class='mini ui grey inverted button btnoption {0} button-overflow'>", (_recordCount.Equals(0) ? "disabled" : ""));
            _str.AppendLine("               <i class='save icon font-th regular white'></i>");
            _str.AppendLine("               <span class='lang lang-th f10 font-th regular white'>บันทึก</span>");
            _str.AppendFormat("             <div class='lang lang-th f11 font-th regular white'><a class='btnregister-option' href='javascript:void(0)' alt='{0}'>ทั้งหมด</a> | <a class='btnregister-option' href='javascript:void(0)' alt='{1}'>เฉพาะที่เลือก</a></div>", SCHUtil._selectOption[0].ToLower(), SCHUtil._selectOption[1].ToLower());
            _str.AppendLine("               <span class='lang lang-en f10 font-en regular white'>Save</span>");
            _str.AppendFormat("             <div class='lang lang-en f11 font-en regular white'><a class='btnregister-option' href='javascript:void(0)' alt='{0}'>All</a> | <a class='btnregister-option' href='javascript:void(0)' alt='{1}'>Selected</a></div>", SCHUtil._selectOption[0].ToLower(), SCHUtil._selectOption[1].ToLower());
            _str.AppendLine("           </div>");
            _str.AppendLine("       </div>");
            _str.AppendLine("       <div class='ui segment right floated right aligned grey inverted recordcount'>");
            _str.AppendFormat("         <span class='lang lang-th f10 font-th regular white'>พบ <span class='recordcountprimary-search'>{0}</span></span>", _recordCount);
            _str.AppendFormat("         <span class='lang lang-en f10 font-en regular white'>Found <span class='recordcountprimary-search'>{0}</span></span>", _recordCount);
            _str.AppendLine("       </div>");
            _str.AppendLine("   </div>");
            _str.AppendLine("   <table class='ui table unstackable'>");
            _str.AppendLine("       <thead>");
            _str.AppendLine("           <tr class='center aligned'>");
            _str.AppendLine("               <th class='col1'>");
            _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'>No.</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col2'>");
            _str.AppendLine("                   <input type ='checkbox' class='select-root checkbox ui' tabindex='0' />");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col3'>");
            _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'>Student ID</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col4'>");
            _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'>Full Name</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col5'>");
            _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'>Scholarship</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col6'>");
            _str.AppendLine("                   <span class='lang lang-th f9 font-th regular black'>สมัครรับทุน<br />เมื่อ</span>");
            _str.AppendLine("                   <span class='lang lang-en f9 font-en regular black'>Regerter<br />When</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("               <th class='col7'>");
            _str.AppendLine("                   <span class='lang lang-th f9 font-th regular black'>จำนวนเงิน<br />( บาท )</span>");
            _str.AppendLine("                   <span class='lang lang-en f9 font-en regular black'>Amount<br />( bath )</span>");
            _str.AppendLine("               </th>");
            _str.AppendLine("           </tr>");
            _str.AppendLine("       </thead>");
            _str.AppendLine("       <tbody>");

            if (_recordCount > 0)
            {
                foreach (DataRow _dr1 in _dr)
                {
                    if (_row > 0)
                    {
                        _personId           = String.Empty;
                        _studentCode        = _dr1[3].ToString();
                        _fullNameTH         = String.Empty;
                        _fullNameEN         = String.Empty;
                        _scholarshipsNameTH = _dr1[4].ToString();
                        _scholarshipsNameEN = _scholarshipsNameTH;
                        _responsibleAgency  = _dr1[6].ToString();
                        _scholarshipsYear   = _dr1[1].ToString();
                        _semester           = _dr1[2].ToString();
                        _tuition            = _dr1[5].ToString();
                        _remark             = _dr1[7].ToString();

                        _i = 0;

                        DataSet _ds2 = SCHDB.GetSCHStudent(_username, _userlevel, _systemGroup, _studentCode);
                        _error = (_ds2.Tables[0].Rows.Count > 0 ? 0 : 1);

                        if (_error.Equals(0))
                        {
                            DataRow _dr2 = _ds2.Tables[0].Rows[0];

                            _personId    = _dr2["id"].ToString();
                            _studentCode = _dr2["studentCode"].ToString();
                            _fullNameTH  = SCHUtil.GetFullName(_dr2["titlePrefixInitialsTH"].ToString(), _dr2["titlePrefixFullNameTH"].ToString(), _dr2["firstName"].ToString(), _dr2["middleName"].ToString(), _dr2["lastName"].ToString());
                            _fullNameEN  = SCHUtil.GetFullName(_dr2["titlePrefixInitialsEN"].ToString(), _dr2["titlePrefixFullNameEN"].ToString(), _dr2["firstNameEN"].ToString(), _dr2["middleNameEN"].ToString(), _dr2["lastNameEN"].ToString()).ToUpper();
                        }
                        else
                        {
                            _msgTH[_i] = "ไม่พบนักศึกษา";
                            _msgEN[_i] = "Student not found.";
                            _i++;
                        }

                        _ds2.Dispose();

                        DataSet _ds3 = SCHDB.GetScholarships("", _scholarshipsNameTH);
                        _error = (_ds3.Tables[0].Rows.Count > 0 ? 0 : 1);

                        if (_error.Equals(0))
                        {
                            DataRow _dr3 = _ds3.Tables[0].Rows[0];

                            _scholarshipsId     = _dr3["id"].ToString();
                            _scholarshipsNameTH = _dr3["scholarshipsNameTH"].ToString();
                            _scholarshipsNameEN = (!String.IsNullOrEmpty(_dr3["scholarshipsNameEN"].ToString()) ? _dr3["scholarshipsNameEN"].ToString() : (!String.IsNullOrEmpty(_scholarshipsNameTH) ? _scholarshipsNameTH : ""));

                            if (String.IsNullOrEmpty(_responsibleAgency))
                            {
                                _msgTH[_i] = "ไม่พบหน่วยงานที่รับผิดชอบ";
                                _msgEN[_i] = "Responsible Agency not found.";
                                _i++;
                            }
                        }
                        else
                        {
                            _msgTH[_i] = "ไม่พบทุน";
                            _msgEN[_i] = "Scholarship not found.";
                            _i++;
                        }

                        _ds3.Dispose();

                        _indexArray = SCHUtil.FindIndexArray2D(1, SCHUtil._semester, _semester);
                        _error      = (_indexArray > 0 ? 0 : 1);

                        if (_error.Equals(0))
                        {
                            _semester = SCHUtil._semester[_indexArray - 1, 0];
                        }
                        else
                        {
                            _msgTH[_i] = "ไม่พบภาคเรียน";
                            _msgEN[_i] = "Semester not found.";
                            _i++;
                        }

                        try
                        {
                            _error = (!_tuition.Equals("0") ? 0 : 1);

                            if (_error.Equals(0))
                            {
                                _tuition = double.Parse(_tuition).ToString("#,##0.00");
                            }
                            else
                            {
                                _msgTH[_i] = "จำนวนเงินต้องมากกว่า 0";
                                _msgEN[_i] = "Amount must be greater than 0.";
                                _i++;
                            }
                        }
                        catch
                        {
                            _msgTH[_i] = "รูปแบบจำนวนเงินไม่ถูกต้อง";
                            _msgEN[_i] = "Invalid number format.";
                            _i++;
                        }

                        _fontColor = (_i.Equals(0) ? "black" : "red");

                        _str.AppendFormat(" <tr class='center aligned' id='{0}-id-{1}'>", _idContent, (_personId + _scholarshipsYear + _semester + _scholarshipsId));
                        _str.AppendLine("       <td class='tooltip col1' data-content='' data-contentth='ที่' data-contenten='No.'>");
                        _str.AppendFormat("         <span class='lang lang-th f10 font-th regular {0}'>{1}</span>", _fontColor, _row.ToString("#,##0"));
                        _str.AppendFormat("         <span class='lang lang-en f10 font-en regular {0}'>{1}</span>", _fontColor, _row.ToString("#,##0"));
                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='col2 checkbox'>");

                        if (_i.Equals(0))
                        {
                            _str.AppendLine("       <input type='checkbox' name='select-child' class='select-child checkbox checker' data-options='{\"studentId\":\"" + _studentCode + "\",\"personId\":\"" + _personId + "\",\"scholarshipsYear\":\"" + _scholarshipsYear + "\",\"semester\":\"" + _semester + "\",\"scholarshipsId\":\"" + _scholarshipsId + "\",\"responsibleAgency\":\"" + _responsibleAgency + "\",\"tuition\":\"" + _tuition.Replace(",", "") + "\",\"remark\":\"" + _remark + "\"}' value='" + _personId + ":" + _scholarshipsYear + ":" + _semester + ":" + _scholarshipsId + ":" + _responsibleAgency + ":" + _tuition.Replace(",", "") + ":" + _remark + "' />");
                        }

                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col3' data-content='' data-contentth='รหัสนักศึกษา' data-contenten='Student ID'>");

                        if (_i.Equals(0))
                        {
                            _str.AppendLine("       <div class='ui green button btnstudentcv' data-options='{\"personId\":\"" + _personId + "\",\"scholarshipsYear\":\"" + _scholarshipsYear + "\",\"semester\":\"" + _semester + "\",\"scholarshipsId\":\"" + _scholarshipsId + "\"}'>");
                            _str.AppendFormat("         <span class='lang lang-th f10 font-th regular white'>{0}</span>", _studentCode);
                            _str.AppendFormat("         <span class='lang lang-en f10 font-en regular white'>{0}</span>", _studentCode);
                            _str.AppendLine("       </div>");
                        }
                        else
                        {
                            _str.AppendFormat(" <span class='lang lang-th f10 font-th regular red'>{0}</span>", _studentCode);
                            _str.AppendFormat(" <span class='lang lang-en f10 font-en regular red'>{0}</span>", _studentCode);
                        }

                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col4 left aligned' data-content='' data-contentth='ชื่อ - สกุล' data-contenten='Full Name'>");
                        _str.AppendFormat("         <span class='lang lang-th f10 font-th regular {0}'>{1}</span>", _fontColor, _fullNameTH);
                        _str.AppendFormat("         <span class='lang lang-en f10 font-en regular {0}'>{1}</span>", _fontColor, _fullNameEN);
                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col5 left aligned' data-content='' data-contentth='ทุน' data-contenten='Scholarship'>");
                        _str.AppendFormat("         <span class='lang lang-th f10 font-th regular {0} black'>{1}</span><span class='lang lang-th f10 font-th regular {2}'>{3}</span>", _fontColor, _scholarshipsNameTH, (_i.Equals(0) ? "muted" : "red"), (!String.IsNullOrEmpty(_responsibleAgency) ? (" - " + _responsibleAgency) : ""));
                        _str.AppendFormat("         <span class='lang lang-en f10 font-en regular {0} black'>{1}</span><span class='lang lang-en f10 font-en regular {2}'>{3}</span>", _fontColor, _scholarshipsNameEN, (_i.Equals(0) ? "muted" : "red"), (!String.IsNullOrEmpty(_responsibleAgency) ? (" - " + _responsibleAgency) : ""));
                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col6' data-content='' data-contentth='ปี / ภาคเรียนที่สมัครรับทุน' data-contenten='Scholarship on Year / Semester'>");
                        _str.AppendFormat("         <span class='lang lang-th f10 font-th regular {0}'>{1} / {2}</span>", _fontColor, _scholarshipsYear, _semester);
                        _str.AppendFormat("         <span class='lang lang-en f10 font-en regular {0}'>{1} / {2}</span>", _fontColor, _scholarshipsYear, _semester);
                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col7 right aligned' data-content='' data-contentth='จำนวนเงิน' data-contenten='Amount'>");                        _str.AppendFormat("         <span class='lang lang-th f10 font-th regular {0}'>{1}</span>", _fontColor, _tuition);
                        _str.AppendFormat("         <span class='lang lang-en f10 font-en regular {0}'>{1}</span>", _fontColor, _tuition);
                        _str.AppendLine("       </td>");
                        _str.AppendLine("       <td class='tooltip col8 hide'>");
                        _str.AppendFormat("         <span>{0}</span>", _remark.Replace("\n", "<br />"));
                        _str.AppendLine("       </td>");
                        _str.AppendLine("   </tr>");

                        if (_i > 0)
                        {
                            _str.AppendLine("<tr>");
                            _str.AppendLine("   <td class='info-list' colspan='7'>");
                            _str.AppendLine("       <ul>");

                            for (_j = 0; _j < _i; _j++)
                            {
                                _str.AppendFormat("     <li class='lang lang-th f10 font-th regular white'>{0}</li>", _msgTH[_j]);
                                _str.AppendFormat("     <li class='lang lang-en f10 font-en regular white'>{0}</li>", _msgEN[_j]);
                            }

                            _str.AppendLine("       </ul>");
                            _str.AppendLine("   </td>");
                            _str.AppendLine("</tr>");
                        }
                        else
                        {
                            _str.AppendFormat(" <tr class='center aligned hide ui {0}' id='{1}-studentcv-{2}{3}{4}{5}'>", SCHUtil.SUBJECT_STUDENTCV.ToLower(), _idContent, _personId, _scholarshipsYear, _semester, _scholarshipsId);
                            _str.AppendFormat("     <td class='preloading' colspan='8' id='{0}-id-{1}{2}{3}{4}'></td>", StudentCVUI._idContent, _personId, _scholarshipsYear, _semester, _scholarshipsId);
                            _str.AppendLine("   </tr>");
                        }
                    }

                    _row++;
                }
            }
            _str.AppendLine("       </tbody>");
            _str.AppendLine("   </table>");
            _str.AppendLine("   <div class='ui horizontal segments table-title'>");
            _str.AppendLine("       <div class='ui segment left floated grey inverted'>");
            _str.AppendFormat("         <div class='mini ui grey inverted button btnoption {0} button-overflow'>", (_recordCount.Equals(0) ? "disabled" : ""));
            _str.AppendLine("               <i class='save icon font-th regular white'></i>");
            _str.AppendLine("               <span class='lang lang-th f10 font-th regular white'>บันทึก</span>");
            _str.AppendFormat("             <div class='lang lang-th f11 font-th regular white'><a class='btnregister-option' href='javascript:void(0)' alt='{0}'>ทั้งหมด</a> | <a class='btnregister-option' href='javascript:void(0)' alt='{1}'>เฉพาะที่เลือก</a></div>", SCHUtil._selectOption[0].ToLower(), SCHUtil._selectOption[1].ToLower());
            _str.AppendLine("               <span class='lang lang-en f10 font-en regular white'>Save</span>");
            _str.AppendFormat("             <div class='lang lang-en f11 font-en regular white'><a class='btnregister-option' href='javascript:void(0)' alt='{0}'>All</a> | <a class='btnregister-option' href='javascript:void(0)' alt='{1}'>Selected</a></div>", SCHUtil._selectOption[0].ToLower(), SCHUtil._selectOption[1].ToLower());
            _str.AppendLine("           </div>");
            _str.AppendLine("       </div>");
            _str.AppendLine("       <div class='ui segment right floated right aligned grey inverted recordcount'>");
            _str.AppendFormat("         <span class='lang lang-th f10 font-th regular white'>พบ <span class='recordcountprimary-search'>{0}</span></span>", _recordCount);
            _str.AppendFormat("         <span class='lang lang-en f10 font-en regular white'>Found <span class='recordcountprimary-search'>{0}</span></span>", _recordCount);
            _str.AppendLine("       </div>");
            _str.AppendLine("   </div>");
            _str.AppendLine("  </div>");
            return(_str);
        }
Esempio n. 19
0
        //ฟังก์ชั่นสำหรับแสดงรายละเอียดของผู้ใช้งานที่เข้าระบบนักศึกษา แล้วส่งค่ากลับเป็น Dictionary<string, object>
        //โดยมีพารามิเตอร์ดังนี้
        //1. _usertype      เป็น string รับค่าประเภทของผุู้ใช้งาน
        //2. _systemGroup   เป็น string รับค่าชื่อระบบงาน
        public static Dictionary <string, object> GetFinServiceLogin(string _usertype, string _systemGroup)
        {
            Dictionary <string, object> _loginResult = new Dictionary <string, object>();
            string _personId       = String.Empty;
            string _studentId      = String.Empty;
            string _studentCode    = String.Empty;
            string _username       = String.Empty;
            string _fullnameEN     = String.Empty;
            string _fullnameTH     = String.Empty;
            string _entranceTypeId = String.Empty;
            string _facultyId      = String.Empty;
            string _programId      = String.Empty;
            string _yearEntry      = String.Empty;
            string _depId          = String.Empty;
            string _userlevel      = String.Empty;
            int    _cookieError    = 0;

            _cookieError = SCHUtil.ChkCookie(_usertype);

            if (_cookieError.Equals(0))
            {
                HttpCookie _cookieFinServiceObj = SCHUtil.GetCookie(_usertype);

                Finservice _finServiceAuthen = new Finservice();
                DataSet    _ds1 = _finServiceAuthen.info(_cookieFinServiceObj["result"]);

                if (_ds1.Tables[0].Rows.Count > 0)
                {
                    DataRow _dr1 = _ds1.Tables[0].Rows[0];

                    _personId  = _dr1["uid"].ToString();
                    _studentId = _dr1["studentid"].ToString();
                    _username  = _dr1["username"].ToString();
                    _depId     = _dr1["depcode"].ToString();

                    /*
                     * if (_usertype.Equals(USERTYPE_STUDENT))
                     * {
                     *  DataSet _ds2 = SCHUtil.DBUtil.GetUserStudent(_personId);
                     *
                     *  if (_ds2.Tables[0].Rows.Count > 0)
                     *  {
                     *      DataRow _dr2 = _ds2.Tables[0].Rows[0];
                     *
                     *      _studentCode = _dr2["studentCode"].ToString();
                     *      _fullnameTH = Util.GetFullName(_dr2["titlePrefixInitialsTH"].ToString(), _dr2["titlePrefixFullNameTH"].ToString(), _dr2["firstName"].ToString(), _dr2["middleName"].ToString(), _dr2["lastName"].ToString());
                     *      _fullnameEN = Util.GetFullName(Util.UppercaseFirst(_dr2["titlePrefixInitialsEN"].ToString()), Util.UppercaseFirst(_dr2["titlePrefixFullNameEN"].ToString()), Util.UppercaseFirst(_dr2["firstNameEN"].ToString()), Util.UppercaseFirst(_dr2["middleNameEN"].ToString()), Util.UppercaseFirst(_dr2["lastNameEN"].ToString()));
                     *      _entranceTypeId = _dr2["perEntranceTypeId"].ToString();
                     *      _facultyId = _dr2["facultyId"].ToString();
                     *      _programId = _dr2["programId"].ToString();
                     *      _yearEntry = _dr2["yearEntry"].ToString();
                     *  }
                     *
                     *  _ds2.Dispose();
                     * }
                     */
                    if (_usertype.Equals(USERTYPE_STAFF))
                    {
                        DataSet _ds2 = SCHDB.GetUserStaff(_username, _userlevel, _systemGroup);

                        if (_ds2.Tables[0].Rows.Count > 0)
                        {
                            DataRow _dr2 = _ds2.Tables[0].Rows[0];

                            _fullnameEN = _dr1["fullnameen"].ToString();
                            _fullnameTH = _dr1["fullnameth"].ToString();
                            _userlevel  = _dr2["level"].ToString();

                            foreach (DataRow _dr3 in _ds2.Tables[0].Rows)
                            {
                                _facultyId = (!String.IsNullOrEmpty(_dr3["facultyId"].ToString()) ? (_facultyId + _dr3["facultyId"].ToString() + ", ") : String.Empty);
                                _programId = (!String.IsNullOrEmpty(_dr3["programId"].ToString()) ? (_programId + _dr3["programId"].ToString() + ", ") : String.Empty);
                            }
                        }

                        _ds2.Dispose();
                    }
                }
                else
                {
                    _cookieError = 1;
                }

                _ds1.Dispose();
            }

            _loginResult.Add("CookieError", _cookieError.ToString());
            _loginResult.Add("PersonID", _personId);
            _loginResult.Add("StudentID", _studentId);
            _loginResult.Add("StudentCode", _studentCode);
            _loginResult.Add("Username", _username);
            _loginResult.Add("FullnameEN", _fullnameEN);
            _loginResult.Add("FullnameTH", _fullnameTH);
            _loginResult.Add("EntranceType", _entranceTypeId);
            _loginResult.Add("FacultyId", (!String.IsNullOrEmpty(_facultyId) ? _facultyId.Substring(0, (_facultyId.Length - 2)) : String.Empty));
            _loginResult.Add("ProgramId", (!String.IsNullOrEmpty(_programId) ? _programId.Substring(0, (_programId.Length - 2)) : String.Empty));
            _loginResult.Add("YearEntry", _yearEntry);
            _loginResult.Add("DepID", _depId);
            _loginResult.Add("Userlevel", _userlevel.ToUpper());
            _loginResult.Add("SystemGroup", _systemGroup);

            return(_loginResult);
        }