public List <View_Business_WarehouseInPut_RequisitionDetail> GetListViewDetail_OrderForm(string billNo, List <string> listOrderForm) { List <View_Business_WarehouseInPut_RequisitionDetail> listResult = new List <View_Business_WarehouseInPut_RequisitionDetail>(); string orderFormNum = ""; foreach (string item in listOrderForm) { orderFormNum += "'" + item + "',"; } orderFormNum = orderFormNum.Substring(0, orderFormNum.Length - 1); string strSql = " select a.订单号, b.物品ID , b.图号型号, b.物品名称 ,b.规格, " + " a.供货单位, b.订货数量, c.单位 from View_B_OrderFormInfo as a " + " inner join View_B_OrderFormGoods as b on a.订单号 = b.订单号 " + " inner join View_F_GoodsPlanCost as c on b.物品ID = c.序号 where a.订单号 in (" + orderFormNum + ")"; DataTable dtTemp = GlobalObject.DatabaseServer.QueryInfo(strSql); foreach (DataRow dr in dtTemp.Rows) { View_Business_WarehouseInPut_RequisitionDetail tempLnq = new View_Business_WarehouseInPut_RequisitionDetail(); tempLnq.单据号 = billNo; tempLnq.单位 = dr["单位"].ToString(); tempLnq.供应商 = dr["供货单位"].ToString(); tempLnq.关联业务 = dr["订单号"].ToString(); tempLnq.物品ID = (int)dr["物品ID"]; tempLnq.图号型号 = dr["图号型号"].ToString(); tempLnq.物品名称 = dr["物品名称"].ToString(); tempLnq.规格 = dr["规格"].ToString(); tempLnq.数量 = (decimal)dr["订货数量"]; IBasicGoodsServer goodsService = SCM_Level01_ServerFactory.GetServerModule <IBasicGoodsServer>(); F_GoodsAttributeRecord record = goodsService.GetGoodsAttirbuteRecord(tempLnq.物品ID, Convert.ToInt32(CE_GoodsAttributeName.来料须依据检验结果入库)); if (record != null) { tempLnq.检验报告 = Convert.ToBoolean(record.AttributeValue); } listResult.Add(tempLnq); } return(listResult); }
public List <View_Business_InspectionJudge_JudgeReportDetail> GetJudgeReportDetail <T>(string billNo, string judgeReportBillNo, List <T> listDetail) { List <View_Business_InspectionJudge_JudgeReportDetail> detailSource = new List <View_Business_InspectionJudge_JudgeReportDetail>(); if (listDetail != null) { foreach (var item in listDetail) { View_Business_InspectionJudge_JudgeReportDetail tempDetail = new View_Business_InspectionJudge_JudgeReportDetail(); if (typeof(T) == typeof(View_Business_WarehouseInPut_RequisitionDetail)) { View_Business_WarehouseInPut_RequisitionDetail itemTemp = item as View_Business_WarehouseInPut_RequisitionDetail; tempDetail.单据号 = judgeReportBillNo; tempDetail.单位 = itemTemp.单位; tempDetail.供应商 = itemTemp.供应商; tempDetail.关联业务 = billNo; tempDetail.规格 = itemTemp.规格; tempDetail.批次号 = itemTemp.批次号; tempDetail.数量 = itemTemp.数量; tempDetail.图号型号 = itemTemp.图号型号; tempDetail.物品ID = itemTemp.物品ID; tempDetail.物品名称 = itemTemp.物品名称; } else if (typeof(T) == typeof(View_Business_WarehouseInPut_AOGDetail)) { View_Business_WarehouseInPut_AOGDetail itemTemp = item as View_Business_WarehouseInPut_AOGDetail; tempDetail.单据号 = judgeReportBillNo; tempDetail.单位 = itemTemp.单位; tempDetail.供应商 = itemTemp.供应商; tempDetail.关联业务 = billNo; tempDetail.规格 = itemTemp.规格; tempDetail.批次号 = itemTemp.批次号; tempDetail.数量 = itemTemp.数量; tempDetail.图号型号 = itemTemp.图号型号; tempDetail.物品ID = itemTemp.物品ID; tempDetail.物品名称 = itemTemp.物品名称; } else if (typeof(T) == typeof(Business_InspectionJudge_InspectionReport)) { Business_InspectionJudge_InspectionReport itemTemp = item as Business_InspectionJudge_InspectionReport; View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo(itemTemp.GoodsID); tempDetail.单据号 = judgeReportBillNo; tempDetail.单位 = goodsInfo.单位; tempDetail.供应商 = itemTemp.Provider; tempDetail.关联业务 = billNo; tempDetail.规格 = goodsInfo.规格; tempDetail.批次号 = itemTemp.BatchNo; tempDetail.数量 = itemTemp.GoodsCount; tempDetail.图号型号 = goodsInfo.图号型号; tempDetail.物品ID = itemTemp.GoodsID; tempDetail.物品名称 = goodsInfo.物品名称; } detailSource.Add(tempDetail); } } return(detailSource); }
private bool customForm_PanelGetDateInfo(CE_FlowOperationType flowOperationType) { try { if (!CheckData()) { return(false); } m_lnqBillInfo = new Business_WarehouseInPut_Requisition(); m_lnqBillInfo.BillNo = txtBillNo.Text; m_lnqBillInfo.BillType = cmbBillType.Text; m_lnqBillInfo.BillTypeDetail = txtTypeDetail.Text; m_lnqBillInfo.ApplyingDepartment = txtApplyingDepartment.Tag.ToString(); m_lnqBillInfo.IsConfirmArrival = chbIsConfirmArrival.Checked; m_lnqBillInfo.Remark = txtRemark.Text; List <View_Business_WarehouseInPut_RequisitionDetail> listTemp = new List <View_Business_WarehouseInPut_RequisitionDetail>(); foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { View_Business_WarehouseInPut_RequisitionDetail detailTemp = new View_Business_WarehouseInPut_RequisitionDetail(); detailTemp.备注 = dgvr.Cells["备注"].Value == null ? "" : dgvr.Cells["备注"].Value.ToString(); detailTemp.单据号 = txtBillNo.Text; detailTemp.单位 = dgvr.Cells["单位"].Value == null ? "" : dgvr.Cells["单位"].Value.ToString(); detailTemp.供应商 = dgvr.Cells["供应商"].Value == null ? "" : dgvr.Cells["供应商"].Value.ToString(); detailTemp.关联业务 = dgvr.Cells["关联业务"].Value == null ? "" : dgvr.Cells["关联业务"].Value.ToString(); detailTemp.规格 = dgvr.Cells["规格"].Value == null ? "" : dgvr.Cells["规格"].Value.ToString(); detailTemp.检验报告 = Convert.ToBoolean(dgvr.Cells["检验报告"].Value); detailTemp.批次号 = dgvr.Cells["批次号"].Value == null ? "" : dgvr.Cells["批次号"].Value.ToString(); detailTemp.数量 = Convert.ToDecimal(dgvr.Cells["数量"].Value); detailTemp.图号型号 = dgvr.Cells["图号型号"].Value == null ? "" : dgvr.Cells["图号型号"].Value.ToString(); detailTemp.物品ID = Convert.ToInt32(dgvr.Cells["物品ID"].Value); detailTemp.物品名称 = dgvr.Cells["物品名称"].Value == null ? "" : dgvr.Cells["物品名称"].Value.ToString(); switch (GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(m_lnqBillInfo.BillType)) { case CE_InPutBusinessType.生产采购: case CE_InPutBusinessType.普通采购: case CE_InPutBusinessType.委外采购: case CE_InPutBusinessType.样品采购: case CE_InPutBusinessType.自制件入库: break; case CE_InPutBusinessType.领料退库: case CE_InPutBusinessType.营销入库: case CE_InPutBusinessType.营销退库: IProductCodeServer serverProductCode = ServerModule.ServerModuleFactory.GetServerModule <IProductCodeServer>(); if (!serverProductCode.IsFitCount(detailTemp.物品ID, Convert.ToInt32(detailTemp.数量), detailTemp.单据号)) { MessageBox.Show("请对CVT/TCU设置流水编号,并保证产品数量与流水编号数一致", "提示"); return(false); } break; default: break; } listTemp.Add(detailTemp); } this.FlowInfo_BillNo = txtBillNo.Text; this.ResultInfo = listTemp; this.ResultList = new List <object>(); this.ResultList.Add(m_lnqBillInfo); this.ResultList.Add(flowOperationType); return(true); } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return(false); } }