Beispiel #1
0
        public static elm[,] gridCurrencyPath_get_path(ClassSync.TypesPayDB tp)
        {
            elm[,] r = new elm[12, 12];

            foreach (elm[,] elm in gridCurrencyPath)
            {
                if ((elm[0, 0] != null) && (elm[0, 0].path == System.AppDomain.CurrentDomain.BaseDirectory + @"\Data\" + tp.Id + ".xml"))
                {
                    r = elm;
                }
            }
            return(r);
        }
Beispiel #2
0
 public static void pay(ClassSync.TypesPayDB typesPay, decimal money)
 {
     x.Element("MoneySum").Add(new XElement("pay",
                                            new XAttribute("typesPayName", typesPay.Name),
                                            new XAttribute("typesPayCodeCompta", typesPay.CodeCompta),
                                            new XAttribute("typesPayEtat", typesPay.Etat),
                                            new XAttribute("typesPayNameCourt", typesPay.NameCourt),
                                            new XAttribute("typesPayRendu_Avoir", typesPay.Rendu_Avoir),
                                            new XAttribute("typesPayTiroir", typesPay.Tiroir),
                                            new XAttribute("typesPayCurMod", typesPay.CurMod),
                                            new XAttribute("typesPayId", typesPay.Id),
                                            new XAttribute("money", money)));
 }
Beispiel #3
0
        public static decimal getMoneyFromType(ClassSync.TypesPayDB typesPay)
        {
            if (x != null)
            {
                List <XElement> elms = x.Element("MoneySum").Elements("pay").Where(l => int.Parse(l.Attribute("typesPayId").Value) == typesPay.Id).ToList();

                decimal r = 0.0m;

                foreach (XElement e in elms)
                {
                    r += decimal.Parse(e.Attribute("money").Value.Replace(".", ","));
                }

                return(r);
            }
            return(-0.0001m);
        }
Beispiel #4
0
        public static List <count_Currency> transform(decimal d, ClassSync.TypesPayDB typePay)
        {
            List <count_Currency> r = new List <count_Currency>();

            List <ClassSync.Currency> lc = ClassSync.Currency.List_Currency.Where(l => l.TypesPayId == typePay.Id).ToList();

            lc.Sort((x, y) => decimal.Compare(-x.Currency_money, -y.Currency_money));

            List <ClassSync.Currency> lb = new List <ClassSync.Currency> ();



            foreach (ClassSync.Currency c in lc)
            {
                while (d >= 0)
                {
                    d = d - c.Currency_money;
                    if (d >= 0)
                    {
                        count_Currency countCurrency = new count_Currency();
                        countCurrency.count    = 1;
                        countCurrency.currency = c;
                        r.Add(countCurrency);
                    }
                    else
                    {
                        d = d + c.Currency_money;

                        break;
                    }
                }
            }



            return(r);
        }
Beispiel #5
0
 public localTypesPay(ClassSync.TypesPayDB type, decimal value)
 {
     this.type  = type;
     this.value = value;
 }
Beispiel #6
0
 public Pays(ClassSync.TypesPayDB type, decimal money)
 {
     this.type  = type;
     this.money = money;
 }
Beispiel #7
0
 public static ClassSync.TypesPayDB getTypesPayDBFromId(int Id)
 {
     ClassSync.TypesPayDB x = ClassSync.TypesPayDB.t.Where(l => l.Id == Id).SingleOrDefault();
     return(x);
 }
            private List <ClassCheck.localTypesPay> getTypePay(ClassSync.ClassCloseTicket.CloseTicket e)
            {
                List <ClassCheck.localTypesPay> typePay = new List <ClassCheck.localTypesPay>();
                string st = "";

                if (e.PayCash > 0)
                {
                    st = "Cash";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayCash);
                    typePay.Add(ltp);
                }



                if (e.PayBankCards > 0)
                {
                    st = "BankCards";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayBankCards);
                    typePay.Add(ltp);
                }

                if (e.PayBankChecks > 0)
                {
                    st = "BankChecks";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayBankChecks);
                    typePay.Add(ltp);
                }

                if (e.PayResto > 0)
                {
                    st = "Resto";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayResto);
                    typePay.Add(ltp);
                }

                if (e.Pay1 > 0)
                {
                    ClassSync.TypesPayDB tp = new ClassSync.TypesPayDB();
                    st = "1";
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay1);
                    typePay.Add(ltp);
                }
                if (e.Pay2 > 0)
                {
                    st = "2";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay2);
                    typePay.Add(ltp);
                }
                if (e.Pay3 > 0)
                {
                    st = "3";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay3);
                    typePay.Add(ltp);
                }
                if (e.Pay4 > 0)
                {
                    st = "4";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay4);
                    typePay.Add(ltp);
                }
                if (e.Pay5 > 0)
                {
                    st = "5";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay5);
                    typePay.Add(ltp);
                }
                if (e.Pay6 > 0)
                {
                    st = "6";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay6);
                    typePay.Add(ltp);
                }
                if (e.Pay7 > 0)
                {
                    st = "7";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay7);
                    typePay.Add(ltp);
                }
                if (e.Pay8 > 0)
                {
                    st = "8";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay8);
                    typePay.Add(ltp);
                }

                if (e.Pay9 > 0)
                {
                    st = "9";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay9);
                    typePay.Add(ltp);
                }
                if (e.Pay10 > 0)
                {
                    st = "10";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay10);
                    typePay.Add(ltp);
                }
                if (e.Pay11 > 0)
                {
                    st = "11";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay11);
                    typePay.Add(ltp);
                }
                if (e.Pay12 > 0)
                {
                    st = "12";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay12);
                    typePay.Add(ltp);
                }
                if (e.Pay13 > 0)
                {
                    st = "13";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay13);
                    typePay.Add(ltp);
                }
                if (e.Pay14 > 0)
                {
                    st = "14";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay14);
                    typePay.Add(ltp);
                }
                if (e.Pay15 > 0)
                {
                    st = "15";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay15);
                    typePay.Add(ltp);
                }
                if (e.Pay16 > 0)
                {
                    st = "16";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay16);
                    typePay.Add(ltp);
                }
                if (e.Pay17 > 0)
                {
                    st = "17";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay17);
                    typePay.Add(ltp);
                }
                if (e.Pay18 > 0)
                {
                    st = "18";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay18);
                    typePay.Add(ltp);
                }
                if (e.Pay19 > 0)
                {
                    st = "19";
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay19);
                    typePay.Add(ltp);
                }
                if (e.Pay20 > 0)
                {
                    st = "20";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay20);
                    typePay.Add(ltp);
                }
                return(typePay);
            }
            private List <ClassCheck.localTypesPay> getTypePay(ClassSync.ClassCloseTicket.CloseTicketG e)
            {
                List <ClassCheck.localTypesPay> typePay = new List <ClassCheck.localTypesPay>();
                string st = "";

                if (e.PayCash > 0)
                {
                    st = "Cash";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayCash ?? 0.0m);
                    typePay.Add(ltp);
                }



                if (e.PayBankCards > 0)
                {
                    st = "BankCards";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayBankCards ?? 0.0m);
                    typePay.Add(ltp);
                }

                if (e.PayBankChecks > 0)
                {
                    st = "BankChecks";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayBankChecks ?? 0.0m);
                    typePay.Add(ltp);
                }

                if (e.PayResto > 0)
                {
                    st = "Resto";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.PayResto ?? 0.0m);
                    typePay.Add(ltp);
                }

                if (e.Pay1 > 0)
                {
                    ClassSync.TypesPayDB tp = new ClassSync.TypesPayDB();
                    st = "1";
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay1 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay2 > 0)
                {
                    st = "2";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay2 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay3 > 0)
                {
                    st = "3";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay3 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay4 > 0)
                {
                    st = "4";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay4 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay5 > 0)
                {
                    st = "5";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay5 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay6 > 0)
                {
                    st = "6";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay6 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay7 > 0)
                {
                    st = "7";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay7 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay8 > 0)
                {
                    st = "8";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay8 ?? 0.0m);
                    typePay.Add(ltp);
                }

                if (e.Pay9 > 0)
                {
                    st = "9";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay9 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay10 > 0)
                {
                    st = "10";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay10 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay11 > 0)
                {
                    st = "11";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay11 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay12 > 0)
                {
                    st = "12";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay12 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay13 > 0)
                {
                    st = "13";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay13 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay14 > 0)
                {
                    st = "14";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay14 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay15 > 0)
                {
                    st = "15";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay15 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay16 > 0)
                {
                    st = "16";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay16 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay17 > 0)
                {
                    st = "17";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay17 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay18 > 0)
                {
                    st = "18";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay18 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay19 > 0)
                {
                    st = "19";
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay19 ?? 0.0m);
                    typePay.Add(ltp);
                }
                if (e.Pay20 > 0)
                {
                    st = "20";
                    ClassSync.TypesPayDB     tp  = new ClassSync.TypesPayDB();
                    ClassSync.TypesPayDB     t   = ClassSync.TypesPayDB.t.Find(l => l.NameCourt == st);
                    ClassCheck.localTypesPay ltp = new ClassCheck.localTypesPay(t, e.Pay20 ?? 0.0m);
                    typePay.Add(ltp);
                }
                return(typePay);
            }