コード例 #1
0
        private List <KeyValuePair <string, string[]> > FillMe()
        {
            List <KeyValuePair <string, string[]> > Data = new List <KeyValuePair <string, string[]> >();

            string[] value = new string[2] {
                "number", Facture.ToString()
            };
            Data.Add(new KeyValuePair <string, string[]>("facture_id", value));
            value = new string[2] {
                "number", Product.ToString()
            };
            Data.Add(new KeyValuePair <string, string[]>("product_id", value));
            if (Size != 0)
            {
                value = new string[2] {
                    "number", Size.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("size_id", value));
            }
            value = new string[2] {
                "number", Quantity.ToString()
            };
            Data.Add(new KeyValuePair <string, string[]>("quantity", value));
            if (Price != null && Currency != null && Price != 0 && Currency != 0)
            {
                value = new string[2] {
                    "number", Price.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("unit_price", value));
                value = new string[2] {
                    "", Currency.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("currency_id", value));
            }
            return(Data);
        }
コード例 #2
0
ファイル: ReceiptModel.cs プロジェクト: moon1234moon/Factures
        private List <KeyValuePair <string, string[]> > FillMe()
        {
            List <KeyValuePair <string, string[]> > Data = new List <KeyValuePair <string, string[]> >();

            string[] value = new string[2] {
                "number", Number.ToString()
            };
            Data.Add(new KeyValuePair <string, string[]>("number", value));
            value = new string[2] {
                "number", Customer.ToString()
            };
            Data.Add(new KeyValuePair <string, string[]>("customer_id", value));
            if (Season != null && Season.ToString() != "0")
            {
                value = new string[2] {
                    "number", Season.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("season_id", value));
            }
            if (Details != null && Details.ToString().Trim() != string.Empty)
            {
                value = new string[2] {
                    "", Details.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("details", value));
            }
            if (Amount.ToString() != string.Empty && Amount.ToString() != "0")
            {
                value = new string[2] {
                    "number", Amount.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("amount", value));
                if (Currency.ToString() != string.Empty && Currency.ToString() != "0")
                {
                    value = new string[2] {
                        "number", Currency.ToString()
                    };
                    Data.Add(new KeyValuePair <string, string[]>("currency_id", value));
                }
            }
            if (Delivery != null && Delivery.ToString().Trim() != string.Empty && Delivery.ToString() != "0")
            {
                value = new string[2] {
                    "", Delivery.ToString().Trim()
                };
                Data.Add(new KeyValuePair <string, string[]>("delivery_date", value));
            }
            if (Facture != null && Facture.ToString() != "0")
            {
                value = new string[2] {
                    "number", Facture.ToString()
                };
                Data.Add(new KeyValuePair <string, string[]>("facture_id", value));
            }
            if (Cheque != null && Cheque.ToString().Trim() != "0")
            {
                value = new string[2] {
                    "", Cheque.ToString().Trim()
                };
                Data.Add(new KeyValuePair <string, string[]>("cheque", value));
            }
            return(Data);
        }