public async Task <List <HocPhanExtend> > getListUnRegistableAsync()
        {
            try
            {
                List <HocPhanExtend> listHocPhan = new List <HocPhanExtend>();
                BaseConnector        connector   = BaseConnector.getInstance();
                BaseResponse         res         = await connector.GetObject(DeployEnvironment.GetEnvironment().GetUnEnrolablePath());

                if (res.status)
                {
                    JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();
                    List <Object>  listO    = JsonGetter.getList(res.obj.ToString(), jsonAttr.RES_RESULT());
                    for (int i = 0; i < listO.Count; i++)
                    {
                        HocPhanExtend hocPhan = new HocPhanExtend()
                        {
                            hocPhan = HocPhan.Parse(JsonGetter.getObject(listO[i].ToString(), jsonAttr.RES_SUBJECT())),
                            lyDo    = JsonGetter.getString(listO[i].ToString(), jsonAttr.RES_REASON())
                        };
                        listHocPhan.Add(hocPhan);
                    }
                }
                return(listHocPhan);
            }
            catch (Exception ex)
            {
                LogHelper.Log("ERROR: " + ex);
                return(null);
            }
        }
Example #2
0
        public static DangKyHocPhan Parse(Object o)
        {
            DangKyHocPhan  ans      = new DangKyHocPhan();
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();

            ans.diem    = Diem.Parse(JsonGetter.getObject(o.ToString(), jsonAttr.DKHP_D()));
            ans.hocPhan = HocPhan.Parse(JsonGetter.getObject(o.ToString(), jsonAttr.DKHP_HP()));
            return(ans);
        }
Example #3
0
        public static BaseResponse Parse(String json)
        {
            BaseResponse   ans      = new BaseResponse();
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();

            ans.status = JsonGetter.getBool(json, jsonAttr.RES_STATUS());
            ans.obj    = JsonGetter.getObject(json, jsonAttr.RES_DATA());
            return(ans);
        }
Example #4
0
        public static ThoiGian Parse(Object o)
        {
            ThoiGian       ans      = new ThoiGian();
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();

            ans.thu         = JsonGetter.getInt(o.ToString(), jsonAttr.TG_THU());
            ans.tietBatDau  = JsonGetter.getInt(o.ToString(), jsonAttr.TG_TIETBD());
            ans.tietKetThuc = JsonGetter.getInt(o.ToString(), jsonAttr.TG_TIETKT());
            return(ans);
        }
Example #5
0
        public void GetJsonStr_Test()
        {
            _jsonGetter = new JsonGetter();

            var expect = "[\r\n  {\r\n    \"firstname\": \"Ivan\",\r\n    \"lastname\": \"Ivanov\"\r\n  }\r\n]";

            var actual = _jsonGetter.GetJsonStr(@"PCL.jsonSmall.json");

            Assert.AreEqual(expect, actual);
        }
Example #6
0
        public static Diem Parse(Object o)
        {
            Diem           ans      = new Diem(0, 0, 0);
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();

            ans.cuoiKy  = JsonGetter.getFloat(o.ToString(), jsonAttr.D_CK());
            ans.giuaKy  = JsonGetter.getFloat(o.ToString(), jsonAttr.D_GK());
            ans.tongKet = JsonGetter.getFloat(o.ToString(), jsonAttr.D_TK());
            return(ans);
        }
Example #7
0
        // Parse and copy from object
        public void GetDataFromObject(Object o)
        {
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();
            Object         data     = JsonGetter.getObject(o.ToString(), jsonAttr.SV());

            this.id            = JsonGetter.getInt(data.ToString(), jsonAttr.SV_ID());
            this.mssv          = JsonGetter.getString(data.ToString(), jsonAttr.SV_MSSV());
            this.name          = JsonGetter.getString(data.ToString(), jsonAttr.SV_TEN());
            this.chuongTrinh   = JsonGetter.getString(data.ToString(), jsonAttr.SV_CHUONGTRINH());
            this.faculty       = JsonGetter.getString(data.ToString(), jsonAttr.SV_KHOA());
            this.khoaTuyen     = JsonGetter.getString(data.ToString(), jsonAttr.SV_KHOATUYEN());
            this.maxTC         = JsonGetter.getInt(data.ToString(), jsonAttr.SV_MAXTC());
            this.dangKyHocPhan = DangKyHocPhan.ParseArray(JsonGetter.getList(o.ToString(), jsonAttr.SV_DKHP()));
        }
Example #8
0
        public static HocPhan Parse(Object jsonObject)
        {
            string         json     = jsonObject.ToString();
            HocPhan        ans      = new HocPhan();
            JsonAttributes jsonAttr = JsonAttributeGetter.GetJsonAttributes();

            ans.id         = JsonGetter.getInt(json, jsonAttr.HP_ID());
            ans.maHocPhan  = JsonGetter.getString(json, jsonAttr.HP_MA());
            ans.tenHocPhan = JsonGetter.getString(json, jsonAttr.HP_TEN());
            ans.nam        = JsonGetter.getInt(json, jsonAttr.HP_NAM());
            ans.maxSV      = JsonGetter.getInt(json, jsonAttr.HP_MAXSV());
            ans.daDK       = JsonGetter.getInt(json, jsonAttr.HP_DK());
            ans.soTinChi   = JsonGetter.getInt(json, jsonAttr.HP_SOTC());
            ans.hocKy      = JsonGetter.getInt(json, jsonAttr.HP_HOCKY());
            ans.lop        = JsonGetter.getString(json, jsonAttr.HP_LOP());
            ans.thoiGian   = ThoiGian.Parse(jsonObject);

            ans.namHoc = ans.nam.ToString() + " - " + (ans.nam + 1).ToString();

            return(ans);
        }