public RealizationTime() { db = new ReportDataContext(); dataInDataGrid = new List <DataInDataGrid>(); timeAssignments = new List <TimeAssignmentComboBox>(); drivers = new List <kierowca>(); }
public ReportDataContext <TModel> AddDataContext <TModel>(TModel model) { var dataContext = new ReportDataContext <TModel>(this.document, this.Settings, model); this.DataContexts.Add(dataContext); return(dataContext); }
public TrailAssignment(int LineNumber, int TrailNumber, string DayType) { this.DayType = DayType; this.LineNumber = LineNumber; this.TrailNumber = TrailNumber; db = new ReportDataContext(); }
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)); }
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()); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(txtUniqueCode.Text)) { MessageBox.Show("请先输入待查询的唯一码"); return; } gvDatas.ItemsSource = ReportDataContext.GetUniqueCodeTransTrack(txtUniqueCode.Text.Trim()); }
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)); } }
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; } }
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)}."); }
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)); } }
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; }
public ApplicationUser() { dc = new ReportDataContext(); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { var data = ReportDataContext.AggregateSelfGoodReturn(billFilter.FilterDescriptors); RadGridView1.ItemsSource = data; }
public TrailRealization() { db = new ReportDataContext(); }
public StatusChange() { dc = new ReportDataContext(); drivers = new List <string>(); vehicles = new List <string>(); }
public DayType() { dc = new ReportDataContext(); }
public ReportController(ReportDataContext dataContext) { _dataContext = dataContext; }
private void btnSearch_Click(object sender, RoutedEventArgs e) { var data = ReportDataContext.AggregateSubordinateCannibalize(billFilter.FilterDescriptors); RadGridView1.ItemsSource = data; }
public SharedView() { db = new ReportDataContext(); }
public AddingLine() { dc = new ReportDataContext(); }
public AddingDrivers() { dc = new ReportDataContext(); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { RadGridView1.ItemsSource = ReportDataContext.GetOtherShopStock(billFilter.FilterDescriptors); }