コード例 #1
0
        public static void ReadNmcg(ArchiveOperationForm masterForm)
        {
            IControlManager masterCm = masterForm.ControlManager;

            if (masterCm.DisplayManager.DataControls["预配提单号"].SelectedDataValue == null)
            {
                ServiceProvider.GetService <IMessageBox>().ShowWarning("请输入预配提单号!");
                return;
            }

            string tdh = masterCm.DisplayManager.DataControls["预配提单号"].SelectedDataValue.ToString().Trim();

            IList <集装箱进门查询结果> boxList = m_npediGrab.集装箱进门查询(tdh);

            if (boxList.Count <= 0)
            {
                //boxList = m_npediGrab.集装箱进门查询(tdh);
                return;
            }

            AskToReplace(masterCm, "预配船名航次", boxList[0].船名航次);
            //AskToReplace(masterCm, "进港地编号", NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", boxList[0].码头));
            //AskToReplace(masterCm, "到港时间", boxList[0].进场时间);
            //AskToReplace(masterCm, "提单号", boxList[0].提单号);
            AskToReplace(masterCm, "箱量", boxList.Count);

            IControlManager detailCm = (((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0] as IArchiveGrid).ControlManager;

            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;
                    }
                }
                if (!have)
                {
                    内贸出港箱 newItem = new 内贸出港箱 {
                        箱号 = data.集装箱号, 封志号 = data.铅封号
                    };
                    detailCm.AddNew();
                    detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = newItem;
                    detailCm.EndEdit();
                }
            }
        }
コード例 #2
0
        public static void ReadNmcg(ArchiveOperationForm masterForm)
        {
            IControlManager masterCm = masterForm.ControlManager;

            if (masterCm.DisplayManager.DataControls["预配提单号"].SelectedDataValue == null)
            {
                ServiceProvider.GetService<IMessageBox>().ShowWarning("请输入预配提单号!");
                return;
            }

            string tdh = masterCm.DisplayManager.DataControls["预配提单号"].SelectedDataValue.ToString().Trim();

            IList<集装箱进门查询结果> boxList = m_npediGrab.集装箱进门查询(tdh);
            if (boxList.Count <= 0)
            {
                //boxList = m_npediGrab.集装箱进门查询(tdh);
                return;
            }

            AskToReplace(masterCm, "预配船名航次", boxList[0].船名航次);
            //AskToReplace(masterCm, "进港地编号", NameValueMappingCollection.Instance.FindColumn2FromColumn1("人员单位_港区堆场", "全称", "编号", boxList[0].码头));
            //AskToReplace(masterCm, "到港时间", boxList[0].进场时间);
            //AskToReplace(masterCm, "提单号", boxList[0].提单号);
            AskToReplace(masterCm, "箱量", boxList.Count);

            IControlManager detailCm = (((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0] as IArchiveGrid).ControlManager;

            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;
                    }
                }
                if (!have)
                {
                    内贸出港箱 newItem = new 内贸出港箱 { 箱号 = data.集装箱号, 封志号 = data.铅封号 };
                    detailCm.AddNew();
                    detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = newItem;
                    detailCm.EndEdit();
                }
            }
        }