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 static string ToDebugLog(this JsonAttributes attributes) { if (attributes.IsNull) { return("null"); } if (attributes.IsString) { return(attributes.String); } if (attributes.IsBoolean) { return(attributes.Boolean.ToString()); } if (attributes.IsNumber) { return(attributes.Number.ToString()); } if (attributes.IsArray) { return(attributes.JSONArray.ToString()); } if (attributes.IsDictionary) { return(attributes.JSONObject.ToString()); } throw new System.Exception("<unknown json type>"); }
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); }
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); }
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); }
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); }
public void CreateChannel(string friendlyName) { NSDictionary dict = new NSDictionary("key", "value"); var attributes = new JsonAttributes().WithDictionary(dict); var options = new NSDictionary( Constants.ChannelOptionFriendlyName, NSObject.FromObject(friendlyName), Constants.ChannelOptionAttributes, NSObject.FromObject(attributes)); this.chatClient.ChannelsList.CreateChannelWithOptions(options, (Result result, Channel channel) => { Logger.Info($"TwilioChatHelper", $"Created channel with attributes and sid {channel.Sid}"); }); }
// 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())); }
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); }
public override void OnSuccess(Channel result) { Logger.Info($"CreateChannel", $"Channel created"); using var attrs = new JsonAttributes("hello"); result.SetAttributes(attrs, new StatusListeners.SetAttributesStatusListener(result)); }