コード例 #1
0
 private void 修改地址_Click(object sender, EventArgs e)
 {
     if (!this.City.Enabled)
     {
         this.修改地址.Text        = "確認修改";
         this.City.Enabled     = true;
         this.MYRegion.Enabled = true;
         this.Address.Enabled  = true;
     }
     else
     {
         string R = this.MYRegion.SelectedValue.ToString();
         string A = this.Address.Text;
         if (Cls_JA_Member.UpdateAddress(R, A))
         {
             MessageBox.Show("修改成功");
             this.修改地址.Text        = "修改";
             this.Address.Enabled  = false;
             this.City.Enabled     = false;
             this.MYRegion.Enabled = false;
         }
         else
         {
             MessageBox.Show("修改失敗");
         }
     }
 }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            User data = Cls_JA_Member.UserDetail();

            if (FileName != null)
            {
                if (data.PhotoID != 1)
                {
                    if (Cls_JA_Member.UserUppic(FileName))
                    {
                        MessageBox.Show("上傳成功"); FileName = "";
                    }
                    else
                    {
                        MessageBox.Show("上傳失敗");
                    }
                }
                else
                {
                    if (Cls_JA_Member.UpLoadPic(FileName))
                    {
                        MessageBox.Show("新增成功");
                    }
                    else
                    {
                        MessageBox.Show("上傳失敗");
                    }
                }
            }
        }
コード例 #3
0
 //登入
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (Cls_JA_Member.VaildateUser(this.jA_Input5.輸入塊字串, this.jA_Input6.輸入塊字串))
         {
             this.Hide();
             MessageBox.Show("成功");
             JA_FancyMain fancyMain = new JA_FancyMain();
             fancyMain.FormClosing += (s, ee) =>
             {
                 this.Show();
             };
             fancyMain.Show();
         }
         else
         {
             this.jA_Input5.Focus();
             this.jA_Input5.輸入塊字串 = this.jA_Input6.輸入塊字串 = "";
             this.jA_Input5.警告    = System.Drawing.Color.FromArgb(244, 67, 54);
             this.jA_Input6.警告    = System.Drawing.Color.FromArgb(244, 67, 54);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (_OrderStatus == "開立")
     {
         if (MessageBox.Show("你確定要取消訂單嗎", "提醒你", MessageBoxButtons.YesNo,
                             MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             if (Cls_JA_Member.CancelOrder((Int32)this.Tag))
             {
                 this.OrderStatus.Text      = "取消";
                 this.OrderStatus.BackColor = Color.FromArgb(244, 67, 54);
                 _Status = Status.取消;
                 MessageBox.Show("取消成功");
             }
             else
             {
                 MessageBox.Show("取消出現問題,可能無法取消。");
             }
         }
     }
     else
     {
         MessageBox.Show("此訂單已無法取消。");
     }
 }
コード例 #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (Cls_JA_Member.RemoveFavorite((int)this.Tag))
     {
         Timer t = new Timer();
         t.Interval = 10;
         t.Start();
         int i = 0;
         t.Tick += (s, ee) =>
         {
             if (i != 600)
             {
                 i += 30;
                 this.panel3.Left += 30;
             }
             else
             {
                 t.Stop();
                 i = 0;
                 if (移除我的最愛成功 != null)
                 {
                     移除我的最愛成功();
                 }
                 t.Dispose();
             }
         };
     }
     else
     {
         return;
     }
 }
コード例 #6
0
ファイル: JA_ChangPW.cs プロジェクト: ewingtsui/Fancy
 private void B_更改密碼_Click(object sender, EventArgs e)
 {
     if (Cls_JA_Member.VaildateUser(jA_Input1.輸入塊字串, jA_Input2.輸入塊字串))
     {
         this.新密碼_P.Visible = true;
         this.timer1.Start();
         int i = 0;
         this.timer1.Tick += delegate
         {
             if (i <= 350)
             {
                 i += 10;
                 this.驗證舊密碼_P.Left -= 10;
                 this.新密碼_P.Top    -= 10;
             }
             else
             {
                 i = 0;
                 this.驗證舊密碼_P.Visible = false;
                 this.timer1.Stop();
             }
         };
     }
     else
     {
         MessageBox.Show("資料錯誤");
     };
 }
コード例 #7
0
 private void button11_Click(object sender, EventArgs e)
 {
     if (Cls_JA_Member.ForgotPassword(this.jA_Input7.輸入塊字串, this.jA_Input8.輸入塊字串))
     {
         MessageBox.Show("新密碼成功寄出");
         this.timer3.Enabled  = true;
         this.jA_Input7.輸入塊字串 = this.jA_Input8.輸入塊字串 = "";
     }
     else
     {
         MessageBox.Show("資料錯誤");
     }
 }
