void Start() { uiBehaviour = transform.GetComponent <UIBehaviour> (); iRest = transform.GetComponent <REST> (); sess = transform.GetComponent <Session> (); classR = transform.GetComponent <SClassroom> (); }
public BotState GetState( ) { return(REST.Get <BotState>(API_ENDPOINT_URL + "/status", GetBaseHeaders( ))); }
//--------------------------------------------------------------------------- //Update Timer private void fn_tmUpdate(object sender, EventArgs e) { //m_UpdateTimer.Stop(); // switch (m_nStep) { case 0: tbLoadMsg.Text = " Now Loading System Data..."; if (!m_tDelayTimer.OnDelay(true, 300)) { return; } m_tDelayTimer.Clear(); m_nStep++; break; case 1: //Load Default file Info. tbLoadMsg.Text = " Loading the Information..."; FM.fn_LoadLastInfo(true); tbLoadMsg.Text = " Loading the Project Info..."; FM.fn_LoadProject(true, FM._sCurrJob); tbLoadMsg.Text = " Loading the System Option..."; FM.fn_LoadSysOptn(true); tbLoadMsg.Text = " Loading the Master Option..."; FM.fn_LoadMastOptn(true); tbLoadMsg.Text = " Loading the Recipe Data..."; FM.fn_LoadRecipeInfo(true, FM._sRecipeName); tbLoadMsg.Text = " Loading the Password..."; FM.fn_LoadPassWord(true); tbLoadMsg.Text = " Loading SPC Data..."; SPC.Load(true); m_tDelayTimer.Clear(); m_nStep++; break; case 2: if (!m_tDelayTimer.OnDelay(true, 100)) { return; } tbLoadMsg.Text = " Loading the IO List..."; IO.fn_LoadIO(true); tbLoadMsg.Text = " Loading the Lamp/Buzzer Data..."; LAMP.fn_Load(true); tbLoadMsg.Text = " Loading the Actuator Data..."; ACTR.fn_Load(true); //tbLoadMsg.Text = " ACS IO Connection...(SIM)" ; IO.fn_ACSConnect(UserConst.ACS_CON_SIM); tbLoadMsg.Text = " ACS IO Connection..."; IO.fn_ACSConnect(UserConst.ACS_CON_NOR); m_tDelayTimer.Clear(); m_nStep++; break; case 3: //if (!m_tDelayTimer.OnDelay(true, 100)) return; tbLoadMsg.Text = " Loading the Error List..."; EPU.fn_LoadErrorData(true); tbLoadMsg.Text = " Loading the Lamp/Buzzer Data..."; EPU.fn_LoadLampData(true); m_tDelayTimer.Clear(); m_nStep++; break; case 4: if (!m_tDelayTimer.OnDelay(true, 500)) { return; } //tbLoadMsg.Text = " Loading the Motor List...(SIM)"; MOTR.fn_InitMotor(UserConst.ACS_CON_SIM); tbLoadMsg.Text = " Loading the Motor List..."; MOTR.fn_InitMotor(UserConst.ACS_CON_NOR); tbLoadMsg.Text = " Loading the Vision Recipe..."; g_VisionManager.fn_LoadVision(FM._sRecipeName); //tbLoadMsg.Text = " Loading the Motor Data..." ; FM.fn_LoadMastOptn(true); //tbLoadMsg.Text = " Loading the Motor DSTB..." ; MOTR.fn_LoadMotrDisturb(true); m_tDelayTimer.Clear(); m_nStep++; break; case 5: //if (!m_tDelayTimer.OnDelay(true, 500)) return; tbLoadMsg.Text = " Loading the Data Manager Map Data..."; DM.fn_LoadMap(true); tbLoadMsg.Text = " Loading the Sequence Data..."; SEQ.fn_LoadWorkInfo(true); m_tDelayTimer.Clear(); m_nStep++; break; case 6: //Row, Col Setting... tbLoadMsg.Text = " Apply Project..."; FM.ApplyProject(FM._sCurrJob); m_nStep++; break; case 7: //LoadCell tbLoadMsg.Text = " Initial Load Cell ..."; LDCBTM.fn_SetParam(); LDCBTM.fn_Open(LDCBTM._sSerialNo); //LDCBTM.fn_Open (FM.m_stMasterOpt.sLoadCellSN); LDCBTM.fn_Close(); //JUNG/201014/Retry LDCBTM.fn_Open(LDCBTM._sSerialNo); //PMC, Slurry Init //tbLoadMsg.Text = " Initial PMC IP,Port ..." ; PMC.fn_SetIpAddress(FM.m_stSystemOpt.sPMCIp, FM.m_stSystemOpt.nPMCPort); tbLoadMsg.Text = " Initial REST API ..."; REST.fn_SetURL(FM.m_stSystemOpt.sRestApiUrl); tbLoadMsg.Text = " Initial RFID Reader ..."; m_nStep++; break; case 8: if (IO._bConnect) { //RFID tbLoadMsg.Text = " Initial RFID Reader ..."; RFID.fn_Connect(); } m_nStep++; break; case 9: //if (!m_tDelayTimer.OnDelay(true, 500)) return; //Main Load fn_MainFormLoad(); m_UpdateTimer.Stop(); m_nStep++; break; default: break; } //Step Inc. pbStep.Value = m_nStep * 10; //m_UpdateTimer.Start(); }
public HttpResponseMessage GetallMKV999ID([FromBody] filter filter) { return(REST.GetHttpResponseMessFromObject(RM0007Get(filter))); }
private void datagridDonations_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) { txtBloodId.Text = ""; txtPlazmaId.Text = ""; txtRedCellsId.Text = ""; txtPlateletsId.Text = ""; donacija = this.datagridDonations.SelectedItem as Donacija; ljekarskiPregledi = JsonConvert.DeserializeObject <List <LjekarskiPregled> >(REST.JoinDonacijaLjekarski(donacija.DonacijaId)); ljekarski = ljekarskiPregledi[0]; doze = JsonConvert.DeserializeObject <List <DozaKrvi> >(REST.JoinDonacijaDoza(donacija.DonacijaId)); txtBloodPressure.Text = ljekarski.KrvniPritisak; txtHemoglobineLevel.Text = ljekarski.NivoHemoglobina.ToString(); txtPulse.Text = ljekarski.Puls; txtTemperature.Text = ljekarski.Temperatura.ToString(); txtWeight.Text = ljekarski.TezinaKg.ToString(); txtNote.Document.Blocks.Clear(); txtNote.Document.Blocks.Add(new Paragraph(new Run(ljekarski.Napomena))); donor = JsonConvert.DeserializeObject <Donor>(REST.Get_ID("donor", donacija.DonorId.Value)); txtId.Text = donor.RegistarskiBroj; txtName.Text = donor.Ime; txtLastName.Text = donor.Prezime; txtBloodType.Text = donor.KrvnaGrupaDonor; if (doze.Count > 1) { txtPlazmaId.Text = doze[0].DozaKrviId.ToString(); txtRedCellsId.Text = doze[1].DozaKrviId.ToString(); txtPlateletsId.Text = doze[2].DozaKrviId.ToString(); } else { txtBloodId.Text = doze[0].DozaKrviId.ToString(); } }
/*Effettua la connessione per ricevere i dati dal server*/ public async void leggiDati() { IsVoidEvent = false; ObservableCollection <GroupDatiEvento> groupList = new ObservableCollection <GroupDatiEvento>(); REST <Object, DatiEvento> connessione = new REST <Object, DatiEvento>(); List <DatiEvento> List = new List <DatiEvento>(); var medico = LoginData.getUser(); foreach (var i in medico) { if (i.attivo) { user.username = i.username; user.token = i.token; user.organizzazione = i.organizzazione; user.eliminato = "false"; } } if (string.IsNullOrEmpty(user.username)) { user.username = medico[0].username; user.password = medico[0].password; user.token = medico[0].token; user.organizzazione = medico[0].organizzazione; user.eliminato = "false"; } if (CrossConnectivity.Current.IsConnected) { List = await connessione.PostJsonList(URL.Eventi, user); if (List == null) { NessunEvento = "Nessun evento disponibile \n Scorri in basso per aggiornare"; IsVoidEvent = true; } else { if (List.Count != 0) { foreach (var i in List) { CultureInfo culture = new CultureInfo(cultureName); formaDateTime = Convert.ToDateTime(i.data, culture); i.data = formaDateTime.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture); i.data_ordinamento = formaDateTime; i.dat_fine = i.data_fine.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture); string img = ""; try { if (!String.IsNullOrEmpty(i.immagine)) { if (i.immagine.Contains("jpeg;")) { img = i.immagine.Substring(23); } else { img = i.immagine.Substring(22); } immagine = Xamarin.Forms.ImageSource.FromStream( () => new MemoryStream(Convert.FromBase64String(img))); i.Immagine = immagine; } } catch (Exception e) { i.Immagine = ""; } if (i.confermato == true) { i.TestoButtonEliminato = "ELIMINA"; } if (i.tipo == "1") { listaEventi.Add(i); } else if (i.tipo == "2") { listaNote.Add(i); } } ListaEventi = ListaEventi.OrderByDescending(o => o.data_ordinamento).ToList(); GroupDatiEvento cGroupListEventi = new GroupDatiEvento(listaEventi); cGroupListEventi.Heading = "Eventi"; groupList.Add(cGroupListEventi); listaNote = listaNote.OrderByDescending(o => o.data_ordinamento).ToList(); GroupDatiEvento cGroupListNote = new GroupDatiEvento(listaNote); cGroupListNote.Heading = "Note"; groupList.Add(cGroupListNote); //ListaEventi = listaEventi; GroupDatiEvento = groupList; IsBusy = false; } else { DatiEvento evento = new DatiEvento(); evento.titolo = "Nessun evento disponibile \n Scorri in basso per aggiornare"; IsVoidEvent = true; NessunEvento = "Nessun evento disponibile \n Scorri in basso per aggiornare"; evento.VisibleError = "false"; listaEventi.Add(evento); listaNote.Add(evento); } //ListaEventi = listaEventi; GroupDatiEvento = groupList; IsBusy = false; } } else { DatiEvento evento = new DatiEvento(); evento.titolo = "Nessun evento \n Scorri in basso per aggiornare"; evento.VisibleError = "false"; IsVoidEvent = true; NessunEvento = "Nessun evento \n Scorri in basso per aggiornare"; listaEventi.Add(evento); listaNote.Add(evento); //ListaEventi = listaEventi; GroupDatiEvento = groupList; IsBusy = false; } }
public HttpResponseMessage ToHttpResponseMessage() { return(REST.GetHttpResponseMessFromObject(this)); }
private void OnREST(openHAB.REST aREST, openHAB.RESTResult aResult) { REST.GetSitemaps(OnSitemaps); }
public dccon(REST rest) => client = rest;
private void btnAdd_Click(object sender, RoutedEventArgs e) { //RadComboBoxItem donationType = cmbDonationType.SelectedItem as RadComboBoxItem; // string napomena = new TextRange(txtNote.Document.ContentStart, txtNote.Document.ContentEnd).Text; DateTime datumDoniranja = dateDateOfDonation.SelectedDate.Value; if (!txtBlooPressure.Text.IsNullOrEmpty() && !txtHemoglobineLevel.Text.IsNullOrEmpty() && !txtTemperature.Text.IsNullOrEmpty() && !txtPulse.Text.IsNullOrEmpty() && !txtID.Text.IsNullOrEmpty() && datagridDonors.Items.Count > 0) { if (donor.Pol == "m") { datumDoniranja = datumDoniranja.AddDays(90); } else { datumDoniranja = datumDoniranja.AddDays(120); } string napomena = new TextRange(txtNote.Document.ContentStart, txtNote.Document.ContentEnd).Text; donacija.DatumDoniranja = dateDateOfDonation.SelectedDate; donacija.TipDonacije = "Krv"; donacija.DonorId = donor.DonorId; // donacija.Donor = donor; //donacija ID var response = REST.Post("Donacija", donacija); string pom = response.Headers.Location.ToString(); Regex regex = new Regex(@"api/Donacija/(\w+)"); Match match = regex.Match(pom); pom = match.Groups[1].Value; int ID = Convert.ToInt32(pom); //ljekarski ljekarski.NivoHemoglobina = txtHemoglobineLevel.Text.ToDecimal(); ljekarski.KrvniPritisak = txtBlooPressure.Text; ljekarski.Temperatura = txtTemperature.Text.ToDecimal(); ljekarski.Puls = txtPulse.Text; ljekarski.Napomena = napomena; ljekarski.DonacijaId = ID; REST.Post("LjekarskiPregled", ljekarski); //donor donor.DatumPoslednjegDoniranja = dateDateOfDonation.SelectedDate; donor.DatumNajranijegSledecegDoniranja = datumDoniranja; donor.TipPoslednjegDoniranja = "Krv"; REST.Put_ID("donor", donor.DonorId, donor); //doze doza.DonacijaId = ID; // doza.Donacija = donacija; doza.IstekaoRok = 0; doza.KrvnaGrupaDoza = donor.KrvnaGrupaDonor; if (btnDivide.IsChecked.GetValueOrDefault()) { DateTime pomDate = dateDateOfDonation.SelectedDate.Value; pomDate = pomDate.AddDays((int)Expires.plasma); doza.DatumIstekaRoka = pomDate; doza.TipKrvnogDerivata = "Plazma"; doza.KolicinaKrvnogDerivataMl = (short)247; REST.Post("DozaKrvi", doza); pomDate = dateDateOfDonation.SelectedDate.Value; pomDate = pomDate.AddDays((int)Expires.redCells); doza.DatumIstekaRoka = pomDate; doza.TipKrvnogDerivata = "Eritrociti"; doza.KolicinaKrvnogDerivataMl = (short)198; REST.Post("DozaKrvi", doza); pomDate = dateDateOfDonation.SelectedDate.Value; pomDate = pomDate.AddDays((int)Expires.platelets); doza.DatumIstekaRoka = pomDate; doza.TipKrvnogDerivata = "Trombociti"; doza.KolicinaKrvnogDerivataMl = (short)5; REST.Post("DozaKrvi", doza); /* switch (doza.KrvnaGrupaDoza) * { * case "A+": * * break; * case "A-": * break; * case "B+": * break; * case "B-": * break; * case "O+": * break; * case "O-": * break; * case "AB+": * break; * case "AB-": * break; * * }*/ int i; for (i = 0; i < 8; i++) { if (magacin[i].KrvnaGrupaMagacin == doza.KrvnaGrupaDoza) { magacin[i].BrojDozaEritrocita++; magacin[i].BrojDozaPlazme++; magacin[i].BrojDozaTrombocita++; break; } } REST.Put_ID("magacin", magacin[i].MagacinId, magacin[i]); } else { DateTime pomDate = dateDateOfDonation.SelectedDate.Value; pomDate = pomDate.AddDays((int)Expires.blood); doza.DatumIstekaRoka = pomDate; doza.TipKrvnogDerivata = "Krv"; doza.KolicinaKrvnogDerivataMl = (short)450; REST.Post("DozaKrvi", doza); int i; for (i = 0; i < 8; i++) { if (magacin[i].KrvnaGrupaMagacin == doza.KrvnaGrupaDoza) { magacin[i].BrojDozaKrvi++; break; } } REST.Put_ID("magacin", magacin[i].MagacinId, magacin[i]); /* * else if (donationType.Content.ToString() == "Plazma") * { * DateTime pomDate = dateDateOfDonation.SelectedDate.Value; * pomDate.AddDays((int)Expires.plasma); * doza.DatumIstekaRoka = pomDate; * doza.TipKrvnogDerivata = "Plazma"; * doza.KolicinaKrvnogDerivataMl = (short)450; * REST.Post("DozaKrvi", doza); * } * else if (donationType.Content.ToString() == "Eritrociti") * { * DateTime pomDate = dateDateOfDonation.SelectedDate.Value; * pomDate.AddDays((int)Expires.redCells); * doza.DatumIstekaRoka = pomDate; * doza.TipKrvnogDerivata = "Eritrociti"; * doza.KolicinaKrvnogDerivataMl = (short)450; * REST.Post("DozaKrvi", doza); * } * else if (donationType.Content.ToString() == "Trombociti") * { * DateTime pomDate = dateDateOfDonation.SelectedDate.Value; * pomDate.AddDays((int)Expires.platelets); * doza.DatumIstekaRoka = pomDate; * doza.TipKrvnogDerivata = "Trombociti"; * doza.KolicinaKrvnogDerivataMl = (short)450; * REST.Post("DozaKrvi", doza); * } */ } NavigationService.Navigate(new DonationPage()); } }
public HttpResponseMessage Getall([FromBody] filter filter) { using (DB db = new DB()) { var data = db.A0028.AsEnumerable().Select(p => new { p.sophieu, p.thoigian, p.RM0008_ID, diadiem = db.RM0008.SingleOrDefault(op => op.RM0008_ID == p.RM0008_ID), p.A0028_ID, p.A0002_ID, p.hoVaTen, p.A0016_ID, p.A0022_ID, p.A0032_ID, p.maForm, p.trangThai, p.ngayTao, p.noiDungCongViec, p.daXoa, p.T001C, p.T002C, p.T003C, p.T004C, p.T005C, p.T006C, p.T007C, p.T008C, p.T009C, p.T010C, p.T011C, p.T012C, p.T013C, p.T014C, p.T015C, p.T016C, p.T017C, p.T018C, p.T019C, p.T020C, p.T021C, p.T022C, p.T023C, p.T024C, p.T025C, p.T026C, p.T027C, p.T028C, p.T029C, p.T030C, p.T097C, p.T098C, p.T099C, p.T100C, p.tinhtrang, ok = db.RM0015.Where(f => db.RM0010.Where(g => g.A0028_ID == p.A0028_ID).Select(g => g.RM0010_ID).Contains(f.RM0010_ID) && f.ketQua == true).Count(), wait = db.RM0010.Where(g => g.A0028_ID == p.A0028_ID).Count() - db.RM0015.Where(f => db.RM0010.Where(g => g.A0028_ID == p.A0028_ID).Select(g => g.RM0010_ID).Contains(f.RM0010_ID) && f.ketQua == false).Distinct().Count(), A0028D = db.A0028D.Where(f => f.A0028_ID == p.A0028_ID).FirstOrDefault(), RM0001 = db.RM0001.Where(f => f.RM0001_ID + "" == p.T005C).Select(f => new { f.ghiChu, f.maCongViec, f.moTa, f.RM0001_ID, f.RM0004_ID, f.tenCongViec, f.thuTu, f.tinhTrang }).FirstOrDefault(), RM0002 = db.RM0002.Where(f => f.RM0002_ID + "" == p.A0028D.C014C).Select(f => new { f.ghiChu, f.maLinhVuc, f.RM0002_ID, f.tenLinhVuc, f.thuTu, f.tinhTrang }).FirstOrDefault(), RM0003 = db.RM0003.Where(f => f.RM0003_ID + "" == p.A0028D.C009C).Select(f => new { f.ghiChu, f.maBacDaoTao, f.RM0003_ID, f.tenBacDaoTao, f.thuTu, f.tinhTrang }).FirstOrDefault(), RM0004 = db.RM0004.Where(f => f.RM0004_ID + "" == p.A0028D.C010C).Select(f => new { f.ghiChu, f.maChuyenNganh, f.RM0002_ID, f.RM0004_ID, f.tenChuyenNganh, f.thuTu, f.tinhTrang }).FirstOrDefault(), RM0010 = db.RM0010.Where(f => f.A0028_ID == p.A0028_ID).Select(f => new { f.RM0010_ID, f.maID, f.HODEM, f.TEN, f.A0028_ID, f.NGAYSINH, f.NOISINH, f.CMTND_SO, f.CMTND_NGAYCAP, f.CMTND_NOICAP, f.GIOITINH, f.HONNHAN, f.TELEPHONE, f.MOBILE, f.CHIEUCAO, f.CANNANG, f.EMAIL, f.THUONGTRU, f.TAMTRU, f.RM0001_ID, f.RM0001_ID2, f.NGAYCOTHELAM, f.THUNHAPMONGMUON, f.COTHELAMTHEM, f.COTHEDICONGTAC, f.COTHETHAYDOIDIADIEM, f.DATUNGTHITUYENMEIKO, f.NEUDATUNGTHITUYENMEIKO, f.ID_NGUONTHONGTIN, f.DUDINHTUONGLAI, f.SOTHICH, f.KHONGTHICH, f.CACPHAMCHATKYNANG, f.HOTENNGUOITHAN, f.DIACHINGUOITHAN, f.MOBILENGUOITHAN, f.ANHCHANDUNG, f.RM0011_ID1, f.RM0011_ID2, f.trangthai, count = db.RM0010.Where(y => y.CMTND_SO == f.CMTND_SO).Count(), f.DUDINHHOCTIEPCHUYENNGANH, f.DUDINHHOCTIEP, f.bophanid, f.ghichu, check = false, isactive = db.RM0015.Where(lk => lk.RM0010_ID == f.RM0010_ID).FirstOrDefault() != null ? true : false, RM0001 = db.RM0001.Where(o => o.RM0001_ID == f.RM0001_ID).Select(da => new { da.ghiChu, da.maCongViec, da.moTa, da.RM0001_ID, da.RM0004_ID, da.tenCongViec, da.thuTu, da.tinhTrang }).FirstOrDefault(), RM0001_2 = db.RM0001.Where(o => o.RM0001_ID == f.RM0001_ID2).Select(da => new { da.ghiChu, da.maCongViec, da.moTa, da.RM0001_ID, da.RM0004_ID, da.tenCongViec, da.thuTu, da.tinhTrang }).FirstOrDefault(), RM0080 = db.RM0080.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.HOTEN, da.LAMGIODAU, da.QUANHE, da.RM0010_ID, da.RM0080_ID }).ToList(), RM0081_A = db.RM0081_A.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.BATDAU, da.CHUYENNGANH, da.HEDAOTAO, da.RM0010_ID, da.KETTHUC, da.QUOCGIA, da.RM0081_ID, da.TENTRUONG, da.TYPE, da.XEPLOAI, }).OrderBy(fk => fk.KETTHUC).ToList(), RM0081_B = db.RM0081_B.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.CHUNGCHI, da.DOC, da.NGAYCAP, da.NGHE, da.NGOAINGU, da.NOI, da.RM0010_ID, da.RM0081_ID, da.VIET, da.XEPLOAI, }).ToList(), RM0081_C = db.RM0081_C.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.RM0010_ID, da.RM0081_ID, da.TENPHANMEM, da.TRINHDO, }).ToList(), RM0081_D = db.RM0081_D.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.NAM, da.RM0002_ID, da.RM0010_ID, da.RM0081_ID, da.TENGIAITHUONG, da.TOCHUCTRAO, }).ToList(), RM0081_E = db.RM0081_E.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.BATDAU, da.KETTHUC, da.LYDONGHIVIEC, da.MOTA, da.MUCLUONG, da.QUOCGIA, da.RM0010_ID, da.RM0081_ID, da.TENCONGTY, da.TINH, da.VITRI, }).ToList(), RM0081_F = db.RM0081_F.Where(o => o.RM0010_ID == f.RM0010_ID).Select(da => new { da.DONVI, da.HOTEN, da.MOBILE, da.RM0010_ID, da.RM0081_ID, da.VITRI, }), }), }); if (filter.A0028_ID != null) { return(REST.GetHttpResponseMessFromObject(data.SingleOrDefault(p => p.A0028_ID == filter.A0028_ID))); } if (filter.phongid != null) { data = data.Where(p => p.T098C == filter.phongid); } return(REST.GetHttpResponseMessFromObject(data.OrderBy(p => p.sophieu))); } }
public HttpResponseMessage DangOKTX([FromBody] search value) { var db = new DB(); var table = db.KTX0020.Where(p => p.trangthai == value.trangthai && p.trangthai2 == value.trangthai2).AsEnumerable().Select(check => new { check.KTX0020_ID, check.MKV9999_ID, check.ngaytaodon, check.capbac, check.trangthai, check.bengiao, check.bennhan, check.bietngoaingu, check.biettiengdantocitnguoi, check.bqlktx, check.choohiennay, check.chunhiemnoilamviec, check.cmtnd_ngaycap, check.cmtnd_noicap, check.cmtnd_so, check.dantoc, check.didong, check.ghichu, check.gioitinh, check.hotenkhac, check.hotenkhaisinh, check.khoaphong, check.KTX0001_ID, check.KTX0002_ID, check.KTX0003_ID, check.lamgiodautu14tuoi, check.lydo, check.lydodangkyoktx, check.lydonguyenvong, check.ngaycohieuluc, check.ngayduyetdon, check.ngayokitucxa, check.ngayquaylaikytucxa, check.ngaysinh, check.nghenghiepchucvunoilam, check.nguyenvongophongso, check.nharieng, check.noidung, check.noisinh, check.noithuongtru, check.okitucxa, check.quaylaikytucxa, check.quequan, check.sokhoatu, check.somayle, check.sotu, check.thoigiantralantruoc, check.tienantoidanhhinhphat, check.tongiao, check.trinhdchuyenmon, check.trinhdohocvan, check.truongphongGA, //timkiem = timkiem.tim(new searchkey() { key = check.cmtnd_so }), check.truongphongnoilamviec, KTX0001 = db.KTX0001.Where(p => p.KTX0001_ID == check.KTX0001_ID).Select(p => new { p.ghichu, p.idcha, p.khu, p.KTX0001_ID, p.makhoa, p.slot, p.ten, p.thutu, p.trangthai, p.type }).FirstOrDefault(), KTX0002 = db.KTX0002.Where(p => p.KTX0002_ID == check.KTX0002_ID).Select(p => new { p.ghichu, p.KTX0001_ID, p.KTX0002_ID, p.ten, p.thutu, p.trangthai, p.type }).FirstOrDefault(), KTX0003 = db.KTX0003.Where(p => p.KTX0003_ID == check.KTX0003_ID).Select(p => new { p.ghichu, p.KTX0003_ID, p.MaKhoa, p.trangthai, p.type }).FirstOrDefault(), KTX0021 = db.KTX0021.Where(p => p.KTX0020_ID == check.KTX0020_ID).Select(p => new { p.batdau, p.choo, p.ketthuc, p.KTX0020_ID, p.KTX0021_ID, p.nghenghiepnoilam }).ToList(), KTX0022 = db.KTX0022.Where(p => p.KTX0020_ID == check.KTX0020_ID).Select(p => new { p.ChoOHienNay, p.HoTen, p.KTX0020_ID, p.KTX0022_ID, p.NamSinh, p.NgheNghiep, p.QuanHe }).ToList(), MKV9999 = (db.MKV9999.Where(f => check.MKV9999_ID == f.MKV9999_ID)).ToList().Select(f => new { f.MKV9999_ID, f.manhansu, f.matkhau, f.id, f.hodem, f.type, f.ten, f.ngaysinh, f.gioitinh, f.noisinh, f.quequan, f.diachithuongtru, f.diachitamtru, f.cmtnd_so, f.cmtnd_ngayhethan, f.cmtnd_noicap, f.hochieu_so, f.hochieu_ngaycap, f.hochieu_ngayhethan, f.ngayvaocongty, f.phong_id, f.ban_id, f.congdoan_id, f.chucvu_id, f.nganhang_stk, f.nganhang_id, f.sosobaohiem, f.honnhantinhtrang, f.datnuoc_id, f.phuongxa, f.suckhoetinhtrang, f.dienthoai_nharieng, f.dienthoai_didong, f.email, f.tinhtrangnhansu, f.thutu, f.chucvu, f.capbac, bophan = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id), ban = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.ban_id), thetu_id = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id) != null ? db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id).bophan_ten : "", }).FirstOrDefault(), }); if (value.ID != null && value.ID.Trim() != "") { var ou = (db.MKV9999.SingleOrDefault(o => o.manhansu == (value.ID))); if (ou != null) { table = table.Where(p => p.MKV9999_ID == ou.MKV9999_ID); } else { table = table.Where(p => p.MKV9999_ID == 0); } } if (value.startdate != null) { table = table.Where(p => p.ngaycohieuluc.Value.Date >= value.startdate.Value.Date); } if (value.enddate != null) { table = table.Where(p => p.ngaycohieuluc.Value.Date <= value.enddate.Value.Date); } return(REST.GetHttpResponseMessFromObject(table.ToList())); }
public HttpResponseMessage Get(int MKV9999_ID) { using (DB db = new DB()) { var k = (from check in db.KTX0020 where check.MKV9999_ID == MKV9999_ID && (check.trangthai2 == false || check.trangthai2 == null) select new { check.KTX0020_ID, check.MKV9999_ID, check.ngaytaodon, check.trangthai, check.bengiao, check.bennhan, check.capbac, check.bietngoaingu, check.biettiengdantocitnguoi, check.bqlktx, check.choohiennay, check.chunhiemnoilamviec, check.cmtnd_ngaycap, check.cmtnd_noicap, check.cmtnd_so, check.dantoc, check.didong, check.ghichu, check.gioitinh, check.hotenkhac, check.hotenkhaisinh, check.khoaphong, check.KTX0001_ID, check.KTX0002_ID, check.KTX0003_ID, check.lamgiodautu14tuoi, check.lydo, check.lydodangkyoktx, check.lydonguyenvong, check.ngaycohieuluc, check.ngayduyetdon, check.ngayokitucxa, check.ngayquaylaikytucxa, check.ngaysinh, check.nghenghiepchucvunoilam, check.nguyenvongophongso, check.nharieng, check.noidung, check.noisinh, check.noithuongtru, check.okitucxa, check.quaylaikytucxa, check.quequan, check.sokhoatu, check.somayle, check.sotu, check.thoigiantralantruoc, check.tienantoidanhhinhphat, check.tongiao, check.trinhdchuyenmon, check.trinhdohocvan, check.truongphongGA, check.truongphongnoilamviec, KTX0001 = db.KTX0001.Where(p => p.KTX0001_ID == check.KTX0001_ID).FirstOrDefault(), KTX0002 = db.KTX0002.Where(p => p.KTX0002_ID == check.KTX0002_ID).FirstOrDefault(), KTX0021 = db.KTX0021.Where(p => p.KTX0020_ID == check.KTX0020_ID).ToList(), KTX0022 = db.KTX0022.Where(p => p.KTX0020_ID == check.KTX0020_ID).ToList(), MKV9999 = (from f in db.MKV9999 where check.MKV9999_ID == f.MKV9999_ID select new { f.MKV9999_ID, f.manhansu, f.matkhau, f.id, f.type, f.hodem, f.ten, f.ngaysinh, f.gioitinh, f.noisinh, f.quequan, f.diachithuongtru, f.diachitamtru, f.cmtnd_so, f.cmtnd_ngayhethan, f.cmtnd_noicap, f.hochieu_so, f.hochieu_ngaycap, f.hochieu_ngayhethan, f.ngayvaocongty, f.phong_id, f.ban_id, f.congdoan_id, f.chucvu_id, f.nganhang_stk, f.nganhang_id, f.sosobaohiem, f.honnhantinhtrang, f.datnuoc_id, f.phuongxa, f.suckhoetinhtrang, f.dienthoai_nharieng, f.dienthoai_didong, f.email, f.tinhtrangnhansu, f.thutu, f.chucvu, f.capbac, bophan = (from klj in db.MKV9998 where klj.phong_id == f.phong_id select klj).FirstOrDefault(), ban = (from klj in db.MKV9998 where klj.phong_id == f.ban_id select klj).FirstOrDefault(), thetu_id = (from t in db.MKV9998 where t.phong_id == f.phong_id select t.bophan_ten).FirstOrDefault(), }).FirstOrDefault(), }).FirstOrDefault(); return(REST.GetHttpResponseMessFromObject(k)); } }
public HttpResponseMessage Getall([FromBody] GetKTX0020 filter) { var db = new DB(); var table = db.KTX0020.AsEnumerable().Select(check => new { check.KTX0020_ID, check.MKV9999_ID, check.ngaytaodon, check.capbac, check.trangthai, check.bengiao, check.bennhan, check.bietngoaingu, check.biettiengdantocitnguoi, check.bqlktx, check.choohiennay, check.chunhiemnoilamviec, check.cmtnd_ngaycap, check.cmtnd_noicap, check.cmtnd_so, check.dantoc, check.didong, check.ghichu, check.gioitinh, check.hotenkhac, check.hotenkhaisinh, check.khoaphong, check.KTX0001_ID, check.KTX0002_ID, check.KTX0003_ID, check.lamgiodautu14tuoi, check.lydo, check.lydodangkyoktx, check.lydonguyenvong, check.ngaycohieuluc, check.ngayduyetdon, check.ngayokitucxa, check.ngayquaylaikytucxa, check.ngaysinh, check.nghenghiepchucvunoilam, check.nguyenvongophongso, check.nharieng, check.noidung, check.noisinh, check.noithuongtru, check.okitucxa, check.quaylaikytucxa, check.quequan, check.sokhoatu, check.somayle, check.sotu, check.thoigiantralantruoc, check.tienantoidanhhinhphat, check.tongiao, check.trinhdchuyenmon, check.trinhdohocvan, check.truongphongGA, //timkiem = timkiem.tim(new searchkey() { key = check.cmtnd_so }), check.truongphongnoilamviec, KTX0001 = db.Database.SqlQuery <KTX0001>("select * from ktx0001 where KTX0001_id=" + (check.KTX0001_ID != null ? check.KTX0001_ID : 0)).FirstOrDefault(), KTX0002 = db.Database.SqlQuery <KTX0002>("select * from ktx0002 where KTX0002_id=" + (check.KTX0002_ID != null?check.KTX0002_ID:0)).FirstOrDefault(), KTX0003 = db.Database.SqlQuery <KTX0003>("select * from ktx0003 where KTX0003_id=" + (check.KTX0003_ID != null?check.KTX0003_ID:0)).FirstOrDefault(), KTX0021 = db.Database.SqlQuery <KTX0021>("select * from ktx0021 where KTX0020_id=" + check.KTX0020_ID).ToList(), KTX0022 = db.Database.SqlQuery <KTX0022>("select * from ktx0022 where KTX0020_id=" + check.KTX0020_ID).ToList(), MKV9999 = (db.MKV9999.Where(f => check.MKV9999_ID == f.MKV9999_ID)).ToList().Select(f => new { f.MKV9999_ID, f.manhansu, f.matkhau, f.id, f.type, f.hodem, f.ten, f.ngaysinh, f.gioitinh, f.noisinh, f.quequan, f.diachithuongtru, f.diachitamtru, f.cmtnd_so, f.cmtnd_ngayhethan, f.cmtnd_noicap, f.hochieu_so, f.hochieu_ngaycap, f.hochieu_ngayhethan, f.ngayvaocongty, f.phong_id, f.ban_id, f.congdoan_id, f.chucvu_id, f.nganhang_stk, f.nganhang_id, f.sosobaohiem, f.honnhantinhtrang, f.datnuoc_id, f.phuongxa, f.suckhoetinhtrang, f.dienthoai_nharieng, f.dienthoai_didong, f.email, f.tinhtrangnhansu, f.thutu, f.chucvu, f.capbac, bophan = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id), ban = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.ban_id), thetu_id = db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id) != null ? db.MKV9998.FirstOrDefault(klj => klj.phong_id == f.phong_id).bophan_ten : "", }).FirstOrDefault(), }); if (filter.trangthai != null) { table = table.Where(p => p.trangthai == filter.trangthai); } if (filter.KTX0020_ID != null) { table = table.Where(p => p.KTX0020_ID == filter.KTX0020_ID); } if (filter.MKV9999_ID != null) { table = table.Where(p => p.MKV9999_ID == filter.MKV9999_ID); } if (filter.startdate != null) { table = table.Where(p => p.ngaytaodon.Value.Date >= filter.startdate.Value.Date); } if (filter.enddate != null) { table = table.Where(p => p.ngaytaodon.Value.Date <= filter.enddate.Value.Date); } return(REST.GetHttpResponseMessFromObject(table.ToList())); }
// GET api/values/5 public HttpResponseMessage Get(int id) { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; if (id == 1) { var date = DateTime.Parse("2005-01-01"); WebClient webC = new WebClient(); webC.Encoding = Encoding.UTF8; string f = ""; while (date < DateTime.Parse(DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day)) { try { string k = webC.DownloadString("http://www.xoso.net/getkqxs/mien-bac/" + date.Day + "-" + date.Month + "-" + date.Year + ".js"); if (k.IndexOf("<tbody>") == -1) { date = date.AddDays(1); continue; } string j = k.Substring(k.IndexOf("<tbody>"), k.LastIndexOf("</tbody>") - k.IndexOf("<tbody>") + 8); j = j.Replace("\t", "").Replace(" ", "").Replace("\\", ""); string giaidb = j.Substring(j.IndexOf("giaidb\">") + 8, 5); string giai1 = j.Substring(j.IndexOf("giai1\">") + 7, 5); string giai2 = j.Substring(j.IndexOf("giai2\">") + 7, 11); string giai3 = j.Substring(j.IndexOf("giai3\">") + 7, 35); string giai4 = j.Substring(j.IndexOf("giai4\">") + 7, 19); string giai5 = j.Substring(j.IndexOf("giai5\">") + 7, 29); string giai6 = j.Substring(j.IndexOf("giai6\">") + 7, 11); string giai7 = j.Substring(j.IndexOf("giai7\">") + 7, 11); f += giai1 + "\n" + giai2 + "\n" + giai3 + "\n" + giai4 + "\n" + giai5 + "\n" + giai6 + "\n" + giai7 + "\n"; int test = 0; if (!int.TryParse(giaidb, out test)) { date = date.AddDays(1); continue; } tbl_time temp = new tbl_time() { time = date, tbl_giaidb = new tbl_giaidb() { so1 = int.Parse(giaidb) }, tbl_giai1 = new tbl_giai1() { so1 = int.Parse(giai1) }, tbl_giai2 = new tbl_giai2() { so1 = int.Parse(giai2.Split('-')[0]), so2 = int.Parse(giai2.Split('-')[1]) }, tbl_giai3 = new tbl_giai3() { so1 = int.Parse(giai3.Split('-')[0]), so2 = int.Parse(giai3.Split('-')[1]), so3 = int.Parse(giai3.Split('-')[2]), so4 = int.Parse(giai3.Split('-')[3]), so5 = int.Parse(giai3.Split('-')[4]), so6 = int.Parse(giai3.Split('-')[5]) }, tbl_giai4 = new tbl_giai4() { so1 = int.Parse(giai4.Split('-')[0]), so2 = int.Parse(giai4.Split('-')[1]), so3 = int.Parse(giai4.Split('-')[2]), so4 = int.Parse(giai4.Split('-')[3]) }, tbl_giai5 = new tbl_giai5() { so1 = int.Parse(giai5.Split('-')[0]), so2 = int.Parse(giai5.Split('-')[1]), so3 = int.Parse(giai5.Split('-')[2]), so4 = int.Parse(giai5.Split('-')[3]), so5 = int.Parse(giai5.Split('-')[4]), so6 = int.Parse(giai5.Split('-')[5]) }, tbl_giai6 = new tbl_giai6() { so1 = int.Parse(giai6.Split('-')[0]), so2 = int.Parse(giai6.Split('-')[1]), so3 = int.Parse(giai6.Split('-')[2]) }, tbl_giai7 = new tbl_giai7() { so1 = int.Parse(giai7.Split('-')[0]), so2 = int.Parse(giai7.Split('-')[1]), so3 = int.Parse(giai7.Split('-')[2]), so4 = int.Parse(giai7.Split('-')[3]) }, }; add(temp); date = date.AddDays(1); } catch { Thread.Sleep(2000); } } return(REST.GetHttpResponseMessFromObject((f))); } return(REST.GetHttpResponseMessFromObject(null)); }
public Form1() { InitializeComponent(); istRest = new REST("http://ist.rit.edu/api"); Populate(); }
public HttpResponseMessage Getall(int id) { using (DB db = new DB()) { var data = (from temp in db.KTX0002 where temp.KTX0001_ID == id select new { temp.ghichu, temp.KTX0001_ID, temp.KTX0002_ID, temp.ten, temp.thutu, temp.trangthai, KTX0001 = db.KTX0001.Where(p => p.KTX0001_ID == temp.KTX0001_ID).Select(p => new { p.ghichu, p.idcha, p.khu, p.KTX0001_ID, p.makhoa, p.slot, p.ten, p.thutu, p.trangthai, p.type }).FirstOrDefault(), KTX0020 = (from k in db.KTX0020 where k.KTX0002_ID == temp.KTX0002_ID && k.trangthai2 != true select new { k.KTX0020_ID, k.MKV9999_ID, k.okitucxa, k.ngayokitucxa, k.quaylaikytucxa, k.ngayquaylaikytucxa, k.thoigiantralantruoc, k.lydodangkyoktx, k.nguyenvongophongso, k.lydonguyenvong, k.somayle, k.didong, k.nharieng, k.chunhiemnoilamviec, k.truongphongnoilamviec, k.bqlktx, k.truongphongGA, k.KTX0001_ID, k.KTX0002_ID, k.khoaphong, k.sotu, k.sokhoatu, k.ngaycohieuluc, k.bengiao, k.bennhan, k.hotenkhaisinh, k.gioitinh, k.hotenkhac, k.ngaysinh, k.noisinh, k.quequan, k.dantoc, k.tongiao, k.cmtnd_so, k.cmtnd_ngaycap, k.cmtnd_noicap, k.noithuongtru, k.choohiennay, k.trinhdohocvan, k.trinhdchuyenmon, k.biettiengdantocitnguoi, k.bietngoaingu, k.nghenghiepchucvunoilam, k.lamgiodautu14tuoi, k.ngaytaodon, k.ngayduyetdon, k.noidung, k.lydo, k.ghichu, k.trangthai, MKV9999 = (from f in db.MKV9999 where k.MKV9999_ID == f.MKV9999_ID select new { f.MKV9999_ID, f.manhansu, f.matkhau, f.id, f.hodem, f.ten, f.ngaysinh, f.gioitinh, f.noisinh, f.quequan, f.diachithuongtru, f.diachitamtru, f.cmtnd_so, f.cmtnd_ngayhethan, f.cmtnd_noicap, f.hochieu_so, f.hochieu_ngaycap, f.hochieu_ngayhethan, f.ngayvaocongty, f.phong_id, f.ban_id, f.congdoan_id, f.chucvu_id, f.nganhang_stk, f.nganhang_id, f.sosobaohiem, f.honnhantinhtrang, f.datnuoc_id, f.phuongxa, f.suckhoetinhtrang, f.dienthoai_nharieng, f.dienthoai_didong, f.email, f.tinhtrangnhansu, f.thutu, f.chucvu, f.capbac, //thetu_id = (from t in db.MKV9998 where t.phong_id == f.phong_id select t.bophan_ten).FirstOrDefault(), }).FirstOrDefault(), }).FirstOrDefault() }).OrderBy(p => p.ten); return(REST.GetHttpResponseMessFromObject(data.ToList())); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { if (MasterData.GetHomeData().Rows.Count > 0) { string szDescription = MasterData.GetHomeData().Rows[0]["Description"].ToString().Trim(); PData.InnerHtml = "<h3>" + szDescription + "<br/><br/></h3>"; } // PData.InnerText = szDescription; DataTable dt = DAL.MasterData.GetData(); //List<string> list = new List<string>(); //DataTable dt1 = dt.DefaultView.ToTable(false, new String[] { "Images/0","SNO" }); //foreach (DataRow dr in dt1.Rows) //{ // list.Add(dr[0].ToString()); //} int count = dt.Rows.Count; //ContentPlaceHolder myPlaceHolder = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"); //HtmlControl myControl = (HtmlControl)myPlaceHolder.FindControl("container"); Literal lit = new Literal(); container1.InnerHtml = ""; // lit.Text = @"<div class='container'><div class='row'> <div class='col-sm-4'> <div class='panel panel-primary'><div class='panel-heading'>BLACK FRIDAY DEAL</div> <div class='panel-body'><img src='https://placehold.it/150x80?text=IMAGE' class='img-responsive' style='width: 100%' alt='Image'></div><div class='panel-footer'>Buy 50 mobiles and get a gift card</div></div></div></div>"; container1.InnerHtml += "<div class='container-fluid'>"; //for (int j = 0; j < count; j++) //{ // if(j!=0) // j--; // container1.InnerHtml += @"<div class='row'>"; // for (int i = 0; i < 3; i++) // { // if (j < count) // { // container1.InnerHtml += @" <div class='col-lg-4 col-md-4 col-sm-4 col-xs-6'> <div class='panel panel-primary'><div class='panel-heading'>" + j + " BLACK FRIDAY DEAL</div> <div class='panel-body'><img src='https://placehold.it/150x80?text=IMAGE' class='img-responsive' style='width: 100%' alt='Image'></div><div class='panel-footer'>Buy 50 mobiles and get a gift card</div></div></div></div>"; try { foreach (DataRow dr in dt.Rows) { container1.InnerHtml += @"<div class='col-xs-12 col-sm-6 col-md-4' height='200'><div class='panel single-blog'><img src=" + dr["Images/0"].ToString().Trim() + " class='img-responsive' alt=''><div class='content'><ul class='list-unstyled list-inline'><li>By: Admin</li><li>Feb 01, 2017</li></ul><a href='PropertyDetail.aspx?ID=" + dr["HNO"].ToString().Trim() + "'><p style='font-size:16px;font-family: 'Times New Roman', Georgia, Serif;'>" + dr["Description"].ToString().Substring(0, 50) + "</p><a href='#' class='read-more' style='font-size:10px;font-family: 'Times New Roman', Georgia, Serif;' >Read more</a></div></div></div>"; // j++; //Console.WriteLine(j); //if (j == 50) // break; } } catch (Exception) { throw; } REST ObjRest = new REST(); // data has been removed from this URL ObjRest.endpoint = "https://app.flatio.com/cdn/export/housingAnywhere.json"; string strResponse = string.Empty; strResponse = ObjRest.makerequest(); // txtResponse.Text = strResponse; // } // } } } catch (Exception) { } }
private async Task check() { var utente = LoginData.getUser(); Utente user = new Utente(); foreach (var i in utente) { if (i.attivo) { user.id = i.id; user.attivo = i.attivo; user.username = i.username; user.password = i.password; user.token = i.token; user.organizzazione = i.organizzazione; user.eliminato = "false"; user.splash_logo = i.splash_logo; user.circle_logo = i.circle_logo; } } if (string.IsNullOrEmpty(user.username)) { user.id = utente[0].id; user.attivo = true; user.username = utente[0].username; user.password = utente[0].password; user.token = utente[0].token; user.organizzazione = utente[0].organizzazione; user.splash_logo = utente[0].splash_logo; user.circle_logo = utente[0].circle_logo; user.eliminato = "false"; } REST <Utente, Final> rest = new REST <Utente, Final>(); if (CrossConnectivity.Current.IsConnected) { var response = await rest.PostJson(URL.Login, user); if (response != null) { if (response.status) { if (response.final[0].attivo == false) { await App.Current.MainPage.DisplayAlert("Login", "Utenza non attiva", "OK"); LoginData.dropUser(new TbLogin(user.username, user.password, user.token, user.organizzazione, user.circle_logo, user.splash_logo, true)); UtenzaData.DropUser(new TbUtente(response.final[0])); App.Current.MainPage = new Login(); } else { //await App.Current.MainPage.DisplayAlert("Login", "Login Effettuata con successo", "OK"); response.final[0].organizzazione = user.organizzazione; foreach (var i in utente) { i.attivo = false; LoginData.updateUser(i); } TbLogin us = new TbLogin(user.username, user.password, user.token, user.organizzazione, user.circle_logo, user.splash_logo, user.attivo); us.id = user.id; us.attivo = true; LoginData.updateUser(us); UtenzaData.UpdateUser(new TbUtente(response.final[0])); } } else { LoginData.dropUser(new TbLogin(user.username, user.password, user.token, user.organizzazione, user.circle_logo, user.splash_logo, true)); UtenzaData.DropUser(new TbUtente(response.final[0])); App.Current.MainPage = new NavigationPage(new Login()); } } else { await DisplayAlert("Attenzione", "Il servizio è momentaneamente non disponibile, riprova più tardi", "OK"); await check(); } } }
//--------------------------------------------------------------------------- public bool fn_Upate() { // if (SEQ._bRun) { return(true); } //Decide Step if (m_nSeqStep == 0) { //Step Condition bool isConConnect = m_bReqConnect; bool isConRead = m_bReqRead; bool isConWrite = m_bReqWrite; //Clear Var. m_bDrngConnect = false; m_bDrngRead = false; m_bDrngWrite = false; //Check Sequence Stop if (SEQ._bRun) { m_bReqConnect = false; m_bReqRead = false; m_bReqWrite = false; m_bReqConnect = false; m_bReqRead = false; m_bReqWrite = false; return(false); } // if (isConConnect) { m_bDrngConnect = true; m_nSeqStep = 100; goto __GOTO_CYCLE__; } if (isConRead) { m_bDrngRead = true; m_nSeqStep = 200; goto __GOTO_CYCLE__; } if (isConWrite) { m_bDrngWrite = true; m_nSeqStep = 300; goto __GOTO_CYCLE__; } } //Cycle Start __GOTO_CYCLE__: //Cycle switch (m_nSeqStep) { default: m_nSeqStep = 0; break; //Connection case 100: m_bReqConnect = false; //Connection fn_Connect(); m_bDrngConnect = false; m_nSeqStep = 0; return(true); //RFID Read case 200: m_bReqRead = false; m_bUpdateData = false; m_bDataError = false; //Read if (fn_Read()) { m_bUpdateData = true; if (FM.m_stMasterOpt.nUseRESTApi == 1) { m_nSeqStep++; return(false); } } else { m_bDataError = true; } m_bDrngRead = false; m_nSeqStep = 0; return(true); //REST API case 201: if (!REST._bConnect) { REST.fn_Connect(); } if (REST._bConnect) { //REST.fn_GetRFIDInfo(_sReadRFNo); REST.fn_ReqRFInfo(_sReadRFNo); } m_bDrngRead = false; m_nSeqStep = 0; return(true); //Write case 300: m_bReqWrite = false; // m_bDrngWrite = false; m_nSeqStep = 0; return(true); } return(true); }
public ActionResult RegisterAccount(string Name, string Email, string Password) { JsonResult Retdata = new JsonResult(); if (Email != "" && Password != "") { try { UserModel UserData = new UserModel { Email = Email, Name = Name, Password = Password, Role = "unapproved", Username = Email }; RESTResult Result = new REST( Global.WebAPIBaseURL, "/api/Training/RecDB/V1/App/User/RegisterUser", REST.Method.POST, ConfigurationManager.AppSettings["OAuthBookDB"], UserData ).Result; if (Result.Success) { UserModel User = Result.Deserialize <UserModel>(); if (User != null) { Retdata = Json(new { Status = "Success", Message = "Regis Success", URL = Global.BaseURL }); } else { Retdata = Json(new { Status = "Failed", Message = "User not found" }); } } else { Retdata = Json(new { Status = "Failed", Message = Result.Message }); } } catch (Exception ex) { Retdata = Json(new { Status = "Failed", Message = ex.Message }); } } else { Retdata = Json(new { Status = "Failed", Message = "Username or Password cannot be empty" }); } Retdata.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(Retdata); }
public HttpResponseMessage getalls([FromBody] filter filter) { using (QLDX_DB db = new QLDX_DB()) { var data = db.DX0010.AsEnumerable().Select(p => new { p.DX0010_ID, p.ghiChu, p.maTuyenXe, p.tenTuyenXe, p.thuTu, p.type, p.trangThai, DX0010D = p.DX0010D.Select(o => new { o.DX0010_ID, o.DX0011_ID, o.thuTu, DX0011 = new { o.DX0011.DX0011_ID, o.DX0011.DX0013_ID, o.DX0011.ghiChu, o.DX0011.lat, o.DX0011.lng, o.DX0011.gioDon, o.DX0011.maDiemDon, o.DX0011.taxi, o.DX0011.tenDiemDon, o.DX0011.thuTu, o.DX0011.trangThai, DX0020 = (o.DX0011.DX0020.Count == 0 ? null : o.DX0011.DX0020.Select(h => new { h.ban_id, h.capbac, h.chucvu, h.cmtnd_so, h.diachitamtru, h.diachithuongtru, h.dienthoai_didong, h.DX0011_ID, h.DX0020_ID, h.email, h.gioitinh, h.hodem, h.manhansu, h.ngaysinh, h.phong_id, h.ten, h.thetu_id, h.trangThai })), DX0014 = o.DX0011.DX0014 == null?null:new { o.DX0011.DX0014.tenDiaDanh }, } }).OrderBy(f => f.thuTu), DX0012 = p.DX0012 == null ? null : p.DX0012.Select(k => new { k.DX0012_ID, k.ghiChu, k.bienSoXe, k.DX0010_ID, k.mobile, k.soLuongGhe, k.tenLaiXe, k.trangThai, }) }); if (filter.type != null) { data = data.Where(p => p.type == filter.type); } return(REST.GetHttpResponseMessFromObject(data)); } }
public void Dispose() { REST.Dispose(); }
public ActionResult ChangeForgottenPassword(string Token, string Email, string Password) { JsonResult Retdata = new JsonResult(); UserModel UserData = new UserModel { Email = Email, Name = "", Password = Password, Role = "", Username = Email }; try { RESTResult GetUserToken = new REST( Global.WebAPIBaseURL, "/api/Training/RecDB/V1/App/User/GetUserToken", REST.Method.POST, ConfigurationManager.AppSettings["OAuthBookDB"], UserData ).Result; String UserToken = GetUserToken.Deserialize <String>(); if (UserToken.Equals(Token)) { try { RESTResult Result = new REST( Global.WebAPIBaseURL, "/api/Training/RecDB/V1/App/User/ChangePassword", REST.Method.POST, ConfigurationManager.AppSettings["OAuthBookDB"], UserData ).Result; if (Result.Success) { Retdata = Json(new { Status = "Success", Message = "Change password success", URL = Global.BaseURL + "/Login/Index" }); } else { Retdata = Json(new { Status = "Failed", Message = "Change password failed", URL = Global.BaseURL + "/Login/Index" }); } try { RESTResult DeleteUserToken = new REST( Global.WebAPIBaseURL, "/api/Training/RecDB/V1/App/User/DeleteUserToken", REST.Method.POST, ConfigurationManager.AppSettings["OAuthBookDB"], UserData ).Result; } catch (Exception ex) { } } catch (Exception ex) { } } else { Retdata = Json(new { Status = "Failed", Message = "Invalid token", URL = Global.BaseURL + "/Login/Index" }); } } catch (Exception ex) { throw ex; } return(Retdata); }
internal RestProxy(Type restClass, Dictionary <string, Object> injectables) { instance = Activator.CreateInstance(restClass); classType = restClass; Attribute t = restClass.GetCustomAttribute(typeof(REST)); Logger.Log("RestProxy", $"Creating proxy for {restClass.Name}"); proxyMethods = new Dictionary <string, ProxyMethod>(); REST trest = (REST)t; // Search Injectables to inject FieldInfo[] fields = restClass.GetFields(BindingFlags.NonPublic | BindingFlags.Instance); foreach (FieldInfo field in fields) { if (field.GetCustomAttribute(typeof(Inject)) != null) { Type ft = field.FieldType; Object injectableInstance; if (injectables.ContainsKey(ft.FullName)) { injectableInstance = injectables[ft.FullName]; } else { Logger.Log("RestProxy", $"Creating injectable instance for class {ft.FullName}"); injectableInstance = Activator.CreateInstance(ft); injectables.Add(ft.FullName, injectableInstance); } field.SetValue(instance, injectableInstance); } } // Search Methods to Map MethodInfo[] methods = restClass.GetMethods(); foreach (var methodInfo in methods) { proxyMethods.Add(methodInfo.Name, new ProxyMethod(methodInfo)); foreach (var paramInfo in methodInfo.GetParameters()) { // Default to body param ProxyParameterRestType restType = ProxyParameterRestType.BODY; string lookName = paramInfo.Name; Attribute p; if ((p = paramInfo.GetCustomAttribute(typeof(QueryParam))) != null) { restType = ProxyParameterRestType.QUERY; lookName = ((QueryParam)p).ParamName ?? paramInfo.Name; } Func <string, object> parser; Type baseType; if ((baseType = GetBaseType(paramInfo.ParameterType)) != null) { parser = x => { object[] dp = { x, Activator.CreateInstance(baseType) }; baseType.InvokeMember("TryParse", BindingFlags.InvokeMethod, null, null, dp); return(dp[1]); }; } else if (typeof(string).IsAssignableFrom(paramInfo.ParameterType)) { parser = x => x; } else { parser = x => JsonConvert.DeserializeObject(x, paramInfo.ParameterType); } proxyMethods[methodInfo.Name].ProxyData.Add(new ProxyParameterData(restType, paramInfo.ParameterType, lookName, parser)); } } }
public HttpResponseMessage Getall() { using (DB db = new DB()) { //var data = db.RM0007.AsEnumerable().Select(p => new //{ // p.MKV9999_ID,p.RM0006_ID,p.RM0007_ID,p.trangThai, // MKV9999=AccountGett.GetAccount(new AccountGett.filter() { id=p.MKV9999_ID}), // RM0006=db.RM0006.Where(o=>o.RM0006_ID==p.RM0006_ID).Select(o=>new { o.ghiChu, o.maTieuChiDG,o.RM0006_ID,o.tenTieuChiDG,o.thuTu,o.tinhTrang}) //}); var data = db.MKV9999.AsEnumerable().Select(p => new { p.MKV9999_ID, p.manhansu, p.matkhau, p.id, p.hodem, p.ten, p.type, p.ngaysinh, p.gioitinh, p.noisinh, p.quequan, p.diachithuongtru, p.diachitamtru, p.cmtnd_so, p.cmtnd_ngayhethan, p.cmtnd_noicap, p.hochieu_so, p.hochieu_ngaycap, p.hochieu_ngayhethan, p.ngayvaocongty, p.phong_id, p.ban_id, p.congdoan_id, p.chucvu_id, p.nganhang_stk, p.nganhang_id, p.sosobaohiem, p.honnhantinhtrang, p.datnuoc_id, p.phuongxa, p.suckhoetinhtrang, p.dienthoai_nharieng, p.dienthoai_didong, p.email, p.tinhtrangnhansu, p.thutu, p.chucvu, p.capbac, thetu_id = db.MKV9998.Where(o => p.phong_id == o.phong_id).Select(o => o.bophan_ten).FirstOrDefault(), RM0006 = db.RM0006.Where(w => w.tinhTrang == true).Select(w => new { w.ghiChu, w.maTieuChiDG, w.RM0006_ID, w.tenTieuChiDG, w.thuTu, w.tinhTrang, RM0007 = db.RM0007.Where(q => q.MKV9999_ID == p.MKV9999_ID && q.RM0006_ID == w.RM0006_ID).Select(q => new { q.MKV9999_ID, q.RM0006_ID, q.RM0007_ID, q.trangThai, }).FirstOrDefault(), }), }).ToList(); return(REST.GetHttpResponseMessFromObject(data)); } }
public Json2(REST rest) => client = rest;
public BotReply Say(BotChatRequest request) { return(REST.Post <BotChatRequest, BotReply>(API_ENDPOINT_URL + "/chat", request, GetBaseHeaders( ))); }
public void HandleFindExperienceByNameCapability(ViewerAgent agent, AgentCircuit circuit, HttpRequest httpreq) { if (httpreq.CallerIP != circuit.RemoteIP) { httpreq.ErrorResponse(HttpStatusCode.Forbidden, "Forbidden"); return; } if (httpreq.Method != "GET") { httpreq.ErrorResponse(HttpStatusCode.MethodNotAllowed, "Method not allowed"); return; } Dictionary <string, object> reqdata = REST.ParseRESTFromRawUrl(httpreq.RawUrl); int currentpage; int pagesize; object o; if (!reqdata.TryGetValue("page", out o) || int.TryParse(o.ToString(), out currentpage)) { currentpage = 1; } if (!reqdata.TryGetValue("page_size", out o) || int.TryParse(o.ToString(), out pagesize)) { pagesize = 30; } if (!reqdata.TryGetValue("query", out o)) { httpreq.ErrorResponse(HttpStatusCode.BadRequest, "Bad request"); return; } string query = o.ToString(); SceneInterface scene = circuit.Scene; if (scene == null) { httpreq.ErrorResponse(HttpStatusCode.NotFound, "Not Found"); return; } ExperienceServiceInterface experienceService = scene.ExperienceService; if (experienceService == null) { httpreq.ErrorResponse(HttpStatusCode.NotFound, "Not Found"); return; } List <ExperienceInfo> experienceinfos = experienceService.FindExperienceInfoByName(query); Map resdata = new Map(); AnArray result = new AnArray(); resdata.Add("experience_keys", result); foreach (ExperienceInfo info in experienceinfos) { result.Add(info.ToMap()); } using (var res = httpreq.BeginResponse("application/llsd+xml")) { using (Stream s = res.GetOutputStream()) { LlsdXml.Serialize(resdata, s); } } }
public BotConfiguration GetConfiguration( ) { return(REST.Get <BotConfiguration>(API_ENDPOINT_URL + "/config", GetBaseHeaders( ))); }
public HttpResponseMessage GetallCMTND([FromBody] ungvienget.filterungvien cmt) { return(REST.GetHttpResponseMessFromObject(ungvienget.Getallungvien(cmt))); }