예제 #1
0
 public RealizationTime()
 {
     db              = new ReportDataContext();
     dataInDataGrid  = new List <DataInDataGrid>();
     timeAssignments = new List <TimeAssignmentComboBox>();
     drivers         = new List <kierowca>();
 }
예제 #2
0
        public ReportDataContext <TModel> AddDataContext <TModel>(TModel model)
        {
            var dataContext = new ReportDataContext <TModel>(this.document, this.Settings, model);

            this.DataContexts.Add(dataContext);
            return(dataContext);
        }
예제 #3
0
 public TrailAssignment(int LineNumber, int TrailNumber, string DayType)
 {
     this.DayType     = DayType;
     this.LineNumber  = LineNumber;
     this.TrailNumber = TrailNumber;
     db = new ReportDataContext();
 }
예제 #4
0
 public AddTrail(int lineNumber, int trailNumber)
 {
     dc = new ReportDataContext();
     this.lineNumber  = lineNumber;
     this.trailNumber = trailNumber;
     GetTrailFromDb();
 }
        public IActionResult Report(long Id)
        {
            var db     = new ReportDataContext();
            var report = db.Reports.SingleOrDefault(x => x.Id == Id);

            return(View(report));
        }
예제 #6
0
        public static RelatedListBrowser[] GetChildBrowsers(ReportDataContext dataContext, object dataSource, string parentDataMember, string childDataMember)
        {
            if (childDataMember.Length <= parentDataMember.Length)
            {
                return(new RelatedListBrowser[0]);
            }

            var r = new List <RelatedListBrowser>();

            RelatedListBrowser relatedListBrowser;
            var i = parentDataMember.Length;

            while (true)
            {
                i = childDataMember.IndexOf('.', i + 1);
                if (i == -1)
                {
                    break;
                }
                relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember.Substring(0, i), false) as RelatedListBrowser;
                if (relatedListBrowser != null)
                {
                    r.Add(relatedListBrowser);
                }
            }

            relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember, false) as RelatedListBrowser;
            if (relatedListBrowser != null)
            {
                r.Add(relatedListBrowser);
            }

            return(r.ToArray());
        }
예제 #7
0
 private void btnSearch_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(txtUniqueCode.Text))
     {
         MessageBox.Show("请先输入待查询的唯一码");
         return;
     }
     gvDatas.ItemsSource = ReportDataContext.GetUniqueCodeTransTrack(txtUniqueCode.Text.Trim());
 }
예제 #8
0
 private void RadGridView1_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
 {
     if (e.DetailsElement != null && e.Visibility == Visibility.Visible)
     {
         var item = (BillGoodReturnForSearch)e.Row.Item;
         var gv   = (RadGridView)e.DetailsElement;
         gv.ItemsSource = ReportDataContext.SearchBillDetails <BillGoodReturnDetails>(item.ID);
     }
 }
 private void RadGridView1_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
 {
     if (e.DetailsElement != null && e.Visibility == Visibility.Visible)
     {
         var gv   = (RadGridView)e.DetailsElement;
         var item = (StocktakeSearchEntity)e.Row.Item;
         gv.ItemsSource = ReportDataContext.GetBillStocktakeDetails(item.BillID);
     }
 }
        public ActionResult ViewImportDetails(string accountnumber)
        {
            using (var db = new ReportDataContext())
            {
                var reportdata = db.Report.Where(x => x.AccountNumber == accountnumber).ToList();


                return(PartialView("~/Views/Partials/Details.cshtml", reportdata));
            }
        }
        public ActionResult ViewImports()
        {
            using (var db = new ReportDataContext())
            {
                var viewModel = new ViewImportData();

                var reportdata = db.Report.ToList();
                var masterGrid = reportdata.GroupBy(x => x.AccountNumber).Select(y => y.First()).ToList();

                viewModel.MasterGrid = masterGrid;

                return(PartialView("~/Views/Partials/ViewImports.cshtml", viewModel));
            }
        }
예제 #12
0
 private void RadGridView1_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
 {
     if (e.DetailsElement != null && e.Visibility == Visibility.Visible)
     {
         var gv      = (RadGridView)e.DetailsElement;
         var item    = (ContrastSearchEntity)e.Row.Item;
         var details = ReportDataContext.GetBillStocktakeContrastDetails(item.ID);
         //if (_fpHelper == null)
         //    _fpHelper = new FloatPriceHelper();
         //foreach (var d in details)
         //{
         //    d.Price = _fpHelper.GetFloatPrice(VMGlobal.CurrentUser.OrganizationID, d.ProductID);
         //}
         gv.ItemsSource = details;
     }
 }