コード例 #8
0
ファイル: JA_ChangPW.cs プロジェクト: ewingtsui/Fancy
 private void 驗證碼_B_Click(object sender, EventArgs e)
 {
     if (Cls_JA_Member.CheckAuthCode(this.jA_Input4.輸入塊字串))
     {
         Cls_JA_Member.UpdatePassword(this.jA_Input3.輸入塊字串, this.jA_Input1.輸入塊字串);
         MessageBox.Show("更改成功,請重新登入");
         if (密碼更改成功 != null)
         {
             密碼更改成功();
             this.Close();
         }
     }
 }
コード例 #9
0
ファイル: JA_ChangPW.cs プロジェクト: ewingtsui/Fancy
        async private void 新密碼_B_Click(object sender, EventArgs e)
        {
            try
            {
                this.新密碼_B.Enabled  = false;
                this.label1.Visible = true;
                Timer t1 = new Timer();
                int   i  = 0;
                t1.Interval = 500;
                t1.Start();
                t1.Tick += delegate
                {
                    if (i != 3)
                    {
                        this.label1.Text += ".";
                        i++;
                    }
                    else
                    {
                        i = 0;
                        this.label1.Visible = false;
                        t1.Stop();
                    }
                };
                await Task.Run(() => Cls_JA_Member.SendAuthCode(this.jA_Input3.輸入塊字串, this.jA_Input1.輸入塊字串));

                this.驗證碼_P.Visible = true;
                Timer t = new Timer();
                t.Interval = 10;
                t.Start();
                t.Tick += delegate
                {
                    if (i <= 350)
                    {
                        i += 10;
                        this.新密碼_P.Left -= 10;
                        this.驗證碼_P.Top  -= 10;
                    }
                    else
                    {
                        i = 0;
                        this.新密碼_P.Visible = false;
                        t.Stop();
                    }
                };
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #10
0
        //註冊
        private void button8_Click(object sender, EventArgs e)
        {
            foreach (var item in SingUp_panel.Controls)
            {
                if (item is JA_Input)
                {
                    if (((JA_Input)item).輸入塊字串.Trim() == "")
                    {
                        MessageBox.Show("欄位不可空百");
                        return;
                    }
                }
            }
            if (!Cls_JA_IDo.IsValidEmail(this.jA_Input3.輸入塊字串))
            {
                this.jA_Input3.警告 = System.Drawing.Color.FromArgb(244, 67, 54);
                return;
            }
            if (!Cls_JA_IDo.IsValidPhone(this.jA_Input4.輸入塊字串))
            {
                this.jA_Input4.警告 = System.Drawing.Color.FromArgb(244, 67, 54);
                return;
            }
            string guid    = Guid.NewGuid().ToString("N");
            User   newuser = new User
            {
                UserName         = this.jA_Input1.輸入塊字串,
                UserPassword     = Cls_JA_IDo.HashPw(this.jA_Input2.輸入塊字串, guid),
                GUID             = guid,
                Email            = this.jA_Input3.輸入塊字串,
                Phone            = this.jA_Input4.輸入塊字串,
                RegionID         = 1,
                Address          = "",
                RegistrationDate = DateTime.Now,
                Enabled          = true,
                Gender           = this.Gender.SelectedItem.ToString().Equals("男")
            };

            try
            {
                if (Cls_JA_Member.Register(newuser))
                {
                    MessageBox.Show("成功");
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.Message);
            }
        }
コード例 #11
0
        public JA_FancyMain()
        {
            Cls_JA_Member.IsAdmin = Cls_JA_Member.UserDetail().Admin;
            Thread t = new Thread(new ThreadStart(delegate
            {
                JA_Loading loading = new JA_Loading();

                Application.Run(loading);
            }));

            t.Start();

            Thread.Sleep(2000);
            InitializeComponent();

            if (Cls_JA_Member.IsAdmin)
            {
                button10.Visible = true;
            }
        }
コード例 #12
0
 private void 修改手機_Click(object sender, EventArgs e)
 {
     if (!this.Phone.Enabled)
     {
         this.修改手機.Text     = "確認修改";
         this.Phone.Enabled = true;
     }
     else
     {
         if (Cls_JA_Member.UpdatePhone(this.Phone.Text))
         {
             MessageBox.Show("修改成功");
             this.修改手機.Text     = "修改";
             this.Phone.Enabled = false;
         }
         else
         {
             MessageBox.Show("修改失敗");
         }
     }
 }
コード例 #13
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (button2.Text != "")
            {
                JA_QuestionList list = new JA_QuestionList
                {
                    問題   = textBox1.Text,
                    回答   = "",
                    創建時間 = DateTime.Now
                };
                Question Newquestion = new Question
                {
                    OrderID    = this.OrderID,
                    UserID     = Cls_JA_Member.UserID,
                    Question1  = textBox1.Text,
                    CreateDate = DateTime.Now
                };

                Cls_JA_Member.AddQuestion(OrderID, Newquestion);
                this.flowLayoutPanel2.Controls.Add(list);
                this.flowLayoutPanel2.ScrollControlIntoView(list);
            }
        }