예제 #1
0
        public static ClassSync.Discount.DiscountCards getDiscount(string codebar)
        {
            ClassSync.Discount.DiscountCards dc = ClassSync.Discount.DiscountCards.OneDiscountCards(codebar);

            if (dc == null)
            {
                new ClassFunctuon().showMessageSB("La carte n'existe pas ou il y a peut-être des problèmes avec l'Internet");
            }
            else
            {
                if (dc.active)
                {
                    client.barcode = codebar;
                    client.points  = dc.points;
                    client.InfoClients_customerId = dc.InfoClients_custumerId;
                    client.procent     = 0.0m;
                    client.lastDateUpd = dc.DateTimeLastAddProduct;

                    new ClassFunctuon().writeToatl();
                }

                else
                {
                    new ClassFunctuon().showMessageSB(" La carte est bloquée ");
                }
            }
            return(dc);
        }
예제 #2
0
        public static bool setDiscountPoint(string codebar, int points, bool set)
        {
            ClassSync.Discount.DiscountCards dc = ClassSync.Discount.DiscountCards.OneDiscountCards(codebar);

            if (dc != null)
            {
                if (points >= ClassDiscounts.client.maxPoints)
                {
                    points = ClassDiscounts.client.maxPoints;
                }

                dc.points = set ? points : dc.points;

                if (set)
                {
                    return(ClassSync.Discount.DiscountCards.upd(dc) > 0 ? true : false);
                }
            }
            return(false);
        }
예제 #3
0
        private void ebarcode_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                ClassSync.Discount.DiscountCards d = ClassSync.Discount.DiscountCards.OneDiscountCards(ebarcode.Text);

                ClassSync.Discount.InfoClients ic = ClassDiscounts.getInfClt(d.InfoClients_custumerId);
                if (ic != null)
                {
                    lTypeClient.Content    = ic.TypeClient;
                    lName.Content          = ic.Name;
                    lSurname.Content       = ic.Surname;
                    lNameCompany.Content   = ic.NameCompany;
                    lSIRET.Content         = ic.SIRET;
                    lFRTVA.Content         = ic.FRTVA;
                    lOfficeAddress.Content = ic.OfficeAddress;
                    lOfficeZipCode.Content = ic.OfficeZipCode;
                    lOfficeCity.Content    = ic.OfficeCity;
                    lHomeAddress.Content   = ic.HomeAddress;
                    lHomeZipCode.Content   = ic.HomeZipCode;
                    lHomeCity.Content      = ic.HomeCity;
                    lTelephone.Content     = ic.Telephone;
                    lMail.Content          = ic.Mail;
                    lnumberCard.Content    = ic.DiscountCards.First().numberCard;
                    lpoints.Content        = ic.DiscountCards.First().points;
                    lActive.Content        = ic.DiscountCards.First().active;
                }
                else
                {
                    foreach (Label la in ClassETC_fun.FindVisualChildren <Label>(this))
                    {
                        la.Content = "Не найден";
                    }
                }
                ebarcode.Text = "";
            }
        }