Exemplo n.º 1
0
    public static Dictionary <string, object> SetValueDataRecorded(string _page, string _id)
    {
        Dictionary <string, object> _valueDataRecordedResult = new Dictionary <string, object>();
        Dictionary <string, object> _dataRecorded            = new Dictionary <string, object>();
        DataSet _ds = new DataSet();

        if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
        {
            _ds = HCSDB.GetStudentRecords(_id);
        }

        if (_ds.Tables.Count > 0)
        {
            if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
            {
                _dataRecorded = HCSDownloadRegistrationFormUtil.StudentRecordsUtil.SetValueDataRecorded(_dataRecorded, _ds);
            }
        }

        _ds.Dispose();

        if (_page.Equals(PAGE_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS_MAIN))
        {
            _valueDataRecordedResult.Add(("DataRecorded" + SUBJECT_SECTION_DOWNLOADREGISTRATIONFORMSTUDENTRECORDS), _dataRecorded);
        }

        return(_valueDataRecordedResult);
    }
Exemplo n.º 2
0
    public static Dictionary <string, object> GetLogin(string _page, string _id)
    {
        Dictionary <string, object> _loginResult = GetInfoLogin();
        DataSet _ds          = new DataSet();
        int     _systemError = Util.DBUtil.ChkSystemPermissionStudent(_loginResult);
        int     _cookieError = 0;
        int     _userError   = 0;
        string  _personId    = _loginResult["PersonId"].ToString();
        string  _nationality = _loginResult["Nationality"].ToString();

        if (!String.IsNullOrEmpty(_personId))
        {
            _ds = HCSDB.GetStudentRecords(_personId);
        }

        _systemError = (_systemError.Equals(4) ? 0 : _systemError);
        _systemError = (_systemError.Equals(5) ? 0 : _systemError);
        _systemError = (_systemError.Equals(0) ? (_ds.Tables[0].Rows.Count > 0 ? 0 : 6) : _systemError);
        _systemError = (_systemError.Equals(0) ? (_nationality.Equals("TH") ? 0 : 6) : _systemError);

        switch (_systemError)
        {
        case 1:
            _cookieError = 1;
            break;

        case 2:
            _userError = 1;
            break;

        case 6:
            _userError = 2;
            break;

        case 3:
            _userError = 4;
            break;

            /*
             * case 4:
             *  _userError = 5;
             *  break;
             * case 5:
             *  _userError = 6;
             *  break;
             */
        }

        _loginResult["CookieError"] = _cookieError.ToString();
        _loginResult.Add("UserError", _userError.ToString());

        return(_loginResult);
    }