예제 #1
0
        public static Invoce[] GetAllInvoces()
        {
            Invoce[] invoces = new Invoce[2];
            invoces[0] = new Invoce
            {
                DeliveryDate           = new DateTime(2019, 10, 08),
                DealDate               = new DateTime(2019, 01, 01),
                DealNumber             = "00031904-ԱՊ",
                VATNumber              = "00031904/1",
                TIN                    = "02507171",
                BuyerBankName          = "ՀՀ ՖՆ Աշխատակազմի գործառնական վարչություն",
                BuyerBankAccountNumber = "900011001931",
                GoodDescription        = "Ապահովագրավճար համաձայն արձանագրություն 8, առ 30.09.2019թ.",
                GoodAmount             = 1,
                PricePerUnit           = 46558888,
                Price                  = 46558888
            };
            invoces[1] = new Invoce
            {
                DeliveryDate           = new DateTime(2019, 11, 08),
                DealDate               = new DateTime(2019, 01, 01),
                DealNumber             = "00031904-ԱՊ",
                VATNumber              = "00031904/1",
                TIN                    = "02507171",
                BuyerBankName          = "ՀՀ ՖՆ Աշխատակազմի գործառնական վարչություն",
                BuyerBankAccountNumber = "900011001931",
                GoodDescription        = "Ապահովագրավճար համաձայն արձանագրություն 8, առ 30.09.2019թ.",
                GoodAmount             = 1,
                PricePerUnit           = 46558888,
                Price                  = 46558888
            };


            return(invoces);
        }
예제 #2
0
        public static void XmlDocCreater()
        {
            /* XDocument xmlDocument = new XDocument(
             *    new XDeclaration("1.0", "utf-8", "yes"),
             *    new XComment("Creating xml tree using linq to xml"),
             *    new XElement("Students",
             *    from invoce in Invoce.GetAllInvoces()
             *    select new XElement("Student", new XAttribute("Id",invoce.Id),
             *     new XElement("Name",invoce.Name),
             *     new XElement("Gender",invoce.Gender),
             *     new XElement("TotalMark",invoce.TotalMark)
             *    )));*/
            XDocument xmlDocument = new XDocument(
                // new XDeclaration("1.0", "utf-8", "yes"),

                new XElement("ExportedAccDocData",
                             new XAttribute("xmlns", ""),
                             from invoce in Invoce.GetAllInvoces()
                             select
                             new XElement("AccountingDocument",

                                          new XAttribute("Version", "1.0"),
                                          new XElement("Type", 3),
                                          #region GeneralInfo
                                          new XElement("GeneralInfo",
                                                       new XElement("EcrReceipt", ""),
                                                       new XElement("DeliveryDate", invoce.DeliveryDate),
                                                       new XElement("Procedure", 1),
                                                       new XElement("DealInfo",
                                                                    new XElement("DealDate", invoce.DealDate),
                                                                    new XElement("DealNumber", invoce.DealNumber)),
                                                       new XElement("AdditionalData", "")),
                                          #endregion
                                          #region SupplierInfo
                                          new XElement("SupplierInfo",
                                                       new XElement("VATNumber", invoce.VATNumber),
                                                       new XElement("Taxpayer",
                                                                    new XElement("TIN", "00031904"),
                                                                    new XElement("Name", "ՆԱԻՐԻ ԻՆՇՈՒՐԱՆՍ ԱՊԱՀՈՎԱԳՐԱԿԱՆ Սահմանափակ պատասխանատվությամբ ընկերություն (ՍՊԸ)"),
                                                                    new XElement("Address", "ԵՐԵՎԱՆ ԿԵՆՏՐՈՆ ԿԵՆՏՐՈՆ ԹԱՂԱՄԱՍ Վ.Սարգսյան 10 110տար"),
                                                                    new XElement("BankAccount",
                                                                                 new XElement("BankName", "Ամերիաբանկ ՓԲԸ"),
                                                                                 new XElement("BankAccountNumber", "1570001164650300")))),
                                          #endregion
                                          #region BuyerInfo
                                          new XElement("BuyerInfo",
                                                       new XElement("Taxpayer",
                                                                    new XElement("TIN", invoce.TIN),
                                                                    new XElement("Name", ""),
                                                                    new XElement("Address", ""),
                                                                    new XElement("BankAccount",
                                                                                 new XElement("BankName", invoce.BuyerBankName),
                                                                                 new XElement("BankAccountNumber", invoce.BuyerBankAccountNumber)),
                                                                    new XElement("TinNotRequired", "false"))),
                                          #endregion
                                          #region GoodsInfo
                                          new XElement("GoodsInfo", new XElement("Good",
                                                                                 new XElement("Description", invoce.GoodDescription),
                                                                                 new XElement("Unit", "դրամ"),
                                                                                 new XElement("Amount", invoce.GoodAmount),
                                                                                 new XElement("PricePerUnit", invoce.PricePerUnit),
                                                                                 new XElement("Price", invoce.Price),
                                                                                 new XElement("TotalPrice", invoce.Price)),
                                                       new XElement("Total",
                                                                    new XElement("TotalPrice", invoce.Price)
                                                                    ))
                                          #endregion
                                          )));

            xmlDocument.Save(@"C:\Users\edgar.martirosyan\Desktop\testing\booksfree.xml");
            MessageBox.Show("xml ֆայլը պահպանված է");
        }