Esempio n. 1
0
        /// <summary>
        /// This function used to compare entered code and verification code.
        /// </summary>
        /// <param name="verificationCode">The verificationCode hold the verication code. </param>
        /// <returns>If the compare is correct, the return value is correct.</returns>
        private bool IsVerify(int verificationCode)
        {
            pnlVerification.Visible = true;
            int enteredCode = int.Parse(mtxtboxVerificationCode.Text);

            if (enteredCode == verificationCode)
            {
                StoreMainScreen.shoppingCards[LoginScreen.shoppingCardIndex].PlaceOrder();
                UtilUpdate.Delete(StoreMainScreen.shoppingCards[LoginScreen.shoppingCardIndex]);
                MessageBox.Show("Your order has been taken.", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
                return(true);
            }
            else
            {
                MessageBox.Show("Please enter code again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// It uses for order's status for shipped.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnShip_Click(object sender, EventArgs e)
        {
            Logger.GetLogger().WriteLog(LoginedCustomer.getInstance().User.Username, btnShip.Text, DateTime.Now);
            DialogResult dr = MessageBox.Show("Are you sure?", "Information",
                                              MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (dr == DialogResult.Cancel)
            {
                return;
            }
            designs[selectedIndex].Card.Status = OrderStatus.shipped;
            designs[selectedIndex].SetStatus   = "Status: Shipped";
            foreach (ShoppingCard order in StoreMainScreen.orderList)
            {
                if (order.OID == designs[selectedIndex].Card.OID)
                {
                    order.Status = OrderStatus.shipped;
                    UtilUpdate.UpdateOrder(order);
                }
            }
            flpOrders.Refresh();
            btnCancel.Enabled = false;
            btnShip.Enabled   = false;
        }