Ejemplo n.º 1
0
        private void FinishBtn_Click(object sender, EventArgs e)
        {
            i++;
            if (data.VerifyPassword(PwBox.Text).Verified)
            {
                panel1.Hide();
                PwBox.Hide();
                FinishBtn.Hide();
                pictureBox1.Hide();
                PwBox.Clear();

                UnlockAll();

                SetView(dashBoard1);
                MoveMark(DashBtn.Location.Y);
            }
            else
            {
                PwBox.ForeColor = Color.Red;
                if (i == 3)
                {
                    FinishBtn.Enabled = false;
                }
            }
        }
Ejemplo n.º 2
0
 private void LockBTN_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     panel1.Show();
     PwBox.Show();
     FinishBtn.Show();
     pictureBox1.Show();
 }
Ejemplo n.º 3
0
 private void BillBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var newEventArgs = new RoutedEventArgs(Button.ClickEvent);
         FinishBtn.RaiseEvent(newEventArgs);
         Hide();
         new BillWindow(ProductsForBill, dBContext, sale).ShowDialog();
         ShowDialog();
     }
     catch (Exception ex)
     {
         log.Error(ex.InnerException);
     }
 }
Ejemplo n.º 4
0
        //872,422
        private void Loading()
        {
            data = new Data();

            videoViewer2.RefreshBtn.PerformClick();
            photoViewer1.RefreshBtn.PerformClick();

            AssignDashBoard();


            panel1.Dock      = DockStyle.Fill;
            pictureBox1.Dock = DockStyle.Fill;
            pictureBox1.BringToFront();
            FinishBtn.BringToFront();
            PwBox.BringToFront();
            FloatBtns.SendToBack();
        }
Ejemplo n.º 5
0
        public void FillEighthPage(string emailCheck, string emailAddress, string securityCheck)
        {
            if (emailCheck.ToLower() == "yes")
            {
                EmailConfirmationCb.Clicks();
            }
            else
            {
            }

            EmailAddress.EnterText("*****@*****.**");
            if (securityCheck.ToLower() == "check")
            {
                NotRebortCb.Clicks();
            }

            // SupportingDocBtn.UploadFile(@"C:\CaseData.xlxs");
            FinishBtn.Clicks();
        }
Ejemplo n.º 6
0
 private void FinishBtn_Click(object sender, EventArgs e)
 {
     i++;
     if (data.VerifyPassword(PwBox.Text).Verified)
     {
         panel1.Hide();
         PwBox.Hide();
         FinishBtn.Hide();
         pictureBox1.Hide();
         PwBox.Clear();
     }
     else
     {
         PwBox.ForeColor = Color.Red;
         if (i == 3)
         {
             FinishBtn.Enabled = false;
         }
     }
 }
Ejemplo n.º 7
0
        private void AddBtn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                CheckoutProductViewModel viewModel;
                var textBoxContent = CodeAndQuantityTxt.Text;
                //Добавяне на продукт
                if (Regex.Match(textBoxContent, @"^\d+\*{1}\d+$").Success&& textBoxContent != "*+")
                {
                    var  splittedText = textBoxContent.Split('*').ToList();
                    bool n            = false;
                    foreach (var text in splittedText)
                    {
                        if (String.IsNullOrEmpty(text))
                        {
                            n = true;
                        }
                    }
                    if (!n)
                    {
                        var itemIdOrBarcode = 0;
                        int length          = (int)(Math.Log10(int.MaxValue) + 1);

                        if (splittedText[1].Length < length)
                        {
                            itemIdOrBarcode = int.Parse(splittedText[1]);
                        }

                        var item = dBContext.Products.AsNoTracking().FirstOrDefault(p => p.Id == itemIdOrBarcode || p.Barcode == splittedText[1]);
                        if (item == null || item.IsDeleted)
                        {
                            SystemSounds.Hand.Play();
                            MessageBox.Show($"Няма такъв продукт с id/barcode {itemIdOrBarcode}!");
                            throw new Exception($"Няма такъв продукт с id/barcode {itemIdOrBarcode}!");
                        }
                        var itemQuantity = decimal.Parse(splittedText[0]);
                        totalPrice = item.Price * itemQuantity;
                        viewModel  = new CheckoutProductViewModel()
                        {
                            Barcode    = item.Barcode,
                            Id         = item.Id,
                            Measure    = item.Measure,
                            Name       = item.Name,
                            Price      = item.Price,
                            Quantity   = itemQuantity,
                            TotalPrice = totalPrice
                        };

                        Products.Add(item);
                        ProductsList.Add(viewModel);
                        ProductsListGrid.ItemsSource = ProductsList;

                        totalPrice = ProductsList.Sum(x => x.TotalPrice);

                        TotalPriceTxt.Text = totalPrice.ToString();
                        log.Info($"Product {viewModel.Name} with quantity {viewModel.Quantity} added to the bill.");
                    }
                    else
                    {
                        SystemSounds.Hand.Play();
                    }
                }
                //Изтриване на последен добавен продукт
                else if (textBoxContent == "--")
                {
                    var newEventArgs = new RoutedEventArgs(Button.ClickEvent);
                    ClearLastBtn.RaiseEvent(newEventArgs);
                }
                //Завършване на продажба
                else if (textBoxContent == "*+")
                {
                    var newEventArgs = new RoutedEventArgs(Button.ClickEvent);
                    FinishBtn.RaiseEvent(newEventArgs);
                }
                //Дневен отчет
                else if (textBoxContent == "/////")
                {
                    DailyFile.SaveDailyFile();
                }
                else if (textBoxContent == "*+*")
                {
                    var newEventArgs = new RoutedEventArgs(Button.ClickEvent);
                    BillBtn.RaiseEvent(newEventArgs);
                }
                else
                {
                    SystemSounds.Hand.Play();
                }
            }
            catch (Exception ex)
            {
                log.Error(ex.InnerException);
            }
            finally
            {
                CodeAndQuantityTxt.Text = string.Empty;
            }
        }