public bool UpdateCustomer(Customer customer)
        {
            FirebaseResponse response = firebaseClient.Update($"Customer/{customer.Id}", customer);
            Customer         result   = response.ResultAs <Customer>();

            return(true);
        }
 /// <summary>
 /// Update the patient discharge status
 /// </summary>
 /// <param name="patDetails">discharge patient details</param>
 public void DischargeDAC(Admission patDetails)
 {
     if (firebaseClient != null)
     {
         var dischargeEntry = firebaseClient.Update("AdmissionList/" + patDetails.NINumber, patDetails);
         TransferWardAvailability(patDetails.WardType);
     }
 }
Example #3
0
        private void btnActivate_Click(object sender, EventArgs e)
        {
            try
            {
                client = new FireSharp.FirebaseClient(ifc);

                FirebaseResponse res     = client.Get("Keys/" + txtKey.Text);
                CheckKey         ResUser = res.ResultAs <CheckKey>();
                var CurUser = new CheckKey()
                {
                    key = txtKey.Text
                };

                if (string.IsNullOrEmpty(txtKey.Text) | string.IsNullOrWhiteSpace(txtKey.Text))
                {
                }
                else if (CheckKey.IsEqual(ResUser, CurUser))
                {
                    if (ResUser.used == "False")
                    {
                        var _res = client.Get("Keys/" + txtKey.Text);
                        var std  = new CheckKey();
                        std = res.ResultAs <CheckKey>();

                        var _std = new CheckKey()
                        {
                            key  = txtKey.Text,
                            used = "True"
                        };
                        var _updater = client.Update("Keys/" + txtKey.Text, _std);

                        var _std3 = new UserClass()
                        {
                            activated = "True"
                        };
                        var _updater2 = client.Update("Users/" + usrPc, _std3);

                        MessageBox.Show("Activated succssesfully!" + Environment.NewLine + "Please restart to unlock all functions", "Information!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Close();
                    }
                    else
                    {
                        MessageBox.Show("Wrong activation code!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Wrong activation code!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                MessageBox.Show("Failed connection to Server!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public bool UpdateCustomer(Customer c)
        {
            FirebaseResponse response = firebaseClient.Update($"Customer/{c.Id}", c);
            var result = response.ResultAs <Customer>();

            if (result.Name == c.Name)
            {
                return(true);
            }
            return(false);
        }
        public bool UpdateCustomer(Customer customer)
        {
            if (GetCustomerByID(customer.ID) == null)
            {
                Console.WriteLine("Customer not found");
            }

            FirebaseResponse response = firebaseClient.Update($"Customers/Cust{customer.ID}", customer);

            return(true);
        }
Example #6
0
        public void removeCoins(int _coins)
        {
            CoinsClass std = new CoinsClass()
            {
                Coins = Properties.Settings.Default.coins - _coins
            };

            Properties.Settings.Default.Save();
            var clUpdater = client.Update("Users/" + frmLogin._txtUsername, std);

            Properties.Settings.Default.coins = std.Coins;
        }
Example #7
0
        public bool UpdateCustomer(Customer c, string newName)
        {
            FirebaseResponse firebaseResponse = firebaseClient.Get($"Customer/{c.ID}");

            if (firebaseResponse.Body != "null")
            {
                FirebaseResponse response = firebaseClient.Update($"Customer/{c.ID}", c.NAME = newName);
                Console.WriteLine($"Customer Updated");
                return(true);
            }
            Console.WriteLine("Customer not exist");
            return(false);
        }
Example #8
0
        public bool update_packed_to(bool bBool, Borrow_Data brData)
        {
            brData.packed = true;
            FirebaseResponse update_response = client.Update(sBorrowTable_path + brData.BrID, brData);

            if (update_response != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #9
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtLink.Text == string.Empty)
     {
         MessageBox.Show("No link selected to Update."); return;
     }
     firebaseConfiqration();
     if (btnSave.Text == "Save")
     {
         UpdateItem mictco = new UpdateItem();
         mictco.UpdationLink = txtLink.Text;
         var          entdata   = mictco;
         PushResponse responses = client.Push(sTable, entdata);
         entdata.Id = responses.Result.name;
         SetResponse setResponse = client.Set(sTable + entdata.Id, entdata);
         MessageBox.Show("Link Saved");
     }
     else
     {
         item.UpdationLink = txtLink.Text;
         FirebaseResponse responses = client.Update(sTable + item.Id, item);
         MessageBox.Show("Link Updated");
     }
     FB_Management_Load(null, null);
     txtLink.Text = string.Empty;
     this.Close();
 }
Example #10
0
        public IEnumerable <RouteModel> DropSelectedRoute([FromBody] RouteModel routeData)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse setResponse = client.Update("Routes/" + routeData.Id.ToString(), routeData);

            return(null);
        }
Example #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            GetMACAddress();
            var             seeter = client.Get("clientData/" + mca);
            autontification fdd    = seeter.ResultAs <autontification>();

            //macaddrss = fdd.MacAddress;
            joingdate = fdd.joingDate;
            mobileno  = fdd.MobileNo;
            //  expdate = fdd.trialend;

            DateTime        startDate = DateTime.Parse(DateTime.Now.Date.ToString());
            DateTime        expdate   = startDate.AddDays(365);
            autontification fd        = new autontification()
            {
                MobileNo   = mobileno,
                MacAddress = mca.ToString(),
                joingDate  = joingdate,
                trialend   = expdate.Date
                             //  trialend = expdate.Date
            };
            var seeter1 = client.Update("clientData/" + mca, fd);

            Program.expdate = expdate;
            MessageBox.Show("Your Subscription are start ");
        }
Example #12
0
        //Program Sistem Lupa Password
        private void Btngantipassword_Click(object sender, RoutedEventArgs e)
        {
            FirebaseResponse res    = client.Get(@"Data/" + txtusername.Text);
            MyLupaPassword   Reuser = res.ResultAs <MyLupaPassword>();

            MyLupaPassword Lupa = new MyLupaPassword()
            {
                Username  = txtusername.Text,
                Email     = txtemail.Text,
                NoTelepon = txtnotelepon.Text,
                Password  = txtpassword.Password
            };

            if (MyLupaPassword.IsEqual(Reuser, Lupa))
            {
                MyLupaPassword user = new MyLupaPassword()
                {
                    Username  = txtusername.Text,
                    Email     = txtemail.Text,
                    NoTelepon = txtnotelepon.Text,
                    Password  = txtpassword.Password
                };
                FirebaseResponse response = client.Update(@"Data/" + txtusername.Text, user);

                MsgError("Password anda telah diganti yang baru");
            }
            else
            {
                MsgError("Check kembali akun anda");
            }
        }
 /// <summary>
 /// Update the student info in the firebase database.
 /// Authors: Eric Dong
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void saveSettings_Handler(object sender, EventArgs e)
 {
     if (hasEmptyFields())
     {
         MessageBox.Show("Please fill in, all the fields to proceed");
     }
     else
     {
         String firstName = RegistrationForm.makeTitle(firstNameSet.Text);
         String lastName  = RegistrationForm.makeTitle(lastNameSet.Text);
         // create new student
         updatedStudent = new Student()
         {
             FirstName     = firstName,
             LastName      = lastName,
             StudentNumber = student.StudentNumber,
             Email         = emailSet.Text,
             Password      = student.Password,
             Gender        = genderSet.Text,
             Phone         = phoneSet.Text,
             DateOfBirth   = dobSet.Value.Date,
         };
         client.Update("Students/" + student.StudentNumber, updatedStudent);
         this.closeForm(sender, e);
     }
 }
Example #14
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            DateTime aDate = DateTime.Now;
            string   code  = txtQRCode.Text + " " + aDate;
            var      data  = new Lessons
            {
                ders     = lesUser.ders,
                Kredi    = lesUser.Kredi,
                derskodu = lesUser.derskodu,
                QrVal    = code
            };
            FirebaseResponse response  = client.Update(@"Dersler/" + denemeders, data);
            QRCodeGenerator  qrOlustur = new QRCodeGenerator();

            QRCodeGenerator.QRCode          qrCode     = qrOlustur.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q);
            System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
            imgBarCode.Height = 250;
            imgBarCode.Width  = 250;
            using (Bitmap bitMap = qrCode.GetGraphic(20))
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    byte[] byteImage = ms.ToArray();
                    imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                }
                PlaceHolder1.Controls.Add(imgBarCode);
            }
        }
