コード例 #1
0
        internal static void ShowTotalSumm()
        {
            string Name = "";
            int    Id   = 0;
            string str  = "Итого: " + AlohaTSClass.GetCurentCheckSumm().ToString("0.00") + " руб." + Environment.NewLine;

            if (AlohaTSClass.CheckWindow())
            {
                if (AlohaTSClass.AlohaCurentState.CompIsAppled)
                {
                    str += AlohaTSClass.GetCompName(AlohaTSClass.AlohaCurentState.CompId) + Environment.NewLine;
                    str += "Скидка: " + AlohaTSClass.AlohaCurentState.CompSumm.ToString("0.00") + " руб." + Environment.NewLine;

                    if ((AlohaTSClass.AlohaCurentState.CompId > 10) && (AlohaTSClass.AlohaCurentState.CompId < 25))
                    {
                        if (AlohaTSClass.GetManagerDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, out Name, out Id))
                        {
                            if (Id > 0)
                            {
                                str += Id.ToString() + " ";
                            }
                            str += Name;
                        }
                    }
                }
                int P = 0;
                int V = 0;

                string PreCard = AlohaTSClass.GetDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, out P, out V);
                if (PreCard.Length > 4)
                {
                    if (PreCard.Substring(0, 3).ToUpper() == "PRE")
                    {
                        str += "Проведена карта друга " + PreCard + Environment.NewLine;
                        str += "Отсталось посещений " + V.ToString() + " Осталось дней: " + P.ToString();
                    }
                }
            }
            AlohaTSClass.ShowMessage(str);
        }
コード例 #2
0
        //}


        internal bool  EmulateLoyaltyCard(string Pref, string Num)
        {
            if ((iniFile.Read("Emulator", Pref.ToUpper()) != null) || (Pref.Length == 5))
            {
                AlohaTSClass.ShowMessage("Распознал карту " + Pref + Num);
                if (AlohaTSClass.AlohaCurentState.CompIsAppled)
                {
                    AlohaTSClass.ShowMessage("Скидка уже применена");
                    return(true);
                }
                if (AlohaTSClass.AlohaCurentState.PredCheckAndNotManager)
                {
                    AlohaTSClass.ShowMessage("Применить скидку по данному чеку может только менеджер.");
                    return(true);
                }

                string GetRestrPrefiks = "";
                string NewNum          = "";
                if (Pref.Length == 5)
                {
                    GetRestrPrefiks = Pref;
                    NewNum          = Num;
                }
                else
                {
                    Utils.ToLog("Конвертирую карту");
                    GetRestrPrefiks = iniFile.Read("Emulator", Pref.ToUpper());

                    if (iniFile.Read("PrivilegedKey", Pref + Num) == "8")
                    {
                        GetRestrPrefiks = iniFile.Read("Emulator", "VIP50");
                    }

                    if (iniFile.Read("PrivilegedKey", Pref + Num) == "2")
                    {
                        GetRestrPrefiks = iniFile.Read("Emulator", "VIP30");
                    }

                    int z = ToBase.DoVizitAsink(Pref.ToUpper(), Num, AlohainiFile.DepNum, AlohaTSClass.AlohaCurentState.CheckNum,
                                                AlohaTSClass.AlohaCurentState.TerminalId, DateTime.Now);

                    NewNum = ConvertNumTo9Digits(Num);
                }

                string OldDisc = AlohaTSClass.GetDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId);

                if ((OldDisc != "") &&
                    (OldDisc.Replace(" ", "") != (Pref + Num).Replace(" ", "")) &&
                    (Utils.GetDiscountNumByCardSeries(Convert.ToInt32(GetRestrPrefiks)) != 6))
                {
                    Utils.ToCardLog(String.Format("На чек {0} наложен атрибут {1}", AlohaTSClass.AlohaCurentState.CheckId, OldDisc));

                    AlohaTSClass.ShowMessage("Нельзя применить скидку на чек с зарегистрированным посещением. Совсем нельзя. ");
                    return(true);
                }


                MainClass.AssignMember(GetRestrPrefiks + NewNum, GetRestrPrefiks + NewNum);
                return(true);
            }
            return(false);
        }
