Exemple #1
0
        private void Profile_Load(object sender, EventArgs e)
        {
            LoginCustomer customerprofile = LoginCustomer.getInstance();

            string[] profile = customerprofile.customer.printCustomerDetails();
            lblName.Text              = profile[0];
            lblLastname.Text          = profile[1];
            lblEmail.Text             = profile[2];
            lblPhone.Text             = profile[3];
            lblcartnumberprof.Visible = false;
            lblcartnumber.Visible     = false;

            Random rnd         = new Random();
            float  ordernumber = rnd.Next(10000, 90000);

            lblOrderNumber.Text = "" + ordernumber;
            lblAmount.Text      = "" + Home.shopCart.PaymentAmount;
            lblPaymentType.Text = "" + Home.shopCart.PaymentType;
            if (Home.shopCart.PaymentType == "Credit Card")
            {
                lblcartnumberprof.Visible = true;
                lblcartnumber.Visible     = true;
                lblnname.Text             = Home.shopCart.CreditCartName;
                lblnnumber.Text           = Home.shopCart.CreditCardnumber;
            }
        }
Exemple #2
0
 public static LoginCustomer getInstance()
 {
     if (instance == null)
     {
         instance = new LoginCustomer();
     }
     return(instance);
 }
Exemple #3
0
        public string[] printCustomerDetails()
        {
            LoginCustomer CustomerProfile = LoginCustomer.getInstance();
            Customer      csm             = CustomerProfile.customer;

            string[] CustomerDetailList = { csm.CustomerName1, csm.CustomerLastname1, csm.CustomerEmail1, csm.CustomerPhonenumber1, csm.customerPassword1 };
            return(CustomerDetailList);
        }
        private void Profile_Load(object sender, EventArgs e)
        {
            LoginCustomer customerprofile = LoginCustomer.getInstance();

            string[] profile = customerprofile.customer.printCustomerDetails();
            lblName.Text     = profile[0];
            lblLastname.Text = profile[1];
            lblEmail.Text    = profile[2];
            lblPhone.Text    = profile[3];
            label5.Visible   = false;
            if (Payment.rtnpay() == true)
            {
                label5.Visible = true;
            }
        }
 public static void Savelog(string btnname)
 {
     try
     {
         LoginCustomer logcustomer = LoginCustomer.getInstance();
         FileStream    logfile     = new FileStream([email protected] + @"\\Log.txt", FileMode.Append, FileAccess.Write);
         StreamWriter  writer      = new StreamWriter(logfile);
         writer.Write(logcustomer.customer.CustomerName1 + "   " + btnname + "  " + DateTime.Now.ToString() + Environment.NewLine);
         writer.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
        private void Profile_Load(object sender, EventArgs e)
        {
            LoginCustomer customerprofile = LoginCustomer.getInstance();

            string[] profile = customerprofile.customer.printCustomerDetails();
            lblName.Text     = profile[0];
            lblLastname.Text = profile[1];
            lblEmail.Text    = profile[2];
            lblPhone.Text    = profile[3];

            Random rnd         = new Random();
            float  ordernumber = rnd.Next(10000, 90000);

            lblOrderNumber.Text = "" + ordernumber;
            lblAmount.Text      = "" + Home.shopCart.PaymentAmount;
            lblPaymentType.Text = "" + Home.shopCart.PaymentType;
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            ArrayList allrecord = customerlist.ReadXML();
            bool      success   = false;

            foreach (Customer item in allrecord)
            {
                if (txtMail.Text == item.CustomerName1 && txtPassword.Text == item.customerPassword1)
                {
                    success = true;
                    LoginCustomer logincustomer = LoginCustomer.getInstance();
                    logincustomer.customer = item;
                    break;
                }
            }
            if (success == true)
            {
                this.Hide();
                Home         signin = new Home();
                DialogResult dr     = signin.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    this.ShowDialog();
                }
                else
                {
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("E-mail or password is wrong\nTry Again Please!");
            }
            string buttonname = "Login";

            SaveLog.Savelog(buttonname);
        }