Esempio n. 1
0
        private void btn_seller_update_Click(object sender, EventArgs e)
        {
            Seller seller = new Seller();

            seller.SetId(Seller.activeSeller);
            seller.SetName(txtb_username.Text);
            seller.SetPassword(DbSeller.get_seller_data_from_id(Seller.activeSeller).GetPassword()); //bu aşamada parola güncellensin istemiyoruz eski parolayı tekrar yazdırıyorum.
            seller.SetTelephone_number(maskedTxtb_telephone.Text);
            seller.SetCompany_name(txtb_companyname.Text);
            seller.SetAddress(richTxtb_address.Text);
            seller.SetImage(pictureBox_seller.ImageLocation);

            DialogResult dialog = MessageBox.Show("Update changed fields.", "Okey", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialog == DialogResult.Yes)
            {
                if (string.IsNullOrEmpty(seller.GetName()) || string.IsNullOrEmpty(seller.GetPassword()))
                {
                    MessageBox.Show("Username field is required. ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    DbSeller.UpdateSeller(seller);
                }
            }
        }
Esempio n. 2
0
 private void fill_user_data(Seller seller)
 {
     txtb_username.Text              = seller.GetName();
     txtb_companyname.Text           = seller.GetCompany_name();
     maskedTxtb_telephone.Text       = seller.GetTelephone_number();
     richTxtb_address.Text           = seller.GetAdress();
     lbl_joindate.Text               = seller.GetJoin_date().ToString();
     pictureBox_seller.ImageLocation = seller.GetImage();
 }
Esempio n. 3
0
 private bool form_is_valid(Seller seller)
 {
     if (!seller.GetPassword().Equals(txtb_ss_Confirmpassword.Text)) //parolarlar eşit mi
     {
         MessageBox.Show("Passwords is not same!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
     if (string.IsNullOrEmpty(seller.GetName()))
     {
         MessageBox.Show("Username field is required. ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
     return(true);
 }