예제 #13
0
        private DataGroupInfo?GetCurrentDataGroup(ReportDataContext dataContext, Band runningBand)
        {
            if (dataContext == null)
            {
                throw new ArgumentNullException(nameof(dataContext));
            }
            if (runningBand == null)
            {
                throw new ArgumentNullException(nameof(runningBand));
            }

            var closestMember = runningBand as XtraReportBase ?? runningBand.GetParentBoundReportBand();
            var browser       = (ListBrowser)dataContext.GetDataBrowser(closestMember.DataSource, closestMember.DataMember, true);

            if (browser == null)
            {
                return(null);
            }

            var groupBand = runningBand as GroupBand;

            if (groupBand != null)
            {
                var groupRowLevel = DataGroupingUtils.GetGroupRowLevel((SortedListController)browser.ListController, groupBand.Level);
                if (groupRowLevel != null)
                {
                    return(new DataGroupInfo(
                               closestMember.DataSource,
                               closestMember.DataMember,
                               browser,
                               browser.List,
                               DataGroupingUtils.GetGroupInfo(browser, groupRowLevel.Value, browser.Position)));
                }
                runningBand = closestMember;
            }

            var detailBand = runningBand as XtraReportBase;

            if (detailBand != null)
            {
                return(new DataGroupInfo(closestMember.DataSource, closestMember.DataMember, browser, browser.List, null));
            }

            throw new InvalidOperationException($"Running band '{runningBand.Name}' cannot be used for immediate mode grouping. Calculated field {Name} must choose a {nameof(GroupBand)} or a {nameof(DetailReportBand)}.");
        }
예제 #14
0
 private void RadGridView1_RowDetailsVisibilityChanged(object sender, GridViewRowDetailsEventArgs e)
 {
     if (e.DetailsElement != null)
     {
         var gv      = (RadGridView)e.DetailsElement;
         var item    = (StoreOutSearchEntity)e.Row.Item;
         var details = ReportDataContext.SearchBillDetails <BillStoreOutDetails>(item.ID);
         if (_fpHelper == null)
         {
             _fpHelper = new FloatPriceHelper();
         }
         foreach (var d in details)
         {
             d.Price = _fpHelper.GetFloatPrice(VMGlobal.CurrentUser.OrganizationID, d.BYQID, d.Price);
         }
         gv.ItemsSource = details;
     }
 }
        public ActionResult Report()
        {
            using (var db = new ReportDataContext()) {
                var reportdata = db.Report.ToList();

                var groupedItems = reportdata.GroupBy(x => new { x.BranchCode, x.AccountType, x.Status }).ToList();

                var viewModel = groupedItems.Select(groupedItem => new ImportReportData
                {
                    AccountType = groupedItem.Key.AccountType,
                    BranchCode  = groupedItem.Key.BranchCode,
                    Status      = groupedItem.Key.Status,
                    Count       = groupedItem.Count(),
                    Amount      = groupedItem.Sum(x => decimal.Parse(x.Amount, NumberStyles.Any, new CultureInfo("en-US"))).ToString(CultureInfo.InvariantCulture)
                })
                                .OrderBy(x => x.BranchCode).ToList();

                return(PartialView("~/Views/Partials/Report.cshtml", viewModel));
            }
        }
