private void OnMakeEntryOrder() { // Where need to save new entry order var wherePath = Service.GetDirectory(); if (wherePath != null) { // Put data to model var entryOrder = new EntryOrder(); entryOrder.fromDate = FromDate.ToShortDateString(); //entryOrder.brokerClient = ClientBroker.name; entryOrder.lotNumber = LotNumber; entryOrder.memberCode = ClientBroker.code; entryOrder.fullMemberName = ClientBroker.name; entryOrder.clientCode = JournalC01CompanyInfo.code; entryOrder.clientFullName = ""; entryOrder.clientAddress = ""; entryOrder.clientBIN = JournalC01CompanyInfo.bin; entryOrder.clientPhones = ""; entryOrder.clientBankIIK = ""; entryOrder.clientBankBIK = ""; entryOrder.clientBankName = ""; entryOrder.requestedDocs = new List <RequestedDoc>(ReqDocList); // Give model and path to service var entryOrderService = new EntryOrderService(entryOrder, wherePath.FullName); entryOrderService.CopyTemplateToEndPath(); // Fill and save template entryOrderService.FillFileAndSave(); // Close and show folder Process.Start("explorer", wherePath.FullName); } }
// POST: api/EntryorderQuery public EntryOrderQueryResponseModel Post([FromBody] EntryOrderQueryRequestModel model) { EntryOrderQueryResponseModel response = new EntryOrderQueryResponseModel(); using (SCVDBContainer dbContext = new SCVDBContainer()) { DbSet <RECEIPT_HEADER> dbSet0 = dbContext.Set <RECEIPT_HEADER>(); DbSet <RECEIPT_DETAIL> dbSet1 = dbContext.Set <RECEIPT_DETAIL>(); RECEIPT_HEADER header = dbSet0.FirstOrDefault(h => h.RECEIPT_ID == model.EntryOrderCode && h.COMPANY == model.OwnerCode); if (header == null) { response.Flag = "failure"; response.Code = "-1"; response.Message = "无此入库单"; response.TotalLines = 0; return(response); } EntryOrder entryOrder = new EntryOrder(); entryOrder.EntryOrderCode = model.EntryOrderCode; entryOrder.OwnerCode = header.COMPANY; entryOrder.WarehouseCode = "LK01"; entryOrder.EntryOrderId = header.INTERNAL_RECEIPT_NUM.ToString(); entryOrder.EntryOrderType = header.RECEIPT_TYPE; entryOrder.Status = header.TRAILING_STS.ToString(); List <OrderLine> orderLines = new List <OrderLine>(); foreach (var item in header.RECEIPT_DETAIL) { OrderLine orderLine = new OrderLine(); orderLine.OrderLineNo = item.INTERNAL_RECEIPT_LINE_NUM.ToString(); orderLine.ItemCode = item.ITEM; orderLine.ItemId = item.INTERNAL_RECEIPT_NUM.ToString(); orderLine.ItemName = item.ITEM_DESC; orderLine.PlanQty = Convert.ToInt32(item.TOTAL_QTY); orderLine.ActualQty = Convert.ToInt32(item.OPEN_QTY); orderLines.Add(orderLine); } response.Flag = "success"; response.Code = "1"; response.Message = "查询成功"; response.TotalLines = header.RECEIPT_DETAIL.Count(); response.EntryOrder = entryOrder; response.OrderLines = orderLines; } return(response); }
public int GetIndex(long jid) { return(EntryOrder.FindIndex(x => x.Journalid == jid)); }
public EntryOrderService(EntryOrder entryOrder, string wherePath) { this.entryOrder = entryOrder; this.wherePath = wherePath; }