コード例 #3
0
        static internal bool GetCheckColor(Check Ch)
        {
            FiskInfo Fi = ReadFiskInfo();

            if (!Fi.IsMod)
            {
                return(true);
            }

            if (Ch.Vozvr)
            {
                return(true);
            }

            /*
             * if (Ch.Tender!=   TenderType.Cash)
             * {
             *  return true;
             * }
             */
            if (Ch.HasNonCashPayment())
            {
                return(true);
            }

            if ((Ch.TableNumber >= 200) && (Ch.TableNumber <= 240))
            {
                return(true);// FoodFox
            }


            //Shtrih.RegisterNumber = 241;
            // Shtrih.GetCashReg();


            decimal CurentShtrihCash = 5000;

            if (!iniFile.FiskalDriverNonShtrih)
            {
                try
                {
                    Utils.ToLog("CurentShtrihCash S");
                    CurentShtrihCash = Shtrih2.GetCashReg(241);
                    Utils.ToLog("CurentShtrihCash E");
                }
                catch (Exception e)
                {
                    Utils.ToCardLog("[Error] CurentShtrihCash " + e.Message);
                }
            }


            if (CurentShtrihCash < 5000)
            {
                return(true);
            }
            foreach (Dish D in Ch.Dishez)
            {
                if (AlohaTSClass.DishIsTort(D.BarCode))
                {
                    return(true);
                }
            }

            /*
             * if (Ch.CompId != 0)
             * {
             *  return true;
             * }
             */
            if ((Ch.CompId == 8) || (Ch.CompId == 53))
            {
                return(true);
            }


            try
            {
                if (AlohaTSClass.GetVip(Ch.AlohaCheckNum))
                {
                    Utils.ToCardLog("VIP");
                    return(true);
                }
            }
            catch
            {
            }

            try
            {
                int    P     = 0;
                int    V     = 0;
                string DCard = AlohaTSClass.GetDiscountAttr((int)Ch.AlohaCheckNum, out P, out V);
                if (DCard.Length > 4)
                {
                    if (DCard.Substring(0, 3).ToUpper() == "ZAV")
                    {
                        try
                        {
                            string n   = DCard.Substring(3);
                            int    num = Convert.ToInt32(n);
                            if (SuperCardsZAV.Contains(num))
                            {
                                Utils.ToCardLog("card");
                                return(true);
                            }
                        }
                        catch
                        {
                        }
                    }
                }
            }
            catch
            { }

            if (VerifyCheckPercent())
            {
                Utils.ToLog("Hamster");
                return(true);
            }

            /*
             * if (RegWorker.GetRegModType() == 3) //Азарика
             * {
             *  Utils.ToCardLog("ModType3");
             *  if ((DateTime.Now.Hour >= 8) && (DateTime.Now.Hour < 22))
             *
             *  //&& (DateTime.Now.DayOfWeek != DayOfWeek.Saturday) && (DateTime.Now.DayOfWeek != DayOfWeek.Sunday))
             *  {
             *      int P = 0;
             *      int V = 0;
             *      string DCard = AlohaTSClass.GetDiscountAttr((int)Ch.AlohaCheckNum, out P, out V);
             *      if (DCard.Length > 4)
             *      {
             *          if ((DCard.Substring(0, 3).ToUpper() == "ZAV") || (DCard.Substring(0, 3).ToUpper() == "VIP"))
             *          {
             *              return false;
             *          }
             *          else if (Ch.CompId == 2)
             *          {
             *              return false;
             *          }
             *          else
             *          {
             *              return true;
             *          }
             *
             *      }
             *      else if (Ch.CompId == 2)
             *      {
             *          return false;
             *      }
             *      else
             *      {
             *          return true;
             *      }
             *  }
             * }
             *
             */


            if (RegWorker.GetRegModType() == 2)
            {
                if ((DateTime.Now.Hour >= 8) && (DateTime.Now.Hour < 22))

                //&& (DateTime.Now.DayOfWeek != DayOfWeek.Saturday) && (DateTime.Now.DayOfWeek != DayOfWeek.Sunday))
                {
                    Utils.ToCardLog("ModType2");
                    int    P     = 0;
                    int    V     = 0;
                    string DCard = AlohaTSClass.GetDiscountAttr((int)Ch.AlohaCheckNum, out P, out V);
                    if (DCard.Length > 4)
                    {
                        if ((DCard.Substring(0, 3).ToUpper() == "ZAV") || (DCard.Substring(0, 3).ToUpper() == "VIP"))
                        {
                            return(false);
                        }
                        else if (Ch.CompId == 2)
                        {
                            return(false);
                        }
                        else
                        {
                            return(true);
                        }
                    }
                    else if (Ch.CompId == 2)
                    {
                        return(false);
                    }
                    else if (Ch.Summ > 2500)
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
            //else
            {
                if ((Ch.CompId == 6) || (Ch.CompId == 54)) //с собой
                {
                    return(false);
                }

                DateTime dt2 = DateTime.Now;
                //  dt2 = AlohaTime(Ch.OpenTimeStr);
                if (dt2 > DateTime.Now)
                {
                    dt2.AddDays(-1);
                }


                if ((Ch.CheckTimeLong < Fi.MaxLong) && (Ch.CheckTimeLong > Fi.MinLong))
                {
                    if ((Ch.Summ < Fi.BigSum) && (Ch.Summ > Fi.LowSum))
                    {
                        //if (Ch.CompId == 0)
                        {
                            Random R = new Random();
                            if (R.Next(1, 100) > Fi.HiPercent)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }

            return(false);
        }