Example #1
0
        public static void PrintCloseTicket(Guid ticketWindowG)
        {
            var closeTicketGs = RepositoryCloseTicketG.Get(ticketWindowG);

            if (closeTicketGs.Count == 1)
            {
                var closeTicket = RepositoryCloseTicket.GetByCloseTicketGId(closeTicketGs.First().CustomerId);
                PrintService.PrintCloseTicketG(closeTicketGs.First(), closeTicket);
            }
            else
            {
                RepositoryCloseTicketG.Mess += "Ошибка печати, " + closeTicketGs.Count + " записей в БД";
            }
        }
Example #2
0
 public WgHistory()
 {
     InitializeComponent();
     list.DataContext = RepositoryCloseTicketG.Get(Guid.Empty);
 }
Example #3
0
 public WAllHistory()
 {
     InitializeComponent();
     TableCloseTicketGs.DataContext = RepositoryCloseTicketG.Get(Guid.Empty).Where(l => l.EstablishmentCustomerId == Global.Config.IdEstablishment);
 }
Example #4
0
        private static bool CloseOpenTicketWindows()
        {
            RepositoryOpenTicketWindow.Sync(false);

            var openTicketWindows = RepositoryOpenTicketWindow.OpenTicketWindows.FindAll(otw => otw.IsOpen && (otw.IdTicketWindowG == GlobalVar.TicketWindowG));
            var flag = false;

            if (openTicketWindows.Count == 0)
            {
                var closeTicketG = RepositoryCloseTicketG.Get(GlobalVar.TicketWindowG).FirstOrDefault();
                RepositoryGeneral.Mess += Config.NameTicket + Environment.NewLine;

                if (closeTicketG != null)
                {
                    foreach (var el in RepositoryCloseTicket.GetByCloseTicketGId(GlobalVar.TicketWindowG))
                    {
                        closeTicketG.Pay1          += el.Pay1;
                        closeTicketG.Pay2          += el.Pay2;
                        closeTicketG.Pay3          += el.Pay3;
                        closeTicketG.Pay4          += el.Pay4;
                        closeTicketG.Pay5          += el.Pay5;
                        closeTicketG.Pay6          += el.Pay6;
                        closeTicketG.Pay7          += el.Pay7;
                        closeTicketG.Pay8          += el.Pay8;
                        closeTicketG.Pay9          += el.Pay9;
                        closeTicketG.Pay10         += el.Pay10;
                        closeTicketG.Pay11         += el.Pay11;
                        closeTicketG.Pay12         += el.Pay12;
                        closeTicketG.Pay13         += el.Pay13;
                        closeTicketG.Pay14         += el.Pay14;
                        closeTicketG.Pay15         += el.Pay15;
                        closeTicketG.Pay16         += el.Pay16;
                        closeTicketG.Pay17         += el.Pay17;
                        closeTicketG.Pay18         += el.Pay18;
                        closeTicketG.Pay19         += el.Pay19;
                        closeTicketG.Pay20         += el.Pay20;
                        closeTicketG.PayBankCards  += el.PayBankCards;
                        closeTicketG.PayBankChecks += el.PayBankChecks;
                        closeTicketG.PayCash       += el.PayCash;
                        closeTicketG.PayResto      += el.PayResto;
                    }

                    closeTicketG.DateClose = DateTime.Now;
                    RepositoryCloseTicketG.Update(closeTicketG);
                    flag = true;
                }
                else
                {
                    RepositoryGeneral.Mess += Properties.Resources.LabelErrorClosing + Environment.NewLine;
                }
            }
            else
            {
                foreach (var window in openTicketWindows)
                {
                    RepositoryGeneral.Mess += window.NameTicket + " " + Properties.Resources.LabelOpened.ToLower() + Environment.NewLine;
                }
            }

            return(flag);
        }