Example #15
0
        /// <summary>
        /// Actualizar correo, nombre, rol ó teléfono de una cuenta.
        /// </summary>
        /// <param name="user">Nombre de usuario de autenticación.</param>
        /// <param name="pass">La contraseña de autenticación.</param>
        /// <param name="searchedUser">El identificador de los nuevos datos.</param>
        /// <param name="userInfoJSON">
        /// El JSON con la información del usuario.
        /// Formato:
        /// <code>
        /// {
        ///     "correo": "*****@*****.**",
        ///     "rol": "userRol",
        ///     "telefono": "123-2-312-23",
        ///     "nombre": "Full User Name"
        /// }
        /// </code>
        /// </param>
        /// <returns>
        /// <seealso cref="WebServicesBUAP.Respuesta"/>
        /// La respuesta de la operación.
        /// </returns>
        public Respuesta UpdateUserInfo(string user, string pass, string searchedUser, string userInfoJSON)
        {
            Respuesta res = Authenticate(user, pass);

            if (res.Status == "error")
            {
                return(res);
            }

            var(isValid, code) = ValidateJSON(userInfoJSON, true);
            if (!isValid)
            {
                return(GetResponse(code));
            }

            if (!UserInfoExists(searchedUser))
            {
                return(GetResponse(507));
            }

            JsonSerializerSettings jsonSettings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            };
            object           userInfo = JsonConvert.DeserializeObject <object>(userInfoJSON);
            FirebaseResponse fireRes  = client.Update("usuarios_info/" + searchedUser, userInfo);

            if (fireRes != null)
            {
                return(GetResponse(403));
            }

            return(new Respuesta());
        }
