当前位置: 首页>>代码示例>>C#>>正文


C# DataAccess.GetReportOutgoes方法代码示例

本文整理汇总了C#中bycar.DataAccess.GetReportOutgoes方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.GetReportOutgoes方法的具体用法?C# DataAccess.GetReportOutgoes怎么用?C# DataAccess.GetReportOutgoes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bycar.DataAccess的用法示例。


在下文中一共展示了DataAccess.GetReportOutgoes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildReportByOutgo

        private void BuildReportByOutgo()
        {
            if (Outgo == null)
                return;
            try
            {
                ReportDocument reportDocument = new ReportDocument();

                StreamReader reader = new StreamReader(new FileStream(@"Templates\SalesCheckReport.xaml", FileMode.Open, FileAccess.Read));
                reportDocument.XamlData = reader.ReadToEnd();
                reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
                reader.Close();

                ReportData data = new ReportData();
                decimal ts = 0;
                decimal vs = 0;
                decimal asum = 0;
                DataAccess da = new DataAccess();
                string BCC = da.getBasicCurrencyCode();

                //Income.currencyReference.Load();
                //string CCC = Income.currency.code;

                // Таблица ТОВАРЫ В НАКЛАДНОЙ
                DataTable dt = new DataTable("mtable");

                // описываем столбцы таблицы
                dt.Columns.Add("SpareName", typeof(string));
                dt.Columns.Add("UnitName", typeof(string));
                dt.Columns.Add("Quantity", typeof(string));
                dt.Columns.Add("Price", typeof(string));
                dt.Columns.Add("Amount", typeof(string));
                dt.Columns.Add("VAT", typeof(string));
                dt.Columns.Add("VATAmount", typeof(string));
                dt.Columns.Add("Total", typeof(string));
                decimal TotalAmount = 0;

                // забиваем таблицу данными
                List<ReportOutgo> list = new List<ReportOutgo>();
                list = da.GetReportOutgoes(SpareOutgoId);

                List<SpareInSpareOutgoView> LIST2 = da.SpareInSpareOutgoViewGet(SpareOutgoId);
                try
                {
                    string CompanyName = da.getProfileCurrent().CompanyName;
                    for (int i = 0; i < LIST2.Count; i++)
                    {
                        //decimal Total = list[i].total_sum;
                        //decimal VatSum = Total * list[i].VatRate.Value / 100;
                        //decimal Sum = Total - VatSum;
                        //decimal Price = Sum / list[i].quantity;
                        TotalAmount += list[i].quantity * list[i].PriceOut.Value;

                        //ts += Total;
                        //vs += VatSum;
                        //asum += Sum;

                        dt.Rows.Add(new object[] {
                            list[i].SpareName,
                            list[i].UnitName,
                            list[i].quantity.ToString("0.##"),
                            list[i].PriceOut.Value.ToString("0.##"),
                            (list[i].PriceOut.Value*list[i].quantity).ToString("0.##"),
                            list[i].VatName,
                            0,
                            0
                        });
                    }
                }
                catch (Exception exc)
                {
                    throw exc;
                }
                string str_ts = RSDN.RusCurrency.Str(ts, "BYR");
                string str_vs = RSDN.RusCurrency.Str(vs, "BYR");

                // set constant document values
                //string strDate = Outgo.created_on.Value.GetDateTimeFormats('d')[3];
                string strDate = Outgo.created_on.Value.Day.ToString();
                string mnth = "";
                switch (Outgo.created_on.Value.Month)
                {
                    case 1:
                        mnth = "января";
                        break;

                    case 2:
                        mnth = "февраля";
                        break;

                    case 3:
                        mnth = "марта";
                        break;

                    case 4:
                        mnth = "апреля";
                        break;

                    case 5:
                        mnth = "мая";
//.........这里部分代码省略.........
开发者ID:bashlykevich,项目名称:Bycar,代码行数:101,代码来源:ReportViewSalesCheck.xaml.cs

示例2: BuildReportBySale

        private void BuildReportBySale()
        {
            ReportDocument reportDocument = new ReportDocument();

            StreamReader reader = new StreamReader(new FileStream(@"Templates\SalesCheckReport.xaml", FileMode.Open, FileAccess.Read));
            reportDocument.XamlData = reader.ReadToEnd();
            reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Templates\");
            reader.Close();

            ReportData data = new ReportData();
            decimal ts = 0;
            decimal vs = 0;
            decimal asum = 0;
            DataAccess da = new DataAccess();
            string BCC = da.getBasicCurrencyCode();

            // Таблица ТОВАРЫ В НАКЛАДНОЙ
            DataTable dt = new DataTable("mtable");

            // описываем столбцы таблицы
            dt.Columns.Add("SpareName", typeof(string));
            dt.Columns.Add("UnitName", typeof(string));
            dt.Columns.Add("Quantity", typeof(string));
            dt.Columns.Add("Price", typeof(string));
            dt.Columns.Add("Amount", typeof(string));
            dt.Columns.Add("VAT", typeof(string));
            dt.Columns.Add("VATAmount", typeof(string));
            dt.Columns.Add("Total", typeof(string));

            // забиваем таблицу данными

            List<ReportOutgo> listx = new List<ReportOutgo>();
            listx = da.GetReportOutgoes(sale);
            List<ReportItem> list = new List<ReportItem>();
            foreach (ReportOutgo s in listx)
            {
                if (list.FirstOrDefault(x => x.SpareID == s.SpareID) == null)
                {
                    ReportItem ri = new ReportItem();
                    ri.SpareName = s.SpareName;
                    ri.UnitName = s.UnitName;
                    ri.Quantity = s.quantity;
                    ri.total_sum = s.total_sum;
                    ri.VatRate = s.VatRate.Value;
                    ri.VAT = s.VatName;
                    ri.SpareID = s.SpareID;
                    ri.Price = CurrencyHelper.GetPrice("BYR", s.PriceOutBasic.Value);

                    list.Add(ri);
                }
                else
                {
                    list.FirstOrDefault(x => x.SpareID == s.SpareID).Quantity += s.quantity;
                }
            }
            if (list.Count == 0)
                return;

            //SpareOutgoId = list[0].OutgoID;
            //Outgo = da.SpareOutgoGet(SpareOutgoId);
            decimal TotalAmount = 0;
            string CompanyName = da.getProfileCurrent().CompanyName;
            for (int i = 0; i < list.Count; i++)
            {
                //decimal Total = list[i].total_sum;
                //decimal VatSum = Total * list[i].VatRate / 100;
                //decimal Sum = Total - VatSum;
                //decimal Price = Sum / list[i].Quantity;
                TotalAmount += list[i].Quantity * list[i].Price;

                //ts += Total;
                //vs += VatSum;
                //asum += Sum;

                dt.Rows.Add(new object[] {
                            list[i].SpareName,
                            list[i].UnitName,
                            list[i].Quantity.ToString("0.##"),
                            list[i].Price.ToString("0.##"),
                            (list[i].Quantity*list[i].Price).ToString("0.##"),
                            list[i].VAT,
                            0,
                            0
                        });
            }
            string str_ts = RSDN.RusCurrency.Str(ts, "BYR");
            string str_vs = RSDN.RusCurrency.Str(vs, "BYR");

            // set constant document values
            //string strDate = Outgo.created_on.Value.GetDateTimeFormats('d')[3];
            DateTime date = sale.SaleDate;
            string strDate = date.Day.ToString();
            string mnth = "";
            switch (date.Month)
            {
                case 1:
                    mnth = "января";
                    break;

                case 2:
//.........这里部分代码省略.........
开发者ID:bashlykevich,项目名称:Bycar,代码行数:101,代码来源:ReportViewSalesCheck.xaml.cs


注:本文中的bycar.DataAccess.GetReportOutgoes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。