コード例 #1
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 ");
            }
        }
コード例 #2
0
 public static bool IsEqual(MyLupaPassword user1, MyLupaPassword user2)
 {
     if (user1 == null || user2 == null)
     {
         return(false);
     }
     if (user1.NamaLengkap != user2.NamaLengkap)
     {
         return(false);
     }
     else if (user1.Email != user2.Email)
     {
         return(false);
     }
     else if (user1.NoTelepon != user2.NoTelepon)
     {
         return(false);
     }
     return(true);
 }