예제 #16
0
 private void RadGridView1_RowDetailsVisibilityChanged(object sender, GridViewRowDetailsEventArgs e)
 {
     if (e.DetailsElement != null)
     {
         var gv      = (RadGridView)e.DetailsElement;
         var item    = e.Row.Item;
         var proBill = item.GetType().GetProperty("BillID");
         var billID  = (int)proBill.GetValue(item, null);
         var details = ReportDataContext.SearchBillDetails <BillStoringDetails>(billID);
         if (_fpHelper == null)
         {
             _fpHelper = new FloatPriceHelper();
         }
         foreach (var d in details)
         {
             d.Price = _fpHelper.GetFloatPrice(VMGlobal.CurrentUser.OrganizationID, d.BYQID, d.Price);
         }
         gv.ItemsSource = details;
     }
 }
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            if (cbxStorage.SelectedIndex == -1)
            {
                cbxStorage.Focus();
                MessageBox.Show("请选择盘点仓库");
                return;
            }
            var filters = new CompositeFilterDescriptorCollection();

            //filters.AddRange(billFilter.FilterDescriptors.ToList());
            filters.Add(billFilter.FilterDescriptors);
            int storageID = (int)cbxStorage.SelectedValue;

            filters.Add(new FilterDescriptor("StorageID", FilterOperator.IsEqualTo, cbxStorage.SelectedValue));
            filters.Add(new FilterDescriptor("Status", FilterOperator.IsEqualTo, false));

            var data   = ReportDataContext.AggregateStocktakeForStockUpdate(filters, out _refrenceStocktakeIDs);
            var pids   = data.Select(o => o.ProductID);
            var stocks = VMGlobal.DistributionQuery.LinqOP.Search <Stock>(o => o.StorageID == storageID && pids.Contains(o.ProductID)).ToList();
            var result = data.Select(o =>
            {
                var d = new StocktakeAggregationEntityForStockUpdate
                {
                    BrandID     = o.BrandID,
                    BrandCode   = o.BrandCode,
                    ColorCode   = o.ColorCode,
                    ProductCode = o.ProductCode,
                    ProductID   = o.ProductID,
                    Quantity    = o.Quantity,
                    SizeCode    = o.SizeCode,
                    SizeName    = o.SizeName,
                    StyleCode   = o.StyleCode
                };
                var stock       = stocks.FirstOrDefault(s => s.ProductID == o.ProductID);
                d.StockQuantity = (stock == null ? 0 : stock.Quantity);
                return(d);
            }).ToList();

            RadGridView1.ItemsSource = result;
        }
        public static RelatedListBrowser[] GetChildBrowsers(ReportDataContext dataContext, object dataSource, string parentDataMember, string childDataMember)
        {
            if (string.IsNullOrEmpty(parentDataMember)) throw new ArgumentException("Parent data member must not be null or empty.", nameof(parentDataMember));
            if (childDataMember.Length <= parentDataMember.Length) return new RelatedListBrowser[0];

            var r = new List<RelatedListBrowser>();

            RelatedListBrowser relatedListBrowser;
            var i = parentDataMember.Length;
            while (true)
            {
                i = childDataMember.IndexOf('.', i + 1);
                if (i == -1) break;
                relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember.Substring(0, i), false) as RelatedListBrowser;
                if (relatedListBrowser != null) r.Add(relatedListBrowser);
            }

            relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember, false) as RelatedListBrowser;
            if (relatedListBrowser != null) r.Add(relatedListBrowser);

            return r.ToArray();
        }
        public static RelatedListBrowser[] GetChildBrowsers(ReportDataContext dataContext, object dataSource, string parentDataMember, string childDataMember)
        {
            if (string.IsNullOrEmpty(parentDataMember))
            {
                throw new ArgumentException("Parent data member must not be null or empty.", nameof(parentDataMember));
            }
            if (childDataMember.Length <= parentDataMember.Length)
            {
                return(new RelatedListBrowser[0]);
            }

            var r = new List <RelatedListBrowser>();

            RelatedListBrowser relatedListBrowser;
            var i = parentDataMember.Length;

            while (true)
            {
                i = childDataMember.IndexOf('.', i + 1);
                if (i == -1)
                {
                    break;
                }
                relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember.Substring(0, i), false) as RelatedListBrowser;
                if (relatedListBrowser != null)
                {
                    r.Add(relatedListBrowser);
                }
            }

            relatedListBrowser = dataContext.GetDataBrowser(dataSource, childDataMember, false) as RelatedListBrowser;
            if (relatedListBrowser != null)
            {
                r.Add(relatedListBrowser);
            }

            return(r.ToArray());
        }
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            RadGridView1.ItemsSource = null;
            while (RadGridView1.Columns.Count > 5)
            {
                RadGridView1.Columns.RemoveAt(5);
            }
            var       data  = ReportDataContext.AggregateStoreMove(billFilter.FilterDescriptors);
            DataTable table = new DataTable();

            table.Columns.Add(new DataColumn("ProductCode", typeof(string)));
            table.Columns.Add(new DataColumn("BrandCode", typeof(string)));
            table.Columns.Add(new DataColumn("StyleCode", typeof(string)));
            table.Columns.Add(new DataColumn("ColorCode", typeof(string)));
            table.Columns.Add(new DataColumn("SizeName", typeof(string)));
            var snames = ReportDataContext.Storages.Select(o => o.Name).ToList();

            foreach (var sn in snames)
            {
                table.Columns.Add(new DataColumn(sn, typeof(int)));
                table.Columns.Add(new DataColumn("movein" + sn, typeof(int)));
                var col = new telerik::GridViewDataColumn()
                {
                    Header = sn, UniqueName = sn, DataMemberBinding = new Binding(sn)
                };
                col.AggregateFunctions.Add(new StoreMoveTotalFunction(sn)
                {
                    Caption = "出入合计:", ResultFormatString = "{0}"
                });
                //内存中动态生成一个XAML,描述了一个DataTemplate
                XNamespace ns    = "http://schemas.microsoft.com/winfx/2006/xaml/presentation";
                XElement   xGrid = new XElement(ns + "Grid");
                xGrid.Add(
                    new XElement(ns + "TextBlock",
                                 new XElement(ns + "TextBlock", new XAttribute("Text", "{Binding Path=" + sn + "}")),
                                 new XElement(ns + "TextBlock", new XAttribute("Text", " - "), new XAttribute("Foreground", "Red")),
                                 new XElement(ns + "TextBlock", new XAttribute("Text", "{Binding Path=" + "movein" + sn + "}"))));
                XElement xDataTemplate = new XElement(ns + "DataTemplate", new XAttribute("xmlns", "http://schemas.microsoft.com/winfx/2006/xaml/presentation"));
                xDataTemplate.Add(xGrid);
                XmlReader    xr           = xDataTemplate.CreateReader();
                DataTemplate dataTemplate = XamlReader.Load(xr) as DataTemplate;
                col.CellTemplate = dataTemplate;
                RadGridView1.Columns.Add(col);
            }
            var ps = data.OrderBy(o => o.ProductCode).Select(o => o.ProductID).Distinct();

            foreach (var p in ps)
            {
                var     d   = data.First(o => o.ProductID == p);
                DataRow row = table.NewRow();
                table.Rows.Add(row);
                row["ProductCode"] = d.ProductCode;
                row["BrandCode"]   = d.BrandCode;
                row["StyleCode"]   = d.StyleCode;
                row["ColorCode"]   = d.ColorCode;
                row["SizeName"]    = d.SizeName;
                foreach (var sn in snames)
                {
                    var ds = data.FindAll(o => o.ProductID == p && o.OutStorageName == sn);
                    if (ds != null && ds.Count > 0)
                    {
                        row[sn] = ds.Sum(o => o.Quantity);
                    }
                    else
                    {
                        row[sn] = 0;
                    }
                    ds = data.FindAll(o => o.ProductID == p && o.InStorageName == sn);
                    if (ds != null && ds.Count > 0)
                    {
                        row["movein" + sn] = ds.Sum(o => o.Quantity);
                    }
                    else
                    {
                        row["movein" + sn] = 0;
                    }
                }
            }
            RadGridView1.ItemsSource = table.DefaultView;
        }