Example #16
0
        public bool UpdateCustomer(Customer customer)
        {
            FirebaseResponse response = firebaseClient.Update($"Customer/{customer.ID}", customer);

            Customer result = response.ResultAs <Customer>();

            Console.WriteLine($"Data update in customer id: {result.ID}, name: {result.Name}");

            if (result == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #17
0
        public void UpdateBestSubmission(Submission s)
        {
            Submission submission = GetBestSubmission(s.ContestId.ToString(), s.Username, s.ProblemName);

            if (submission.Puntaje <= s.Puntaje)
            {
                try
                {
                    string documentName = "BestSubmissions/" + s.ContestId.ToString() + "/" + s.Username + "/" + s.ProblemName;
                    client.Update(documentName, s);
                }
                catch (Exception e)
                {
                    throw new NotImplementedException(e.ToString());
                }
            }
        }
Example #18
0
 /// <summary>
 /// Update book info, then add it to the database
 /// </summary>
 /// <param name="sBID"></param>
 /// <param name="sName"></param>
 /// <param name="sAuthor"></param>
 /// <param name="nReleaseYear"></param>
 /// <param name="sCategory"></param>
 /// <param name="sDescription"></param>
 /// <param name="sCoverPage"></param>
 /// <param name="nPrice"></param>
 /// <param name="nAmount"></param>
 /// <returns></returns>
 public bool update_book_info(string sBID, string sName, string sAuthor, int nReleaseYear, string sCategory,
                              string sDescription, string sCoverPage, int nPrice, int nAmount)
 {
     try
     {
         var data = new Book_Data(sName, sAuthor, nReleaseYear, sCategory, sDescription, sCoverPage, nPrice, nAmount);
         FirebaseResponse response = client.Update(sBookTable_path + sBID, data);
         Book_Data        result   = response.ResultAs <Book_Data>();
         if (result != null)
         {
             return(true);
         }
     }
     catch (Exception)
     {
     }
     return(false);
 }
Example #19
0
        //Program Sistem Lupa Password
        #region
        private void  Btnlanjut_Click(object sender, EventArgs e)
        {
            if (txtnama.Text != "NAMA LENGKAP")
            {
                if (txtemail.Text != "EMAIL")
                {
                    if (txttelepon.Text != "NOMOR TELEPON")
                    {
                        if (txtgantipass.Text != "PASSWORD BARU")
                        {
                            FirebaseResponse res    = client.Get(@"Users/" + txtnama.Text);
                            MyLupaPassword   Reuser = res.ResultAs <MyLupaPassword>();

                            MyLupaPassword CurUser = new MyLupaPassword()
                            {
                                NamaLengkap = txtnama.Text,
                                Email       = txtemail.Text,
                                NoTelepon   = txttelepon.Text
                            };
                            if (MyLupaPassword.IsEqual(Reuser, CurUser))
                            {
                                MyLupaPassword user = new MyLupaPassword()
                                {
                                    Password    = txtgantipass.Text,
                                    Email       = txtemail.Text,
                                    NamaLengkap = txtnama.Text,
                                    NoTelepon   = txttelepon.Text
                                };
                                FirebaseResponse response = client.Update(@"Users/" + txtnama.Text, user);
                                MsgError("Password anda berhasil terganti");
                                labelgagal.ForeColor = Color.Chartreuse;
                            }
                            else
                            {
                                MsgError("Nama Lengkap, Email, atau Nomor Telepon tidak terdaftar");
                            }
                        }
                        else
                        {
                            MsgError("Nama Lengkap, Email, atau Nomor Telepon tidak terdaftar ");
                        }
                    }
                    else
                    {
                        MsgError("Nama Lengkap, Email, atau Nomor Telepon tidak terdaftar ");
                    }
                }
                else
                {
                    MsgError("Nama Lengkap, Email, atau Nomor Telepon tidak terdaftar ");
                }
            }
            else
            {
                MsgError("Nama Lengkap, Email, atau Nomor Telepon tidak terdaftar ");
            }
        }
Example #20
0
        public void delete()
        {
            var           i              = 0; // i == dropdownlist1 selected value int form
            var           p              = 0; // total counter
            var           res            = client.Get(@"Doctors/");
            MyAppointment ResAppointment = res.ResultAs <MyAppointment>();

            if (ResAppointment != null)
            {
                counter = ResAppointment.counter;
                p       = ResAppointment.counter;
                i       = Convert.ToInt32(DropDownList1.SelectedValue);
                counter--;
            }
            else
            {
                counter = 0;
            }
            if (p > i)
            {
                for (int b = i; p > b; b++)                //b replace i for loop
                {
                    int           n               = b + 1; //counter++
                    var           res1            = client.Get(@"Doctors/" + n);
                    MyAppointment ResAppointment1 = res1.ResultAs <MyAppointment>();
                    if (ResAppointment1 != null)
                    {
                        MyAppointment doctor = new MyAppointment()
                        {
                            Username = ResAppointment1.Username,
                            Password = ResAppointment1.Password,
                            Fullname = ResAppointment1.Fullname,
                            counter  = i
                        };
                        FirebaseResponse set1 = client.Update(@"Doctors/" + i, doctor);
                    }
                    i++;
                }
            }
            FirebaseResponse set = client.Delete(@"Doctors/" + p);

            client.Set(@"Doctors/" + "/" + "counter", counter);
            Response.Write("<script>alert('Successfully Deleted!')</script>");
        }
Example #21
0
        public ActionResult Delete(int code)
        {
            Client = new FirebaseClient(Config);
            var response     = Client.Get("subscription/" + code);
            var subscription = response.ResultAs <Subscription>();

            subscription.deleted = 1;
            var response2 = Client.Update("subscription/" + code, subscription);

            return(View("Index"));
        }
Example #22
0
        public ActionResult Enter(int code)
        {
            Client = new FirebaseClient(Config);
            var response     = Client.Get("subscription/" + code);
            var subscription = response.ResultAs <Subscription>();

            subscription.numberofentrence++;
            var response2 = Client.Update("subscription/" + code, subscription);

            return(View("Index"));
        }
Example #23
0
        void Set_Firebase_HardwareDevice(string command_setup)
        {
            try
            {
                string address = "/";

                var todo = new
                {
                    HardwareDevice = command_setup
                };


                FirebaseResponse response = Client.Update(address, todo);

                string retorno = JsonConvert.SerializeObject(response).ToString();
            }
            catch
            {
            }
        }
Example #24
0
        public ActionResult Create([FromBody] Transaction transaction)
        {
            FirebaseResponse countGetResponse = client.Get("AI");

            if (countGetResponse.Body == "null")
            {
                SetResponse countSet = client.Set("AI/Count", 0);
                countGetResponse = client.Get("AI");
            }

            AutoIncrement countInstance = countGetResponse.ResultAs <AutoIncrement>();

            transaction.Id = countInstance.Count;
            SetResponse transactionResponse = client.Set("Transaction/" + countInstance.Count, transaction);

            countInstance.Count++;
            FirebaseResponse countUpdateResponse = client.Update("AI", countInstance);

            return(new ObjectResult(transaction));
        }
        void Booking()
        {
            DialogResult dr = MessageBox.Show("Bạn có muốn đặt phòng?", "Thông báo", MessageBoxButtons.YesNo);

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                string           dateCheckin = DateTime.Now.ToString("dd-MM-yyyy");
                FirebaseResponse se          = client.Update("Bills/" + dateCheckin + "/" + textBox_roomID.Text + "/", bill());
                if (se.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    FirebaseResponse update = client.Set("Rooms/" + textBox_roomID.Text + "/status", "Có người");
                    update = client.Set("Rooms/" + textBox_roomID.Text + "/dateCheckIn", dateCheckin);
                    MessageBox.Show("Đặt phòng thành công!!", "Thông báo", MessageBoxButtons.OK);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Lỗi khi đặt phòng", "Thông báo", MessageBoxButtons.OK);
                }
            }
        }
Example #26
0
        public void Update()
        {
            _client.Set("todos/updatetest/set", new Todo
            {
                name     = "Execute SET",
                priority = 2
            });

            var todoToUpdate = new Todo
            {
                name     = "Execute UPDATE!",
                priority = 1
            };

            var response = _client.Update("todos/updatetest/set", todoToUpdate);

            Assert.NotNull(response);
            var actual = response.ResultAs <Todo>();

            Assert.AreEqual(todoToUpdate.name, actual.name);
            Assert.AreEqual(todoToUpdate.priority, actual.priority);
        }
Example #27
0
        public People UpdatePeople(string key, People people)
        {
            People data = null;

            if (GetByIDPeople(key) != null)
            {
                var response = client.Update($"people/{key}", people);
                data = new People();
                data = response?.ResultAs <People>();
            }

            return(data);
        }
Example #28
0
        static private void Update()
        {
            var data = new Data
            {
                ID   = "1",
                Name = "AUSTIN !"
            };

            FirebaseResponse response = firebaseClient.Update("Customer/1", data);
            Data             result   = response.ResultAs <Data>();

            Console.WriteLine("Data updated " + data.ID);
        }
Example #29
0
        private void btnreset_Click(object sender, EventArgs e)
        {
            var data = new Data
            {
                ID    = emplyID.Text,
                Fname = emplyfname.Text,
                Lname = emplylname.Text
            };
            var set = client.Update(@"Information/" + emplyID.Text, data);

            //MessageBox.Show("Updated Sucessfully");
            export();
        }
Example #30
0
        private async void button3_Click(object sender, EventArgs e)
        {
            var data = new Data
            {
                Id   = textBox1.Text,
                Pass = textBox2.Text
            };
            //SetResponse res = await client.UpdateTaskAsync("" + textBox1.Text, data);
            var set = client.Update(textBox1.Text, data);

            //Data result = res.ResultAs<Data>();
            MessageBox.Show("updated....");
        }