예제 #1
0
        private void btnFindCard_Click(object sender, EventArgs e)
        {
            this.btnFindCard.Enabled = false;
            var service = new CardService();

            try
            {
                this.Card = service.Resolve(birth_date.Value, txtPhone.Text);

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            catch (CardNotFoundException)
            {
                MetroMessageBox.Show(this, "Kartela nuk u gjet", "Gabim", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, ex.Message, "Gabim", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.btnFindCard.Enabled = true;
        }
예제 #2
0
        private void Initialize()
        {
            this.RandomToken = RandomTokenHelper.GenerateToken();
            lblTotal.Text = lblTotalDiscount.Text = sale.Total.ToString("C" + Config.DecimalScale, CultureInfo.GetCultureInfo("de-DE"));
            lblTotal.Text = lblTotalDiscount.Text = sale.Total.ToString("C" + Config.DecimalScale, CultureInfo.GetCultureInfo("de-DE"));

            ICardService service = new CardService();
            this.RedeemRule = service.GetRedeemRule();

            lblMinPoints.Text = this.RedeemRule.MinimumRedeemablePoints.ToString();

            this.txtEmployeeCardBarcode.Text = EmployeeCardStore.Instance.Get();

            if (ExternalRedeem)
            {
                if (this.sale.Redeem.Points > 0)
                {
                    txtRedeemPoints.Text = this.sale.Redeem.Points.ToString();
                    txtRedeemPoints_KeyUp(null, null);
                }
                else if (this.sale.Redeem.Value > 0)
                {
                    txtRedeemValue.Text = this.sale.Redeem.Value.ToString();
                    txtRedeemValue_KeyUp(null, null);
                }

                txtRedeemValue.Enabled = txtRedeemPoints.Enabled = false;
            }

            if (this.DisableCancellation)
            {
                btnSalesCancellation.Visible = false;
            }

            if (sale.Id.HasValue)
            {
                editModeLbl.Visible = true;
            }

            if (!Config.UseEmployeeCard)
            {
                txtEmployeeCardBarcode.Visible = lblEmployeeCard.Visible = roundedPanel14.Visible = false;
            }
            pnlOfflineSales.Visible = metroLabel7.Visible = lblUnsynced.Visible = Config.EnableOfflineAPI;
            btnFinishSale.Enabled = !DisableSale;
        }