//Refresh Button private async void button3_Click(object sender, EventArgs e) { dt.Rows.Clear(); int i = 0; IFirebaseClient client = new FireSharp.FirebaseClient(config); FirebaseResponse response = await client.GetTaskAsync("Counter/"); counter ctn = response.ResultAs <counter>(); while (true) { i++; if (i > ctn.M) { break; } FirebaseResponse responAkun = await client.GetTaskAsync("User_Account/" + i); Data data = responAkun.ResultAs <Data>(); DataRow dr = dt.NewRow(); dr["Nama Depan"] = data.namaDepan; dr["Nama Belakang"] = data.namaBelakang; dr["NIP"] = data.nip; dr["Tempat TglLahir"] = data.tglLahir; dr["Pangkat/Golongan"] = data.pangkatGol; dr["Sekolah Mengajar"] = data.sekolah; dr["Mata Pelajaran"] = data.mapel; dr["Username"] = data.username; dr["Password"] = data.pwd; dt.Rows.Add(dr); } }
public static async System.Threading.Tasks.Task SaveUserAsync(UserModel model) { model.Id = Guid.NewGuid().ToString(); string clearPasswd = GeneralHelper.CreateRandomPassword(5); model.Password = HashHelper.GenerateSaltedHash(new SecureData(clearPasswd), new SecureData(model.UserName.ToLower())).ToString();; model.RemainingCount = 5; var client = new FireSharp.FirebaseClient(firebase.config); var get = client.Get(@"User/"); var rawdata = JsonConvert.DeserializeObject <Dictionary <string, UserModel> >(get.Body); List <UserModel> list = new List <UserModel>(); if (rawdata != null) { foreach (var item in rawdata) { list.Add(item.Value); } if (list.Where(q => q.UserName.Equals(model.UserName) || q.Email.Equals(model.Email)).ToList().Count != 0) { throw new Exception("hata"); } } await client.PushAsync(@"User/", model); await MailHelper.SendMail(model.Email, "Sayın " + model.UserName + " uygulamaya giriş için şifreniz : " + clearPasswd + "\n Kullanım hakkınız 5 dir."); }
public async void Save_Process(string Type, string Department, string Id, string _Owner) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); FirebaseResponse Respose = await Client.GetTaskAsync("Number_Process/" + "Now"); FireBase_Counter Data = Respose.ResultAs <FireBase_Counter>(); string Counter = Data.Counter; var Process_Data = new FireBase_Process { Number = Counter, Code = Get_Process_Code(Type, Department), Record_Id = Id, Owner = _Owner }; SetResponse Process_Respose = await Client.SetTaskAsync("Process/" + Counter, Process_Data); Update_Counter((int.Parse(Counter) + 1).ToString()); return; }
//public async void gethuyenAsync() //{ // //activityIndicator1.IsRunning = true; // //lblLoadingText.IsVisible = true; // IFirebaseClient clientKT = new FireSharp.FirebaseClient(config); // FirebaseResponse tk1 = await clientKT.GetAsync("TinhThanh/" + 1); // Tinh _tinh1 = tk1.ResultAs<Tinh>(); // Source = new List<Quan>() // { // new Quan(_tinh1.MaTinh, _tinh1.TenTinh) // }; //} public async void getgiadinh() { ObservableCollection <khacthuegiadinh> manggiadinh = new ObservableCollection <khacthuegiadinh>(); IFirebaseClient client = new FireSharp.FirebaseClient(config); int i = 0; bool dem = true; FirebaseResponse tk = await client.GetAsync("khachthue/" + 33956565 + "/KHACHTHUEGIADINH/" + 1 + "/"); //if (tk.Body == "null") //{ // dem = false; //} khacthuegiadinh GD = tk.ResultAs <khacthuegiadinh>(); Khachthuegiadinh = new ObservableCollection <khacthuegiadinh>() { new khacthuegiadinh( GD.HOTEN, GD.NGAYSINH, GD.GIOITINH, GD.QUANHE, GD.NGHENGHIEP, GD.DIACHICHOOHIENNAY) }; }
public LiveChatViewModel(INavigation _navigationService, UserModel _userLogged, UserModel _selectedIt) { NavigationService = _navigationService; MessagesList = new ObservableCollection <MessageModel>(); UserLogged = _userLogged; SelectedIt = _selectedIt; ChatKey = UserLogged.UserName + "_" + SelectedIt.UserName; //RTD Child's Name OriginalKey = ChatKey; InverseChat = false; config = new FirebaseConfig { //AuthSecret = "your_firebase_secret", BasePath = "https://realtimechat-b2228.firebaseio.com/" }; client = new FirebaseClient("https://realtimechat-b2228.firebaseio.com/"); FiresharpClient = new FireSharp.FirebaseClient(config); Streaming(); getMessage(); SendMessageToChat = new Command(async() => await ExecuteSendMessageToChat()); //SelectFileToInsert = new Command(async () => await ExecuteSelectFileToInsert()); DownloadFile = new Command(async(Param) => await ExecuteDownloadFile(Param)); }
private void Confirmer_Clicked(object sender, EventArgs e) { var props = Application.Current.Properties; if (props.ContainsKey("privacy") && (bool)props["privacy"] && props.ContainsKey("username") && props.ContainsKey("exp") && props.ContainsKey("level")) { IFirebaseConfig config = new FirebaseConfig { AuthSecret = "sl8xzZIXaxap45WOhfBWX50q9IM0nmziqjtaYwtt", BasePath = "https://xamarinapp-256505.firebaseio.com/" }; IFirebaseClient client; client = new FireSharp.FirebaseClient(config); //client.Push("/MyTestData", new Tuple<string, int, int, int>(data.username, data.xp, data.level, (data.level-1) * 100 + data.xp)); client.Push("/MyTestData", new UserData((string)props["username"], (int)props["exp"], (int)props["level"])); } User user = MainPage.page.user; System.Diagnostics.Debug.WriteLine("before " + user.GetTomorrowTasks().Count); foreach (TaskCheckBox box in Stacker.Children) { if (box.GetSelected()) { user.selectTasks(box.GetTask()); } } System.Diagnostics.Debug.WriteLine("after " + user.GetTomorrowTasks().Count); opened = false; Navigation.PopModalAsync(); MainPage.page.RefreshScreen(); }
public static async void sendDB(string date, Data msg) { IFirebaseClient client; client = new FireSharp.FirebaseClient(config); await client.UpdateTaskAsync("/atencion/" + date, msg); }
private async void Criteria_Load(object sender, EventArgs e) { int i = 0; IFirebaseClient client = new FireSharp.FirebaseClient(config); dt.Columns.Add("Nama Kriteria"); dt.Columns.Add("Nilai Kriteria"); dataGridView1.DataSource = dt; dataGridView1.Columns["Nama Kriteria"].Width = 700; while (true) { i++; if (i > 5) { break; } FirebaseResponse response = await client.GetTaskAsync("Kriteria/" + i); Bobot bobot = response.ResultAs <Bobot>(); DataRow dr = dt.NewRow(); dr["Nama Kriteria"] = bobot.Nama; dr["Nilai Kriteria"] = bobot.Nilai; dt.Rows.Add(dr); } }
// Insert Data In FireBase DataBase ... // public async void FireBase_Insert(Employee Employee) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); var Employee_Data = new FireBase_Employee { Number = Employee.Get_Number(), Name = Employee.Get_Name(), Connect1 = Employee.Get_Connect1(), Connect2 = Employee.Get_Connect2(), Children = Employee.Get_Children(), Type = Employee.Get_Type(), Class = Employee.Get_Class(), Number_Hour = Employee.Get_Number_Hour(), Detail = Employee.Get_Detail() }; SetResponse Respose = await Client.SetTaskAsync("Employee/" + Employee.Get_Number(), Employee_Data); return; }
// Insert Data In FireBase DataBase ... // public async void FireBase_Insert(Movement_Receipt Movement_Receipt) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); var Movement_Receipt_Data = new FireBase_Movement_Receipt { Number = Movement_Receipt.Get_Number(), Book = Movement_Receipt.Get_Book(), Type = Movement_Receipt.Get_Type(), Owner = Movement_Receipt.Get_Owner(), Kind = Movement_Receipt.Get_Kind(), Amount = Movement_Receipt.Get_Amount(), Date = Movement_Receipt.Get_Date(), Detail = Movement_Receipt.Get_Detail(), }; SetResponse Respose = await Client.SetTaskAsync("Movement_Receipt/" + Movement_Receipt.Get_Number(), Movement_Receipt_Data); return; }
async Task Find_DayCountAsync() { try { inc++; IFirebaseClient client = new FireSharp.FirebaseClient(config); SL = SL + inc.ToString("00"); FirebaseResponse response = await client.GetAsync("Sales/SalesOrder/" + SL); SO rep = response.ResultAs <SO>(); if (rep?.SalesOrderID == null) { stat = 1; saleID = SL; return; } else { // Replaces No. with the OLD Format SL = SL.Replace(inc.ToString("00"), ""); Find_DayCountAsync(); } } catch (Exception) { } }
private async void button2_Click(object sender, EventArgs e) { dt2.Rows.Clear(); int i = 0; IFirebaseClient client = new FireSharp.FirebaseClient(config); FirebaseResponse response = await client.GetTaskAsync("Counter"); counter ctn = response.ResultAs <counter>(); while (true) { i++; if (i > ctn.M) { break; } FirebaseResponse responseNilai = await client.GetTaskAsync("Penilaian/" + i); Penilaian obj = responseNilai.ResultAs <Penilaian>(); DataRow dr = dt2.NewRow(); dr["Nama"] = obj.nama; dr["NIP"] = obj.nip; dr["Dokumen Portofolio"] = obj.C5; dr["Kinerja Guru"] = obj.C2; dr["Presentasi Best Practice"] = obj.C3; dr["Wawancara"] = obj.C4; dr["Test Tulis"] = obj.C1; dt2.Rows.Add(dr); } }
// Insert Data In FireBase DataBase ... // public async void FireBase_Insert(Employee_Receipt Employee_Receipt) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); var Employee_Receipt_Data = new FireBase_Employee_Receipt { Number = Employee_Receipt.Get_Number(), Book = Employee_Receipt.Get_Book(), Owner = Employee_Receipt.Get_Owner(), Date = Employee_Receipt.Get_Date(), Name = Employee_Receipt.Get_Name(), Sallary = Employee_Receipt.Get_Sallary(), Discount = Employee_Receipt.Get_Discount(), Total = Employee_Receipt.Get_Total(), Detail = Employee_Receipt.Get_Detail(), Employee_Number = Employee_Receipt.Get_Employee_Number() }; SetResponse Respose = await Client.SetTaskAsync("Employee_Receipt/" + Employee_Receipt.Get_Number(), Employee_Receipt_Data); return; }
private async void button2_Click(object sender, EventArgs e) { try { IFirebaseClient client = new FireSharp.FirebaseClient(config); FirebaseResponse resNilai = await client.GetTaskAsync("Penilaian/" + baris); Penilaian ambil = resNilai.ResultAs <Penilaian>(); var nilai = new Penilaian { nama = label1.Text, nip = ambil.nip, username = ambil.username, C5 = Convert.ToSingle(textBox1.Text), C2 = Convert.ToSingle(textBox2.Text), C3 = Convert.ToSingle(textBox3.Text), C4 = Convert.ToSingle(textBox4.Text), C1 = Convert.ToSingle(textBox5.Text), }; FirebaseResponse update = await client.UpdateTaskAsync("Penilaian/" + baris, nilai); Penilaian pen1 = update.ResultAs <Penilaian>(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static void Main(string[] args) { var data = new Data { datas = "", }; String line; System.IO.StreamReader file = new System.IO.StreamReader("yourtext.txt"); IFirebaseConfig config = new FirebaseConfig { AuthSecret = "", BasePath = "" }; IFirebaseClient client; client = new FireSharp.FirebaseClient(config); while ((line = file.ReadLine()) != null) { Console.WriteLine(line); Task.Run(async() => { SetResponse response = await client.SetTaskAsync("Test/" + line, data); Data result = response.ResultAs <Data>(); }).GetAwaiter().GetResult(); } file.Close(); Console.ReadLine(); }
// Insert Data In FireBase DataBase ... // public async void FireBase_Insert(Receipt Receipt) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); var Receipt_Data = new FireBase_Receipt { Number = Receipt.Get_Number(), Book = Receipt.Get_Book(), Branch = Receipt.Get_Branch(), Recipient = Receipt.Get_Recipient(), First_Name = Receipt.Get_First_Name(), Last_Name = Receipt.Get_Last_Name(), Amount_Paid = Receipt.Get_Amount_Paid(), Date = Receipt.Get_Date(), For = Receipt.Get_For(), Account_Number = Receipt.Get_Account_Number() }; SetResponse Respose = await Client.SetTaskAsync("Receipt/" + Receipt.Get_Number(), Receipt_Data); return; }
public async void Save_Update() { Process Process = new Process(); string Opreation_Number = Process.Get_Process_Number(); Process.Download_Update(Opreation_Number); IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); FirebaseResponse Respose = await Client.GetTaskAsync("Number_Process/" + "Now"); FireBase_Counter Data = Respose.ResultAs <FireBase_Counter>(); int Counter = int.Parse(Data.Counter); Counter--; Process.Update_Process_Number(Counter.ToString()); }
private async void UserControl1_Load(object sender, EventArgs e) { label1.Text = ""; int z = 0; int b = 0; IFirebaseClient client = new FireSharp.FirebaseClient(config); FirebaseResponse resAkun = await client.GetTaskAsync("Counter"); counter ctn = resAkun.ResultAs <counter>(); while (true) { z++; if (z > ctn.M) { break; } FirebaseResponse response = await client.GetTaskAsync("User_Account/" + z); Data obj = response.ResultAs <Data>(); if (Menu.username == obj.username) { label1.Text = obj.nip; label3.Text = obj.namaDepan + " " + obj.namaBelakang; label4.Text = obj.mapel; label5.Text = obj.sekolah; } } }
public async Task <IActionResult> AddTrucker([FromBody] TruckerModel truckerModel) { var result = await _truckerServiceWebApp.AddTrucker(truckerModel); var client = new FireSharp.FirebaseClient(_firebaseConfig); var response = client.PushAsync("truckers/", result); return(Ok(result)); }
public IFirebaseClient getClient() { IFirebaseConfig config = getConfig(); IFirebaseClient client; client = new FireSharp.FirebaseClient(config); return(client); }
private async void DialogEditCriteria_Load(object sender, EventArgs e) { IFirebaseClient client = new FireSharp.FirebaseClient(config); FirebaseResponse response = await client.GetTaskAsync("Kriteria/" + baris); Bobot bobot = response.ResultAs <Bobot>(); label1.Text = bobot.Nama; textBox1.Text = bobot.Nilai.ToString(); }
private string ExportarLeituraFirebase(string caminho, Model_Leitura_Importada leitura) { //caminho pode ser por exemplo "/Appv99Bucket/Inventario/" IFirebaseClient client = new FireSharp.FirebaseClient(config); var response = client.Set(caminho + leitura.Data + "/" + leitura.Cliente + "/" + leitura.Barcode + "/", leitura); return(JsonConvert.SerializeObject(response).ToString()); }
// Delete Employee Receipt From FireBase DataBase ... // public async void FireBase_Delete(string Employee_Receipt_Number) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); FirebaseResponse Respose = await Client.DeleteTaskAsync("Employee_Receipt/" + Employee_Receipt_Number); }
public async Task <ActionResult> Index() { dataTable.Columns.Add(new DataColumn("Employee Number", typeof(string))); dataTable.Columns.Add(new DataColumn("First Name", typeof(string))); dataTable.Columns.Add(new DataColumn("Last Name", typeof(string))); dataTable.Columns.Add(new DataColumn("Email", typeof(string))); dataTable.Columns.Add(new DataColumn("Cell Number", typeof(string))); dataTable.Columns.Add(new DataColumn("Skill", typeof(string))); //creates connection 3to firebase IFirebaseConfig config = new FirebaseConfig { AuthSecret = "3JjYU2MerFoAvR5N5yMOaQv3YdH5orw8skiMdXeW", BasePath = "https://troye-computer-systems.firebaseio.com/" }; IFirebaseClient client; client = new FireSharp.FirebaseClient(config); int counter = 0; int i = 0; FirebaseResponse response = await client.GetTaskAsync("Counter/node"); Colleagues obj = response.ResultAs <Colleagues>(); //this finds out the size of the database with a counter in the table called counter node cnt counter = Convert.ToInt32(obj.cnt); //change 20 based on the number of people in the table while (i < 20) { i++; try { //get data from specified table and increment through each of the employees FirebaseResponse resp2 = await client.GetTaskAsync("Employees/" + i); Colleagues obj2 = resp2.ResultAs <Colleagues>(); DataRow row = dataTable.NewRow(); //addeds the employees data to each row with new data and row each time it goes through the while loop //make sure the getters and setters names are the same as in the table or a problem will arise row["Employee Number"] = obj2.EmployeeNumber; row["First Name"] = obj2.FirstName; row["Last Name"] = obj2.LastName; row["Email"] = obj2.Email; row["Cell Number"] = obj2.CellNumber; row["Skill"] = obj2.Skill; dataTable.Rows.Add(row); } catch { Debug.Write("Fail, You are going to far and their is no more data! "); } } return(View("ColleaguesView", dataTable)); }
private void Form1_Load(object sender, EventArgs e) { IFirebaseClient client; client = new FireSharp.FirebaseClient(config); if (client != null) { MessageBox.Show("Connnection Established!"); } MessageBox.Show(config.ToString()); btnCLose.Location = new Point(width - 150, 12); }
public IFirebaseClient connect() { IFirebaseConfig ifc = new FirebaseConfig { AuthSecret = "ajFr4H1tKZefLtJPRja8HyG1uc58m9DhQr8sO8MO", BasePath = "https://hotelmanagement-dd391-default-rtdb.firebaseio.com/" }; IFirebaseClient client; client = new FireSharp.FirebaseClient(ifc); return(client); }
private static FireSharp.FirebaseClient GetStorageClient() { var rootUri = ConfigurationManager.AppSettings.Get("FirebaseUri"); var secret = ConfigurationManager.AppSettings.Get("FirebaseUserToken"); var fb = new FireSharp.FirebaseClient(new FirebaseConfig() { AuthSecret = secret, BasePath = rootUri }); return(fb); }
// Delete Data From FireBase DataBase // public async void FireBase_Delete(string Detail_Student_Name) { IFirebaseConfig Config = new FirebaseConfig { AuthSecret = "VH1rdiDgj2hzD0WN5JZ67BSXTN7OdOeM0fnry50G", BasePath = "https://ctm-db.firebaseio.com/" }; IFirebaseClient Client = new FireSharp.FirebaseClient(Config); FirebaseResponse Respose = await Client.DeleteTaskAsync("Account_Detail/" + Detail_Student_Name); }
public async Task <int> IniciarCarga() { int TotalInseridos; IFirebaseClient client = new FireSharp.FirebaseClient(config); IFirebaseClient clientX = new FireSharp.FirebaseClient(configX); GravaLog("Iniciando", "Carga Iniciada!"); ApagaTabelaTemporaria(); Apagarconstraint(); CriarTabelaTemporaria(); GravaLog("Executando", "Tabela Temp Recriada!"); //Obtendo Base AppInventor FirebaseResponse res2 = client.Get("/Appv09Bucket/"); string myJson2 = res2.Body; var jsonObj2 = JsonConvert.DeserializeObject <JObject>(myJson2).First.First; //Obtendo Base App Xamarin FirebaseResponse res1 = clientX.Get("/Appv09Bucket/"); string myJson1 = res1.Body; var jsonObj1 = JsonConvert.DeserializeObject <JObject>(myJson1).First.First; GravaLog("Executando", "Json Lido!"); //DataTable App Inventor var DTFireBaseImportado = ImportarFireBaseNovaEstrutura(jsonObj2); //DataTable App Xamarin var DTFireBaseImportado1 = ImportarFireBaseNovaEstrutura(jsonObj1); GravaLog("Executando", "Json Convertido! Total de Registros base AppInventor: " + DTFireBaseImportado.Rows.Count.ToString() + ". Total base Xamarin: " + DTFireBaseImportado1.Rows.Count.ToString()); TotalInseridos = ExportarLeituraSQL(DTFireBaseImportado) + ExportarLeituraSQL(DTFireBaseImportado1); GravaLog("Executando", "Json Inserido! Total de Registros: " + TotalInseridos.ToString()); GravaLog("Fim", "Carga Finalizada!"); //DadosSilimed(); //Processar proc = new Processar(); //proc.RetiraAmostaMedidorMedgel(); //proc.ExcluirNaoNumerico(); //Ao invés de exlcuir, preciso gerar relatório para tratamento //proc.ExcluirMenorQueSete(); //Ao invés de exlcuir, preciso gerar relatório para tratamento //Ajustes(); //ApagarDuplicados(); return(1); }
private void SaveToDatabase(Song song) // FUL-LÖSNING! { IFirebaseConfig config = new FirebaseConfig() { AuthSecret = "JPVcYaQsp7Sc4cESsiki1Q7V8MDkHDEVsiw3VMND", BasePath = "https://sa-ska-det-lata.firebaseio.com/", }; IFirebaseClient _client = new FireSharp.FirebaseClient(config); _client.Push("/Songs", song); }