private void btnSelect_Click(object sender, EventArgs e) { FormQueryInfo form = new FormQueryInfo(m_serviceAOG.GetReferenceInfo(chbIsRepeat.Checked)); if (DialogResult.OK == form.ShowDialog()) { string billRelate = form.GetDataItem("单据号").ToString(); DataTable tempTable = m_serviceRequistion.GetListViewDetial(billRelate, null, null, null); if (tempTable != null) { List <View_Business_WarehouseInPut_AOGDetail> lstTemp = new List <View_Business_WarehouseInPut_AOGDetail>(); for (int i = 0; i < tempTable.Rows.Count; i++) { View_Business_WarehouseInPut_AOGDetail lnqTemp = new View_Business_WarehouseInPut_AOGDetail(); lnqTemp.关联业务 = billRelate; lnqTemp.单据号 = txtBillNo.Text; lnqTemp.单位 = tempTable.Rows[i]["单位"].ToString(); lnqTemp.供应商 = tempTable.Rows[i]["供应商"].ToString(); lnqTemp.规格 = tempTable.Rows[i]["规格"].ToString(); lnqTemp.数量 = Convert.ToDecimal(tempTable.Rows[i]["数量"]); lnqTemp.图号型号 = tempTable.Rows[i]["图号型号"].ToString(); lnqTemp.物品ID = Convert.ToInt32(tempTable.Rows[i]["物品ID"]); lnqTemp.物品名称 = tempTable.Rows[i]["物品名称"].ToString(); switch (GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(tempTable.Rows[0]["BillType"].ToString())) { case CE_InPutBusinessType.生产采购: case CE_InPutBusinessType.普通采购: case CE_InPutBusinessType.委外采购: case CE_InPutBusinessType.样品采购: lnqTemp.批次号 = txtBillNo.Text + i.ToString("D3"); break; case CE_InPutBusinessType.领料退库: if (tempTable.Rows[i]["批次号"] == null || tempTable.Rows[i]["批次号"].ToString().Trim().Length == 0) { lnqTemp.批次号 = txtBillNo.Text + i.ToString("D3"); } break; default: if (tempTable.Rows[i]["批次号"] != null && tempTable.Rows[i]["批次号"].ToString().Trim().Length > 0) { lnqTemp.批次号 = tempTable.Rows[i]["批次号"].ToString(); } break; } lstTemp.Add(lnqTemp); } customDataGridView1.Rows.Clear(); RefreshDataGridView(lstTemp); } } }
private bool customForm_PanelGetDateInfo(CE_FlowOperationType flowOperationType) { try { if (!CheckData()) { return(false); } m_lnqBillInfo = new Business_WarehouseInPut_AOG(); m_lnqBillInfo.BillNo = txtBillNo.Text; m_lnqBillInfo.Remark = txtRemark.Text; List <View_Business_WarehouseInPut_AOGDetail> listTemp = new List <View_Business_WarehouseInPut_AOGDetail>(); foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { View_Business_WarehouseInPut_AOGDetail detailTemp = new View_Business_WarehouseInPut_AOGDetail(); detailTemp.关联业务 = dgvr.Cells["关联业务"].Value == null ? "" : dgvr.Cells["关联业务"].Value.ToString(); 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.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(); 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); } }
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); }