public Inventory2Model(PinhuaContext pinhuaContext, IMapper mapper) { _pinhuaContext = pinhuaContext; _mapper = mapper; }
public AttendanceService(PinhuaContext pinhuaContext, EastRiverContext eastRiverContext) { _pinhuaContext = pinhuaContext; _eastRiverContext = eastRiverContext; }
public IndexModel(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
public HomeController(Entities.Pinhua.PinhuaContext pinhuaContext) { this.pinhuaContext = pinhuaContext; this.WeixinOptions = pinhuaContext.WeixinOptions.FirstOrDefault(); this.ClockOptions = pinhuaContext.WeixinClockOptions.FirstOrDefault(); }
public EditModel(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
public EditModel(PinhuaContext pinhuaContext, IMapper mapper) { _pinhuaContext = pinhuaContext; _mapper = mapper; }
protected override void OnInitialized() { dropdownOptions = PinhuaContext.DropdownOptions_客户(); main.日期 = DateTime.Now; }
public DetailsModel(EastRiverContext eastRiverContext, PinhuaContext pinhuaContext) { _eastRiverContext = eastRiverContext; _pinhuaContext = pinhuaContext; }
protected override void OnInitialized() { DataSource = PinhuaContext.GetViews().报表.销售订单待发(); }
public DetailsOldModel(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
protected override void OnInitialized() { mainsTableDataSource = Mapper.ProjectTo <dto采购申请>(PinhuaContext.GetViews().采购.采购申请()).ToList(); }
public PinhuaImageController(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
public CreateModel(PinhuaContext pinhuaContext, IMapper mapper) { _pinhuaContext = pinhuaContext; _mapper = mapper; }
protected override void OnInitialized() { main = Mapper.Map <dto付款单>(PinhuaContext.GetViews().采购.采购付款(RecordId)); detailsTableDataSource = Mapper.ProjectTo <dto付款单D>(PinhuaContext.GetViews().采购.采购付款D(RecordId)).ToList(); }
protected override void OnInitialized() { main = Mapper.Map <dto商品>(PinhuaContext.GetViews().基础.商品(RecordId)); }
public DeleteModel(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
public DetailsModel(PinhuaContext pinhuaContext, IMapper mapper) { _pinhuaContext = pinhuaContext; _mapper = mapper; }
protected void ValidSubmit(EditContext context) { using (var transaction = PinhuaContext.Database.BeginTransaction()) { var affected = new List <string>(); var bEdit = PinhuaContext.TryRecordEdit <dto销售订单, tb_订单表>(main, adding => { // 非空字段赋值给跟踪实体 adding.业务类型 = base.category; adding.往来 = PinhuaContext.Set <tb_往来表>().FirstOrDefault(p => p.往来号 == adding.往来号)?.简称; }); if (bEdit) { Action <dto销售订单D> Adding = item => { if (string.IsNullOrWhiteSpace(item.子单号)) // 子单号为空的,表示新插入 { item.子单号 = PinhuaContext.funcAutoCode("子单号"); } else // 子单号不为空,表示从报价单引入,插入 { affected.Add(item.子单号); var baojiaD = PinhuaContext.Set <tb_报价表D>().FirstOrDefault(d => d.子单号 == item.子单号); if (baojiaD != null) { baojiaD.状态 = "已下单"; } } }; Action <dto销售订单D> Updating = item => { affected.Add(item.子单号); var baojiaD = PinhuaContext.Set <tb_报价表D>().FirstOrDefault(d => d.子单号 == item.子单号); if (baojiaD != null) { baojiaD.状态 = "已下单"; } }; Action <tb_订单表D> Deleting = item => { affected.Add(item.子单号); var tb_报价D = PinhuaContext.Set <tb_报价表D>().FirstOrDefault(d => d.子单号 == item.子单号); if (tb_报价D != null) { tb_报价D.状态 = ""; } }; var bEdit2 = PinhuaContext.TryRecordDetailsEdit <dto销售订单, dto销售订单D, tb_订单表, tb_订单表D>(main, detailsTableDataSource, Adding, Updating, Deleting ); if (bEdit2) { var mains = from m in PinhuaContext.tb_报价表 join d in PinhuaContext.tb_报价表D on m.RecordId equals d.RecordId where affected.Contains(d.子单号) select m; foreach (var m in mains) { var bRet = PinhuaContext.tb_报价表D.Where(d => d.RecordId == m.RecordId).Any(d => d.状态.Contains("已")); if (bRet) { m.LockStatus = 1; } else { m.LockStatus = 0; } } ; PinhuaContext.SaveChanges(); transaction.Commit(); } } Navigation.NavigateTo(routeA); } }
static public IEnumerable <产品型号清单> GetModelNames(this PinhuaContext _pinhuaContext) { var list = _pinhuaContext.产品型号清单.AsNoTracking().Where(p => !p.编号.StartsWith("DZ")).OrderBy(p => p.排序).ThenBy(p => p.编号).ToList(); return(list); }
public CreateModel(PinhuaContext pinhuaContext, IMapper mapper, ILogger <CreateModel> logger) { _pinhuaContext = pinhuaContext; _mapper = mapper; _logger = logger; }
static public IEnumerable <InventoryDto> GetInventory(this PinhuaContext _pinhuaContext) { // 库存盘点日期 var latestDate = (from w in _pinhuaContext.Warehouse join i in (from p in _pinhuaContext.InventoryCount group p by p.仓库编号 into g select new { 仓库编号 = g.Key, 盘点日期 = new DateTime?(g.Max(p => p.盘点日期)) }).ToList() on w.Id equals i.仓库编号 into itmp from i in itmp.DefaultIfEmpty() select new { 仓库编号 = w.Id, 盘点日期 = i.盘点日期 ?? new DateTime(1900, 1, 1) }).ToList(); // 库存盘点 var inventory = from m in _pinhuaContext.InventoryCount join md in _pinhuaContext.InventoryCountDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on new { m.盘点日期, m.仓库编号 } equals new { c.盘点日期, c.仓库编号 } select new { Warehouse = m.仓库编号, ModelNumber = md.型号编号, ModelName = md.型号名称, Description = md.描述, Specification = md.规格, Length = md.长, Width = md.宽, Height = md.高, Qty = md.数量, }; // 出库单,对应仓库库存减少 var stockout = from m in _pinhuaContext.StockOutMain join md in _pinhuaContext.StockOutDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseFrom equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseFrom, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, Qty = -md.Qty, }; // 入库单,对应仓库库存增多 var stockin = from m in _pinhuaContext.StockInMain join md in _pinhuaContext.StockInDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseTo equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseTo, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, md.Qty, }; // 转仓单,转出仓库库存减少 var stocktransfer_out = from m in _pinhuaContext.StockTransferMain join md in _pinhuaContext.StockTransferDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseTo equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseFrom, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, Qty = -md.Qty, }; // 转仓单,转入仓库库存增加 var stocktransfer_in = from m in _pinhuaContext.StockTransferMain join md in _pinhuaContext.StockTransferDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseTo equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseTo, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, Qty = md.Qty, }; // 外协加工单,转出仓库库存减少 var stocksubconctracting_in = from m in _pinhuaContext.StockSubconctractingMain join md in _pinhuaContext.StockSubconctractingDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseTo equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseFrom, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, Qty = -md.Qty, }; // 外协加工单,转入仓库库存增加 var stocksubconctracting_out = from m in _pinhuaContext.StockSubconctractingMain join md in _pinhuaContext.StockSubconctractingDetails on m.ExcelServerRcid equals md.ExcelServerRcid join c in latestDate on m.WarehouseTo equals c.仓库编号 where m.OrderDate > c.盘点日期 select new { Warehouse = m.WarehouseTo, md.ModelNumber, md.ModelName, md.Description, md.Specification, md.Length, md.Width, md.Height, Qty = md.Qty, }; var all = from p in inventory.Union(stockout).Union(stockin).Union(stocktransfer_out).Union(stocktransfer_in).Union(stocksubconctracting_out).Union(stocksubconctracting_in).ToList() orderby p.Warehouse, p.ModelNumber group p by new { p.Warehouse, p.ModelNumber, p.ModelName, p.Description, p.Specification, p.Length, p.Width, p.Height, } into g select new InventoryDto { Warehouse = g.Key.Warehouse, ModelNumber = g.Key.ModelNumber, ModelName = g.Key.ModelName, Description = g.Key.Description, Specification = g.Key.Specification, Length = g.Key.Length, Width = g.Key.Width, Height = g.Key.Height, Qty = g.Sum(p => p.Qty) }; return(all); }
public YiJiaModel(PinhuaContext pinhuaContext) { CustomerId = "KH-1304-001"; _pinhuaContext = pinhuaContext; }
/// <summary> /// 获取当天打卡计划 /// </summary> /// <param name="context"></param> /// <returns></returns> public static WeixinWorkPlan GetCurrentClockPlan(this PinhuaContext context) { var plan = context.WeixinWorkPlan.AsNoTracking().Where(p => p.Id == 1).FirstOrDefault(); return(plan); }
protected override void OnInitialized() { main = Mapper.Map <dto采购申请>(PinhuaContext.GetViews().采购.采购申请().FirstOrDefault(m => m.RecordId == RecordId)); detailsTableDataSource = Mapper.ProjectTo <dto采购申请D>(PinhuaContext.GetViews().采购.采购申请D(RecordId)).ToList(); }
protected override void OnInitialized() { main = Mapper.Map <dto采购询价>(PinhuaContext.GetViews().采购.采购询价().FirstOrDefault(m => m.RecordId == RecordId)); detailsTableDataSource = Mapper.ProjectTo <dto采购询价D>(PinhuaContext.GetViews().采购.采购询价D(RecordId)).ToList(); dropdownOptions = PinhuaContext.DropdownOptions_客户(); }
public SearchModel(PinhuaContext pinhuaContext) { _pinhuaContext = pinhuaContext; }
protected override void OnInitialized() { products = Mapper.ProjectTo <dto采购申请>(PinhuaContext.GetViews().采购.采购申请()).ToList(); base.OnInitialized(); }