public static void ReadPx_报关单号(ArchiveOperationForm masterForm) { IControlManager masterCm = masterForm.ControlManager; if (masterCm.DisplayManager.DataControls["报关单号"].SelectedDataValue == null) { ServiceProvider.GetService<IMessageBox>().ShowWarning("请输入报关单号!"); return; } string bgdh = masterCm.DisplayManager.DataControls["报关单号"].SelectedDataValue.ToString().Trim(); 报关单数据 bgdInfo = null; foreach (KeyValuePair<string, string> id in Get_nbediRead_ID()) { nbediRead m_nbediRead = new nbediRead(); m_nbediRead.SetLoginInfo(id.Key, id.Value); bgdInfo = m_nbediRead.长短号查询报关单数据(bgdh); if (bgdInfo != null && !string.IsNullOrEmpty(bgdInfo.报关单号)) { break; } } if (bgdInfo == null) { return; } AskToReplace(masterCm, "报关单号", bgdInfo.报关单长号); AskToReplace(masterCm, "抬头", bgdInfo.经营单位); AskToReplace(masterCm, "提单号", bgdInfo.提运单号); AskToReplace(masterCm, "核销单号", bgdInfo.批准文号); AskToReplace(masterCm, "通关单号", bgdInfo.通关单号); AskToReplace(masterCm, "箱号", bgdInfo.箱号); AskToReplace(masterCm, "箱量", bgdInfo.箱量); AskToReplace(masterCm, "委托时间", bgdInfo.申报日期); AskToReplace(masterCm, "船名航次", bgdInfo.船名航次); AskToReplace(masterCm, "报关单快照", bgdInfo.网页快照); AskToReplace(masterCm, "报关员编号", bgdInfo.报关员); AskToReplace(masterCm, "报关公司", bgdInfo.报关公司); if (string.IsNullOrEmpty(bgdInfo.提运单号)) { return; } IControlManager detailCm = (((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0] as IArchiveGrid).ControlManager; IList<集装箱数据> boxList = 查询出口集装箱数据By提单号航次(bgdInfo.提运单号.Trim(), bgdInfo.船名航次.Split('/')[1]); string 进港地 = null; DateTime? 离港时间 = null; foreach (集装箱数据 data in boxList) { bool have = false; foreach (Xceed.Grid.DataRow row in ((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0].DataRows) { if (row.Cells["箱号"].Value != null && row.Cells["箱号"].Value.ToString().Trim() == data.集装箱号.Trim()) { have = true; break; } 进港地 = (string)NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", data.堆场区); 离港时间 = data.Real进场时间; } if (!have) { 拼箱箱 newItem = new 拼箱箱 { 箱号 = data.集装箱号, 箱型 = Feng.Utils.ConvertHelper.ChangeType(data.箱型, typeof(箱型)) as 箱型, 装货地编号 = (string)NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", data.堆场区), 进港时间 = data.Real进场时间, 提箱时间 = data.Real提箱时间 }; detailCm.AddNew(); detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = newItem; detailCm.EndEdit(); } } AskToReplace(masterCm, "进港地编号", 进港地); AskToReplace(masterCm, "离港时间", 离港时间); }
public static void ReadPx_报关单号(ArchiveOperationForm masterForm) { IControlManager masterCm = masterForm.ControlManager; if (masterCm.DisplayManager.DataControls["报关单号"].SelectedDataValue == null) { ServiceProvider.GetService <IMessageBox>().ShowWarning("请输入报关单号!"); return; } string bgdh = masterCm.DisplayManager.DataControls["报关单号"].SelectedDataValue.ToString().Trim(); 报关单数据 bgdInfo = null; foreach (KeyValuePair <string, string> id in Get_nbediRead_ID()) { nbediRead m_nbediRead = new nbediRead(); m_nbediRead.SetLoginInfo(id.Key, id.Value); bgdInfo = m_nbediRead.长短号查询报关单数据(bgdh); if (bgdInfo != null && !string.IsNullOrEmpty(bgdInfo.报关单号)) { break; } } if (bgdInfo == null) { return; } AskToReplace(masterCm, "报关单号", bgdInfo.报关单长号); AskToReplace(masterCm, "抬头", bgdInfo.经营单位); AskToReplace(masterCm, "提单号", bgdInfo.提运单号); AskToReplace(masterCm, "核销单号", bgdInfo.批准文号); AskToReplace(masterCm, "通关单号", bgdInfo.通关单号); AskToReplace(masterCm, "箱号", bgdInfo.箱号); AskToReplace(masterCm, "箱量", bgdInfo.箱量); AskToReplace(masterCm, "委托时间", bgdInfo.申报日期); AskToReplace(masterCm, "船名航次", bgdInfo.船名航次); AskToReplace(masterCm, "报关单快照", bgdInfo.网页快照); AskToReplace(masterCm, "报关员编号", bgdInfo.报关员); AskToReplace(masterCm, "报关公司", bgdInfo.报关公司); if (string.IsNullOrEmpty(bgdInfo.提运单号)) { return; } IControlManager detailCm = (((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0] as IArchiveGrid).ControlManager; IList <集装箱数据> boxList = 查询出口集装箱数据By提单号航次(bgdInfo.提运单号.Trim(), bgdInfo.船名航次.Split('/')[1]); string 进港地 = null; DateTime? 离港时间 = null; foreach (集装箱数据 data in boxList) { bool have = false; foreach (Xceed.Grid.DataRow row in ((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0].DataRows) { if (row.Cells["箱号"].Value != null && row.Cells["箱号"].Value.ToString().Trim() == data.集装箱号.Trim()) { have = true; break; } 进港地 = (string)NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", data.堆场区); 离港时间 = data.Real进场时间; } if (!have) { 拼箱箱 newItem = new 拼箱箱 { 箱号 = data.集装箱号, 箱型 = Feng.Utils.ConvertHelper.ChangeType(data.箱型, typeof(箱型)) as 箱型, 装货地编号 = (string)NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", data.堆场区), 进港时间 = data.Real进场时间, 提箱时间 = data.Real提箱时间 }; detailCm.AddNew(); detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = newItem; detailCm.EndEdit(); } } AskToReplace(masterCm, "进港地编号", 进港地); AskToReplace(masterCm, "离港时间", 离港时间); }