public ProductionReportEntryUIDM CreateModel(ProductionReportEntryDTO TransDTO, DataTable NGData) { ProductionReportEntryUIDM model = new ProductionReportEntryUIDM(); model.TRANS_ID = TransDTO.TRANS_ID; model.REF_NO = TransDTO.REF_NO; model.PRODUCTION_REPORT_NO = TransDTO.PRODUCTION_REPORT_NO; model.PRODUCTION_REPORT_DATE = TransDTO.PRODUCTION_REPORT_DATE; model.SHIFT = TransDTO.SHIFT; model.MASTER_NO = TransDTO.MASTER_NO; model.PART_NO = TransDTO.PART_NO; model.CUSTOMER_NAME = TransDTO.CUSTOMER_NAME; model.PROCESS = TransDTO.PROCESS; model.MACHINE_NO = TransDTO.MACHINE_NO; model.REWORK = TransDTO.REWORK; model.LOT_NO = TransDTO.LOT_NO; model.CUST_LOT_NO = TransDTO.CUST_LOT_NO; model.SUPPLIER = TransDTO.SUPPLIER; model.WEIGHT = TransDTO.WEIGHT; model.QTY = TransDTO.QTY; model.PERSON_IN_CHARGE = TransDTO.PERSON_IN_CHARGE; model.REMARK = TransDTO.REMARK; model.NG_WEIGHT = TransDTO.NG_WEIGHT; model.NG_QTY = TransDTO.NG_QTY; model.DataView = NGData; return(model); }
public ProductionReportEntryUIDM LoadProductionReport(NZString TransID) { ProductionReportEntryUIDM model = null; DataTable dtNG = null; InventoryTransBIZ biz = new InventoryTransBIZ(); ProductionReportEntryDTO dto = biz.LoadProductionReport(TransID); if (dto == null) { return(new ProductionReportEntryUIDM()); } dtNG = biz.LoadNGTransaction(dto.TRANS_ID); model = CreateModel(dto, dtNG); return(model); }
internal void DeleteProductionReport(NZString TransID) { InventoryBIZ bizInv = new InventoryBIZ(); InventoryTransBIZ bizInvTrans = new InventoryTransBIZ(); List <InventoryTransactionDTO> dtoList = new List <InventoryTransactionDTO>(); InventoryTransactionDTO dtoTrans = null; ProductionReportEntryDTO dtoProduction = bizInvTrans.LoadProductionReport(TransID); if (dtoProduction != null) { //In dtoTrans = new InventoryTransactionDTO(); dtoTrans.TRANS_ID = dtoProduction.TRANS_ID; dtoList.Add(dtoTrans); //Out dtoTrans = new InventoryTransactionDTO(); dtoTrans.TRANS_ID = dtoProduction.REF_NO; dtoList.Add(dtoTrans); //NG DataTable dtNG = bizInvTrans.LoadNGTransaction(dtoProduction.TRANS_ID); if (dtNG != null && dtNG.Rows.Count > 0) { foreach (DataRow dr in dtNG.Rows) { NZString NGTrans = new NZString(null, dr[(int)ProductionReportEntryViewDTO.eColumns.NG_TRANS_ID]); if (NGTrans == null) { continue; } dtoTrans = new InventoryTransactionDTO(); dtoTrans.TRANS_ID = NGTrans; dtoList.Add(dtoTrans); } } } bizInv.DeleteTransactionList(dtoList); }