Пример #1
0
        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);
            }
        }
        public async Task <bool> SetListEnrol(List <int> listMaMon)
        {
            BaseConnector        connector = BaseConnector.getInstance();
            RequestEnrolOrCancel req       = new RequestEnrolOrCancel();

            req.subject_ids = listMaMon.ToArray();
            BaseResponse res = await connector.PostObject(DeployEnvironment.GetEnvironment().GetEnrolPath(), req);

            return(res.status);
        }
Пример #3
0
        public static async Task <bool> sendAuth(string un, string pw)
        {
            BaseConnector connector = BaseConnector.getInstance();
            BaseResponse  res       = await connector.PostObject(DeployEnvironment.GetEnvironment().GetLoginPath(), new AuthRequest()
            {
                mssv = un, password = pw
            });

            return(res.status);
        }
Пример #4
0
 public async Task <SinhVien> GetSinhVienDetailAsync()
 {
     try
     {
         BaseConnector connector = BaseConnector.getInstance();
         sv.GetDataFromObject((await connector.GetObject(DeployEnvironment.GetEnvironment().GetStudentInfoPath(sv.mssv))).obj);
         return(sv);
     }
     catch (Exception ex)
     {
         LogHelper.Log("ERROR: " + ex);
         return(null);
     }
 }
Пример #5
0
        public async Task <SinhVienInfo> getOveralInfo()
        {
            try
            {
                BaseConnector connector = BaseConnector.getInstance();
                SinhVienInfo  info      = new SinhVienInfo();
                info.nganh = sv.faculty;
                // Lấy năm hiện tại
                //BaseResponse res1 = await connector.GetObject("nam");
                //if(res1.status)
                //    info.nam = JsonGetter.getString(res1.obj.ToString(), "nam");
                //info.nam = "2019 - 2020";

                info.curCount = getCurCount(info.nam);
                return(info);
            }
            catch (Exception ex)
            {
                LogHelper.Log("ERROR: " + ex);
                return(null);
            }
        }