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 { m_lnqBillInfo = new Business_InspectionJudge_JudgeReport(); m_lnqBillInfo.Judge = GetRadioButton_Judge(); m_lnqBillInfo.FinalJudge = GetRadioButton_FinalJudge(); if (!CheckData()) { return(false); } m_lnqBillInfo.BillNo = txtBillNo.Text; m_lnqBillInfo.IsFinalJudge = chbIsFinalJudge.Checked; m_lnqBillInfo.JudgeExplain = txtJudgeExplain.Text; m_lnqBillInfo.JudgeReportNo = txtJudgeReportNo.Text; m_lnqBillInfo.FinalJudgeExplain = txtFinalJudgeExplain.Text; List <View_Business_InspectionJudge_JudgeReport_Item> listItemTemp = new List <View_Business_InspectionJudge_JudgeReport_Item>(); foreach (DataGridViewRow dgvr in customDataGridView2.Rows) { View_Business_InspectionJudge_JudgeReport_Item itemTemp = new View_Business_InspectionJudge_JudgeReport_Item(); itemTemp.判定项目 = dgvr.Cells["判定项目"].Value == null ? "" : dgvr.Cells["判定项目"].Value.ToString(); itemTemp.判定结果 = dgvr.Cells["判定结果"].Value == null ? "" : dgvr.Cells["判定结果"].Value.ToString(); itemTemp.单据号 = txtBillNo.Text; listItemTemp.Add(itemTemp); } List <View_Business_InspectionJudge_JudgeReportDetail> listDetailTemp = new List <View_Business_InspectionJudge_JudgeReportDetail>(); foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { View_Business_InspectionJudge_JudgeReportDetail detailTemp = new View_Business_InspectionJudge_JudgeReportDetail(); 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.规格 = dgvr.Cells["规格"].Value == null ? "" : dgvr.Cells["规格"].Value.ToString(); detailTemp.批次号 = dgvr.Cells["批次号"].Value == null ? "" : dgvr.Cells["批次号"].Value.ToString(); detailTemp.数量 = dgvr.Cells["数量"].Value == null ? 0 : Convert.ToDecimal(dgvr.Cells["数量"].Value); detailTemp.图号型号 = dgvr.Cells["图号型号"].Value == null ? "" : dgvr.Cells["图号型号"].Value.ToString(); detailTemp.物品ID = dgvr.Cells["物品ID"].Value == null ? 0 : Convert.ToInt32(dgvr.Cells["物品ID"].Value); detailTemp.物品名称 = dgvr.Cells["物品名称"].Value == null ? "" : dgvr.Cells["物品名称"].Value.ToString(); detailTemp.单据号 = txtBillNo.Text; listDetailTemp.Add(detailTemp); } this.FlowInfo_BillNo = txtBillNo.Text; this.ResultList = new List <object>(); this.ResultList.Add(m_lnqBillInfo); this.ResultList.Add(flowOperationType); this.ResultList.Add(listDetailTemp); this.ResultList.Add(listItemTemp); return(true); } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return(false); } }