Exemple #1
0
        public static void SendCurentChk()
        {
            Check chk = AlohaTSClass.GetCurentCheck();

            if (chk.Dishez.Any(d => d.BarCode == IdItem))
            {
                string messageIdStr = chk.Dishez.First(d => d.BarCode == IdItem).Name;
                if (!string.IsNullOrWhiteSpace(messageIdStr))
                {
                    if (messageIdStr.IndexOf(':') > -1)
                    {
                        string idStr = new string(messageIdStr.Substring(messageIdStr.IndexOf(':')).Where(c => char.IsDigit(c)).ToArray());

                        if (!string.IsNullOrWhiteSpace(idStr))
                        {
                            long id = long.Parse(idStr);

                            if (id > 0)
                            {
                                var customer = AuthWithoutWindow(id);

                                if (customer != null && customer.Auth)
                                {
                                    ShowInfohWnd(chk, customer);
                                }
                                else
                                {
                                    AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                                    ShowAuthWnd(chk);
                                }
                            }
                            else
                            {
                                AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                                ShowAuthWnd(chk);
                            }
                        }
                        else
                        {
                            AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                            ShowAuthWnd(chk);
                        }
                    }
                    else
                    {
                        AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                        ShowAuthWnd(chk);
                    }
                }
                else
                {
                    AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                    ShowAuthWnd(chk);
                }
            }
            else
            {
                ShowAuthWnd(chk);
            }
        }