예제 #21
0
 public ApplicationUser()
 {
     dc = new ReportDataContext();
 }
예제 #22
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            var data = ReportDataContext.AggregateSelfGoodReturn(billFilter.FilterDescriptors);

            RadGridView1.ItemsSource = data;
        }
예제 #23
0
 public TrailRealization()
 {
     db = new ReportDataContext();
 }
예제 #24
0
 public StatusChange()
 {
     dc       = new ReportDataContext();
     drivers  = new List <string>();
     vehicles = new List <string>();
 }
예제 #25
0
 public DayType()
 {
     dc = new ReportDataContext();
 }
예제 #26
0
 public ReportController(ReportDataContext dataContext)
 {
     _dataContext = dataContext;
 }
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            var data = ReportDataContext.AggregateSubordinateCannibalize(billFilter.FilterDescriptors);

            RadGridView1.ItemsSource = data;
        }
예제 #28
0
 public SharedView()
 {
     db = new ReportDataContext();
 }
예제 #29
0
 public AddingLine()
 {
     dc = new ReportDataContext();
 }
예제 #30
0
 public AddingDrivers()
 {
     dc = new ReportDataContext();
 }
 private void btnSearch_Click(object sender, RoutedEventArgs e)
 {
     RadGridView1.ItemsSource = ReportDataContext.GetOtherShopStock(billFilter.FilterDescriptors);
 }