public GeneratedArchiveDataControlForm(WindowInfo windowInfo)
            : base()
        {
            this.Name = windowInfo.Name;
            this.Text = windowInfo.Text;

            IList <WindowTabInfo> tabInfos = ADInfoBll.Instance.GetWindowTabInfosByWindowId(windowInfo.Name);

            if (tabInfos == null)
            {
                throw new ArgumentException("there is no windowTab with windowId of " + windowInfo.Name);
            }
            if (tabInfos.Count == 0)
            {
                throw new ArgumentException("There should be at least one TabInfo in WindowInfo with name is " + windowInfo.Name + "!");
            }
            if (tabInfos.Count > 1)
            {
                throw new ArgumentException("There should be at most one TabInfo in WindowInfo with name is " + windowInfo.Name + "!");
            }

            IControlManager cmMaster = ServiceProvider.GetService <IManagerFactory>().GenerateControlManager(tabInfos[0], null);

            base.Initialize(cmMaster, ADInfoBll.Instance.GetGridColumnInfos(tabInfos[0].GridName));
        }
 public GeneBank(IControlManager controlManager, IWorld world)
 {
     _world = world;
     _controlManager = controlManager;
     _loci = new List<ILocus>();
     _alleleMap = new Dictionary<Guid, IAllele>();
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="cm"></param>
        /// <param name="infos"></param>
        protected void Initialize(IControlManager cm, IList<GridColumnInfo> infos)
        {
            m_cm = cm;
            if (infos != null)
            {
                foreach (GridColumnInfo info in infos)
                {
                    if (string.IsNullOrEmpty(info.DataControlType))
                    {
                        continue;
                    }

                    IDataControl dc = ControlFactory.GetDataControl(info, cm.DisplayManager.Name);
                    if (dc != null)
                    {
                        //m_dcc.Add(dc);
                        m_cm.DisplayManager.DataControls.Add(dc);

                        Control c = dc as Control;

                        this.flowLayoutPanel1.Controls.Add(c);
                    }
                }

                ArchiveDetailForm.SetDataControlDefaultValues(m_cm);
            }

            m_closeOk = false;
        }
        private void 实时监控开始_Load(object sender, EventArgs e)
        {
            m_cm = AssociateDataControlsInControlManager(new Control[] { pnl驾驶员, pnl车载ID号, pnl开始时间, pnl备注 },
                                                         "实时监控_车辆作业_监控开始");
            m_cm.AllowInsert = true;
            m_cm.AddNew();

            if (m_clzy != null)
            {
                m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue = m_clzy.驾驶员编号;
                m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue = m_clzy.车载Id号;
                m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue  = m_clzy.开始时间;
                m_cm.DisplayManager.DataControls["备注"].SelectedDataValue    = m_clzy.备注;
            }

            if (m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue = System.DateTime.Now;
            }

            if (m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue = m_clzy.车辆.车载Id号;
            }

            if (m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue = m_clzy.车辆.主驾驶员编号;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="cm"></param>
        /// <param name="infos"></param>
        protected void Initialize(IControlManager cm, IList <GridColumnInfo> infos)
        {
            m_cm = cm;
            if (infos != null)
            {
                foreach (GridColumnInfo info in infos)
                {
                    if (string.IsNullOrEmpty(info.DataControlType))
                    {
                        continue;
                    }

                    IDataControl dc = ControlFactory.GetDataControl(info, cm.DisplayManager.Name);
                    if (dc != null)
                    {
                        //m_dcc.Add(dc);
                        m_cm.DisplayManager.DataControls.Add(dc);

                        Control c = dc as Control;

                        this.flowLayoutPanel1.Controls.Add(c);
                    }
                }

                ArchiveDetailForm.SetDataControlDefaultValues(m_cm);
            }

            m_closeOk = false;
        }
Exemple #6
0
#pragma warning restore 618
        public void TestFixtureSetUp()
        {
            BossManager       = MockRepository.GenerateStub <IBossManager>();
            BulletManager     = MockRepository.GenerateStub <IBulletManager>();
            CollisionManager  = MockRepository.GenerateStub <ICollisionManager>();
            CommandManager    = MockRepository.GenerateStub <ICommandManager>();
            ConfigManager     = MockRepository.GenerateStub <IConfigManager>();
            ContentManager    = MockRepository.GenerateStub <IContentManager>();
            ControlManager    = MockRepository.GenerateStub <IControlManager>();
            DebugManager      = MockRepository.GenerateStub <IDebugManager>();
            DelayManager      = MockRepository.GenerateStub <IDelayManager>();
            DeviceManager     = MockRepository.GenerateStub <IDeviceManager>();
            EnemyManager      = MockRepository.GenerateStub <IEnemyManager>();
            EventManager      = MockRepository.GenerateStub <IEventManager>();
            ExplosionManager  = MockRepository.GenerateStub <IExplosionManager>();
            IconManager       = MockRepository.GenerateStub <IIconManager>();
            ImageManager      = MockRepository.GenerateStub <IImageManager>();
            InputManager      = MockRepository.GenerateStub <IInputManager>();
            LevelManager      = MockRepository.GenerateStub <ILevelManager>();
            MoverManager      = MockRepository.GenerateStub <IMoverManager>();
            RandomManager     = MockRepository.GenerateStub <IRandomManager>();
            RenderManager     = MockRepository.GenerateStub <IRenderManager>();
            ResolutionManager = MockRepository.GenerateStub <IResolutionManager>();
            ScoreManager      = MockRepository.GenerateStub <IScoreManager>();
            ScreenManager     = MockRepository.GenerateStub <IScreenManager>();
            SoundManager      = MockRepository.GenerateStub <ISoundManager>();
            SpriteManager     = MockRepository.GenerateStub <ISpriteManager>();
            StateManager      = MockRepository.GenerateStub <IStateManager>();
            StopwatchManager  = MockRepository.GenerateStub <IStopwatchManager>();
            StorageManager    = MockRepository.GenerateStub <IStorageManager>();
            TextManager       = MockRepository.GenerateStub <ITextManager>();
            ThreadManager     = MockRepository.GenerateStub <IThreadManager>();
            FileManager       = MockRepository.GenerateStub <IFileManager>();
            Logger            = MockRepository.GenerateStub <ILogger>();
        }
        /// <summary>
        /// 创建ICheckControlCollection
        /// </summary>
        /// <param name="cm"></param>
        /// <returns></returns>
        public virtual ICheckControlCollection CreateCheckControlCollection(IControlManager cm)
        {
            ICheckControlCollection ret = new CheckControlCollection();

            ret.ParentManager = cm;
            return(ret);
        }
Exemple #8
0
#pragma warning restore 618
        public void TestFixtureTearDown()
        {
            BossManager       = null;
            BulletManager     = null;
            CollisionManager  = null;
            CommandManager    = null;
            ConfigManager     = null;
            ContentManager    = null;
            ControlManager    = null;
            DebugManager      = null;
            DelayManager      = null;
            DeviceManager     = null;
            EnemyManager      = null;
            EventManager      = null;
            ExplosionManager  = null;
            IconManager       = null;
            ImageManager      = null;
            InputManager      = null;
            LevelManager      = null;
            MoverManager      = null;
            RandomManager     = null;
            RenderManager     = null;
            ResolutionManager = null;
            ScoreManager      = null;
            ScreenManager     = null;
            SoundManager      = null;
            SpriteManager     = null;
            StateManager      = null;
            StopwatchManager  = null;
            StorageManager    = null;
            TextManager       = null;
            ThreadManager     = null;
            FileManager       = null;
            Logger            = null;
        }
        private void 实时监控开始_Load(object sender, EventArgs e)
        {
            m_cm = AssociateDataControlsInControlManager(new Control[] { pnl驾驶员, pnl车载ID号, pnl开始时间, pnl备注},
                "实时监控_车辆作业_监控开始");
            m_cm.AllowInsert = true;
            m_cm.AddNew();

            if (m_clzy != null)
            {
                m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue = m_clzy.驾驶员编号;
                m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue = m_clzy.车载Id号;
                m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue = m_clzy.开始时间;
                m_cm.DisplayManager.DataControls["备注"].SelectedDataValue = m_clzy.备注;
            }

            if (m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["开始时间"].SelectedDataValue = System.DateTime.Now;
            }

            if (m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["车载Id号"].SelectedDataValue = m_clzy.车辆.车载Id号;
            }

            if (m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["驾驶员编号"].SelectedDataValue = m_clzy.车辆.主驾驶员编号;
            }
        }
        private void 实时监控结束_Load(object sender, EventArgs e)
        {
            m_cm = AssociateDataControlsInControlManager(new Control[] {
                pnl作业号,  pnl车牌号, pnl驾驶员编号, pnl联系电话,  pnl备注},
                "实时监控_车辆作业_监控结束");
            grid = base.AssociateArchiveGrid(pnl作业流程, "实时监控_车辆作业_监控结束_任务");

            var dm = m_cm.DisplayManager;
            dm.DataControls["备注"].ReadOnly = false;

            using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<车辆作业>())
            {
                var clzy = rep.Get<车辆作业>(m_clzy.ID);

                dm.DataControls["作业号"].SelectedDataValue = clzy.作业号;
                dm.DataControls["车牌号"].SelectedDataValue = clzy.车辆.车牌号;
                dm.DataControls["驾驶员编号"].SelectedDataValue = clzy.驾驶员编号;
                dm.DataControls["联系电话"].SelectedDataValue = clzy.驾驶员.联系方式;
                dm.DataControls["备注"].SelectedDataValue = clzy.备注;

                grid.DisplayManager.SetDataBinding(clzy.专家任务.任务, string.Empty);
                for(int i=0; i<grid.DataRows.Count; ++i)
                {
                    grid.DataRows[i].Cells["序号"].Value = i;
                }
            }
        }
        private void Initialize(WindowTabInfo windowTabInfo, IControlManager cmParent)
        {
            ISearchManager        smMaster = ServiceProvider.GetService <IManagerFactory>().GenerateSearchManager(windowTabInfo, cmParent == null ? null : cmParent.DisplayManager);
            IWindowControlManager cmMaster = ServiceProvider.GetService <IManagerFactory>().GenerateControlManager(windowTabInfo, smMaster) as IWindowControlManager;

            if (cmParent != null && cmParent.Dao is IRelationalDao)
            {
                ManagerFactory.GenerateBusinessLayer(cmParent.Dao as IRelationalDao, windowTabInfo);
            }
            else
            {
                IBaseDao daoMaster = ServiceProvider.GetService <IManagerFactory>().GenerateBusinessLayer(windowTabInfo);
                cmMaster.Dao = daoMaster;
            }

            this.SetControlManager(cmMaster, windowTabInfo.GridName);

            //ArchiveSearchForm searchForm = new ArchiveSearchForm(this, smMaster, tabInfos[0]);
            //this.SearchPanel = searchForm;
            //cmMaster.StateControls.Add(searchForm);

            // daoParent's subDao is inserted in detailForm
            if (this is IBoundGridWithDetailGridLoadOnDemand)
            {
                ArchiveFormFactory.GenerateDetailGrids(this as IBoundGridWithDetailGridLoadOnDemand, windowTabInfo);
            }
        }
Exemple #12
0
        //public static void 自动凭证应付对账单生成费用(ArchiveOperationForm masterForm)
        //{
        //    IControlManager<业务费用> detailCm = (((IArchiveDetailFormWithDetailGrids)detailForm).DetailGrids[0] as IArchiveGrid).ControlManager
        //        as IControlManager<业务费用>;

        //    IList<费用> list = new List<费用>();
        //    foreach (业务费用 item in detailCm.DisplayManagerT.Entities)
        //    {
        //        list.Add(item.Clone() as 业务费用);
        //    }

        //    ArchiveOperationForm masterFormKj = TabbedMdiForm.ShowMenuFormInMdi("凭证_会计付款") as ArchiveOperationForm;
        //    if (masterFormKj != null)
        //    {
        //        if (masterFormKj.DoAdd())
        //        {
        //            IControlManager<凭证费用明细> detailCmKj = (((IArchiveDetailFormWithDetailGrids)detailForm).DetailGrids[0] as IArchiveGrid).ControlManager as IControlManager<凭证费用明细>;
        //            IBaseDao masterDao = ((IArchiveGrid)masterFormKj.ActiveGrid).Bll as IBaseDao;
        //            MemoryDao<凭证费用明细> memoryBll = (masterDao.GetSubDao(0) as IMasterDao).DetailMemoryDao as MemoryDao<凭证费用明细>;
        //            MemoryDao<费用> memoryBll2 = (((masterDao.GetSubDao(0) as IMasterDao).DetailDao as IBaseDao).GetSubDao(0) as IMasterDao).DetailMemoryDao as MemoryDao<费用>;

        //            (masterFormKj.DisplayManager.CurrentItem as 凭证).自动手工标志 = 自动手工标志.对账单;

        //            process_pz.AddFees(masterFormKj.DisplayManager.CurrentItem as 凭证, list, detailCmKj, memoryBll, memoryBll2);
        //            //frm_cw_fkpz_kj_detail detailFormTo = form.ArchiveDetailForm as frm_cw_fkpz_kj_detail;

        //            detailCmKj.DisplayManager.DataControls["金额.数额"].SelectedDataValue = detailForm.ControlManager.DisplayManager.DataControls["凭证金额"].SelectedDataValue;
        //            detailCmKj.DisplayManager.DataControls["金额.币制编号"].SelectedDataValue = detailForm.ControlManager.DisplayManager.DataControls["凭证币制编号"].SelectedDataValue;
        //        }
        //    }
        //}

        public static void  择应付对账单费用(ArchiveOperationForm masterForm)
        {
            if (masterForm.ControlManager.DisplayManager.DataControls["相关人编号"].SelectedDataValue == null)
            {
                MessageForm.ShowError("请先填写相关人编号!");
                return;
            }
            masterForm.ControlManager.DisplayManager.DataControls["相关人编号"].ReadOnly = true;
            EntityScript.SetPropertyValue(masterForm.DisplayManager.CurrentItem, "相关人编号", masterForm.ControlManager.DisplayManager.DataControls["相关人编号"].SelectedDataValue);

            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict["相关人编号"] = masterForm.ControlManager.DisplayManager.DataControls["相关人编号"].SelectedDataValue;
            ArchiveCheckForm form = ProcessSelect.Execute((masterForm.ArchiveDetailForm as IDisplayManagerContainer).DisplayManager, "选择_应付对账单_费用", dict);

            if (form != null)
            {
                IControlManager detailCm = (((IArchiveDetailFormWithDetailGrids)masterForm.ArchiveDetailForm).DetailGrids[0] as IArchiveGrid).ControlManager;

                using (var rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <业务费用>())
                {
                    foreach (object i in form.SelectedEntites)
                    {
                        业务费用 item = i as 业务费用;
                        item.对账单 = masterForm.DisplayManager.CurrentItem as 对账单;
                        detailCm.AddNew();
                        detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = item;
                        detailCm.EndEdit();
                    }
                }
            }
        }
Exemple #13
0
        public static void 生成凭证(ArchiveOperationForm masterForm)
        {
            IList <费用> list = GetSelectedFee4Pz(masterForm);

            if (list.Count == 0)
            {
                ServiceProvider.GetService <IMessageBox>().ShowWarning("请选择未出对帐单和凭证的费用!");
                return;
            }

            if (!MessageForm.ShowYesNo("是否要生成选中项相应的凭证?", "确认"))
            {
                return;
            }

            ArchiveOperationForm masterFormKj = ServiceProvider.GetService <IApplication>().ExecuteAction("资金票据_凭证") as ArchiveOperationForm;

            if (masterFormKj != null)
            {
                if (masterFormKj.DoAdd())
                {
                    ArchiveDetailForm detailFormKj = masterFormKj.ArchiveDetailForm as ArchiveDetailForm;

                    IControlManager <凭证费用明细> detailCmKj = (((IArchiveDetailFormWithDetailGrids)detailFormKj).DetailGrids[0] as IArchiveGrid).ControlManager as IControlManager <凭证费用明细>;
                    IRelationalDao           masterDao  = masterFormKj.ControlManager.Dao as IRelationalDao;
                    MemoryDao <凭证费用明细>       memoryBll  = (masterDao.GetRelationalDao(0) as IMemoriedRelationalDao).DetailMemoryDao as MemoryDao <凭证费用明细>;
                    //MemoryDao<费用> memoryBll2 = (((masterDao.GetSubDao(0) as IMemoriedMasterDao).DetailDao as IBaseDao).GetSubDao(0) as IMasterDao).DetailMemoryDao as MemoryDao<费用>;

                    (masterFormKj.DisplayManager.CurrentItem as 凭证).凭证类别 = 凭证类别.付款凭证;
                    detailFormKj.UpdateContent();

                    process_pz.AddFees(masterFormKj.DisplayManager.CurrentItem as 凭证, list, detailCmKj);
                }
            }
        }
Exemple #14
0
        public override IControlManager GenerateControlManager(WindowTabInfo tabInfo, ISearchManager sm)
        {
            IControlManager cm = base.GenerateControlManager(tabInfo, sm);
            IDisplayManager dm = cm.DisplayManager;

            if (tabInfo.SelectedDataValueChanged != null)
            {
                dm.SelectedDataValueChanged += new EventHandler <SelectedDataValueChangedEventArgs>(delegate(object sender, SelectedDataValueChangedEventArgs e)
                {
                    EventProcessUtils.ExecuteEventProcess(ADInfoBll.Instance.GetEventProcessInfos(tabInfo.SelectedDataValueChanged), sender, e);
                });
            }
            if (tabInfo.PositionChanged != null)
            {
                dm.PositionChanged += new EventHandler(delegate(object sender, EventArgs e)
                {
                    EventProcessUtils.ExecuteEventProcess(ADInfoBll.Instance.GetEventProcessInfos(tabInfo.PositionChanged), sender, e);
                });
            }

            AddEvent(tabInfo, cm, WindowTabEventManagerType.ControlManager);
            AddEvent(tabInfo, cm.DisplayManager, WindowTabEventManagerType.DisplayManager);

            return(cm);
        }
Exemple #15
0
        public MainWindow()
        {
            InitializeComponent();
            _gridConfiguraitonRepository = new GridConfiguraitonRepository();

            _temperatures            = new ValueRepository <TemperatureValue>(MainWindow_CollectionChanged);
            _temperatureChartManager = new TemperatureChartManager(_temperatures);

            _pressures            = new ValueRepository <PressureValue>(MainWindow_CollectionChanged);
            _pressureChartManager = new PressureChartManager(_pressures);

            _vacuums            = new ValueRepository <VacuumValue>(MainWindow_CollectionChanged);
            _vacuumChartManager = new VacuumChartManager(_vacuums);


            _dataGridManager = new DataGridManager(_gridConfiguraitonRepository, _pressures, _temperatures, _vacuums);
            _controlManager  = new ControlManager(_gridConfiguraitonRepository);
            _gridManager     = new GridManager(_dataGridManager, _controlManager);

            _fileControl = new FileControl(_pressures, _temperatures, _vacuums);
            _pdfControl  = new PDFControl(_pressures, _temperatures, _vacuums,
                                          (PressureChartManager)_pressureChartManager, (TemperatureChartManager)_temperatureChartManager,
                                          (VacuumChartManager)_vacuumChartManager);

            gridValues.Children[2].Visibility = Visibility.Hidden;
            TotalTIme.Text = "Tempo total: " + _temperatures.getTotalTime().ToString();
            UpdateGrid();
            MainWindow_CollectionChanged();
        }
Exemple #16
0
 public WorkstationMonitorService(
     ISystemMonitorDataBuilder systemMonitorDataBuilder,
     IControlManager controlManager)
 {
     this.SystemMonitorDataBuilder = systemMonitorDataBuilder;
     this.ControlManager           = controlManager;
 }
 public DesktopInputManager(IJoystickInput joystickInput, IKeyboardInput keyboardInput, IMouseScreenInput mouseScreenInput, IControlManager controlManager)
 {
     this.joystickInput    = joystickInput;
     this.keyboardInput    = keyboardInput;
     this.mouseScreenInput = mouseScreenInput;
     this.controlManager   = controlManager;
 }
Exemple #18
0
        private static void SetTsbState(IButton tsb, IControlManager cm)
        {
            // first set enable according state
            string state = cm.State.ToString();

            object entity = cm.DisplayManager.CurrentItem;

            WindowMenuInfo info = tsb.Tag as WindowMenuInfo;

            tsb.Visible = Permission.AuthorizeByRule(info.Visible, entity);
            //if (!tsb.Visible)
            //    continue;

            bool enable = true;

            if (!string.IsNullOrEmpty(info.EnableState))
            {
                enable = info.EnableState.Contains(state);
            }
            if (enable)
            {
                enable = Permission.AuthorizeByRule(info.Enable, entity);
            }
            tsb.Enabled = enable;
        }
Exemple #19
0
 /// <summary>
 /// Set the current control manager.
 /// </summary>
 /// <param name="manager">The control manager</param>
 /// <exception cref="InvalidOperationException">Throws exception when a control manager has previously been set.</exception>
 public static void RegisterManager(IControlManager manager)
 {
     if (controlManager != null)
     {
         throw new InvalidOperationException("An control manager has already been set.");
     }
     controlManager = manager;
 }
Exemple #20
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cm"></param>
 protected void SetControlManager(IControlManager cm)
 {
     if (cm == null)
     {
         throw new ArgumentNullException("cm");
     }
     m_cm = cm;
 }
        private void InitializeIoCContainer()
        {
            var container = new WindsorContainer();

            container.Install(FromAssembly.This());
            this.SystemMonitorDataBuilder = container.Resolve <ISystemMonitorDataBuilder>();
            this.ControlManager           = container.Resolve <IControlManager>();
        }
 public AlleleManager(IControlManager controlManager, IWorld world)
 {
     _controls = new List<IAlleleControl>();
     _controlManager = controlManager;
     _alleles = new List<IAllele>();
     _world = world;
     _dominantAlleles = new List<IAllele>();
 }
Exemple #23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="cm"></param>
        /// <param name="gridName"></param>
        public static void SetControlManager(this IArchiveGrid grid, IControlManager cm, string gridName)
        {
            grid.ControlManager = cm;

            grid.GridName = gridName;
            grid.SetGridPermissions();

            grid.SetDisplayManager(cm.DisplayManager, gridName);
        }
Exemple #24
0
        public static void ReadCk(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();

            m_nbeportGrab.SetLoginInfo(SystemProfileFile.DefaultUserProfile.GetValue("Hd.Options", "NetReadUserName", ""),
                                       SystemProfileFile.DefaultUserProfile.GetValue("Hd.Options", "NetReadPassword", ""));
            IList <集装箱数据> boxList = m_nbeportGrab.查询集装箱数据(ImportExportType.出口集装箱, tdh);

            if (boxList.Count <= 0)
            {
                return;
            }

            AskToReplace(masterCm, "船名航次", boxList[0].船舶英文名称 + "/" + 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.集装箱号,
                        箱型    = 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();
                }
            }
        }
Exemple #25
0
        public 紧急下达(专家任务 zjrw)
        {
            m_zjrw = zjrw;
            InitializeComponent();

            m_cm = AssociateDataControlsInControlManager(new Control[] {
                pnl区域编号, pnl时间要求始, pnl时间要求止, pnl缓急程度},
                m_gridName);
        }
Exemple #26
0
        /// <summary>
        /// 是否能变动Position(现有记录有改动的情况下要询问)
        /// </summary>
        /// <returns></returns>
        internal static bool TryCancelEdit(IControlManager cm)
        {
            if (cm == null)
            {
                return(true);
            }

            return(cm.TryCancelEdit());
        }
        internal GeneratedArchiveUnboundGrid(WindowTabInfo windowTabInfo, IControlManager cmParent)
            : base()
        {
            this.FixedHeaderRows.Add(new Xceed.Grid.ColumnManagerRow());

            this.Name = windowTabInfo.Name;
            this.Text = windowTabInfo.Text;

            Initialize(windowTabInfo, cmParent);
        }
Exemple #28
0
        public static bool InternalExecuteWindowMenu(IControlManager cm, WindowMenuInfo info, Form parentForm)
        {
            bool b = InternalExecuteWindowMenu2(cm, info, parentForm);

            if (!b)
            {
                return(InternalExecuteWindowMenu(cm.DisplayManager, info, parentForm));
            }
            return(true);
        }
 /// <summary>
 /// 粘贴数据控件值到当前数据控件
 /// </summary>
 public static void Paste(this IControlManager cm, Dictionary <string, object> values)
 {
     foreach (IDataControl dc in cm.DisplayManager.DataControls)
     {
         if (values.ContainsKey(dc.Name))
         {
             dc.SelectedDataValue = values[dc.Name];
         }
     }
 }
Exemple #30
0
        public void AssociateButton(MyButton btn, IControlManager cm, string windowMenuName)
        {
            var windowMenuInfo = ADInfoBll.Instance.GetInfos <WindowMenuInfo>("Name = '" + windowMenuName + "'")[0];

            if (windowMenuInfo == null)
            {
                throw new ArgumentException("There is no WindowMenu of " + windowMenuName);
            }
            TryAddButtons(btn, this);
            btn.Text   = windowMenuInfo.Text;
            btn.Tag    = windowMenuInfo;
            btn.Click += new EventHandler((sender, e) =>
            {
                Button tsb          = sender as Button;
                WindowMenuInfo info = tsb.Tag as WindowMenuInfo;

                MenuWindowExtention.OnButtonClick(info, tsb.FindForm());
                //UpdateContent(cm, gridName);
            });

            cm.DisplayManager.PositionChanged += new EventHandler((sender, e) =>
            {
                IDisplayManager dm2 = sender as IDisplayManager;

                if (dm2 == cm.DisplayManager)
                {
                    MenuWindowExtention.SetMenuState(this);
                }
            });
            cm.StateChanged += new EventHandler((sender, e) =>
            {
                IControlManager cm2 = sender as IControlManager;

                if (cm2 == cm)
                {
                    MenuWindowExtention.SetMenuState(this);
                }
            });

            cm.EditEnded += new EventHandler((sender, e) =>
            {
                IControlManager cm2 = sender as IControlManager;

                if (cm2 == cm)
                {
                    if (cm2.DisplayManager.InBatchOperation)
                    {
                        return;
                    }

                    MenuWindowExtention.SetMenuState(this);
                }
            });
        }
 public World(IPopulation pop, IPersonFactory pf, IRandomGenerator random, IControlManager cm, IMortalityCurve mc)
 {
     _controlManager = cm;
     _mortalityCurve = mc;
     _registeredGenes = new GeneBank(this);
     WorldSeeds.BaseGenes(_registeredGenes, _controlManager, this);
     _population = pop;
     _personFactory = pf;
     _random = random;
     SeedWorld(1001);
 }
Exemple #32
0
        public Game(DrawScreen screen, string title, IRenderManager render, IControlManager control, IActorManager actorManager)
            : base(screen.Width, screen.Height, GraphicsMode.Default, title, GameWindowFlags.Default, DisplayDevice.Default, 4, 5, GraphicsContextFlags.ForwardCompatible)
        {
            _renderManager  = render ?? throw new ArgumentNullException(nameof(render));
            _controlManager = control ?? throw new ArgumentNullException(nameof(control));
            _actorManager   = actorManager ?? throw new ArgumentNullException(nameof(actorManager));

            UpdateFrame += Update;
            RenderFrame += Render;
            _renderManager.SwapBuffers += SwapBuffers;
        }
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     screenManager         = new ScreenManager(this, graphics);
     controlManager        = new ControlManager(this);
     gameManager           = new GameManager();
     Services.AddService(typeof(IScreenManager), screenManager);
     Services.AddService(typeof(IControlManager), controlManager);
     Services.AddService(typeof(IGameManager), gameManager);
 }
 private static Locus BloodTypeAlleles(IControlManager cm, IWorld world)
 {
     var alleleMgr = new AlleleManager(cm, world);
     var bloodType = new Locus("Blood Type", alleleMgr);
     var a = new Allele("A", true, .33);
     var b = new Allele("B", true, .33);
     var o = new Allele("O", false, .33);
     bloodType.AddAllele(a);
     bloodType.AddAllele(b);
     bloodType.AddAllele(o);
     return bloodType;
 }
 public static void BaseGenes(IGeneBank geneBank, IControlManager cm, IWorld world)
 {
     CreateMortalityCurve(world);
     var geneLocations = new List<ILocus>();
     geneLocations.Add(BloodTypeAlleles(cm, world));
     geneLocations.Add(SecondAllele(cm, world));
     // TODO generate the genes!
     foreach (var gene in geneLocations)
     {
         geneBank.AddToBank(gene);
     }
 }
Exemple #36
0
        public Player(Vector3 position, float movementSpeed, Game game)
        {
            keys               = new List <Key>();
            controlManager     = (IControlManager)game.Services.GetService(typeof(IControlManager));
            Camera             = new Camera(Position, new Vector3(0, 0, 0), movementSpeed, movementSpeed * 1.5f, game);
            Height             = 0.5f;
            this.Position      = position;
            this.position.Y    = Height;
            this.MovementSpeed = movementSpeed;

            BoundingSphere = new BoundingSphere(position, 0.1f);
        }
Exemple #37
0
        public 电子作业单(车辆作业 clzy)
        {
            System.Diagnostics.Debug.Assert(clzy != null, "电子作业单车辆作业不能为空");

            InitializeComponent();
            m_clzy = clzy;

            m_cm = AssociateDataControlsInControlManager(new Control[] {
                pnl作业号, pnl作业路线, pnl车牌号, pnl驾驶员, pnl任务性质, pnl开始时间, pnl疏港期限, pnl进港还箱期限, pnl备注,pnl车载Id号},
                "实时监控_车辆作业_电子作业单");

            m_作业流程 = base.AssociateBoundGrid(pnl作业流程, "实时监控_车辆作业_电子作业单_作业流程");
        }
 public World(IPopulation pop, IPersonFactory pf, IControlManager controlManager, IMortalityCurve mortalityCurve, IRandomGenerator random)
 {
     if (pop?.Populus?.Count > 0) pop.Populus.Clear();
     _random = random;
     _population = pop;
     _registeredGenes = new GeneBank(controlManager, this);
     _personFactory = pf;
     _mortalityCurve = mortalityCurve;
     _controlManager = controlManager;
     WorldSeeds.BaseGenes(_registeredGenes, controlManager, this);
     SeedWorld(1000);
     _population?.UpdatePopulus();
 }
        /// <summary>
        /// 设置控件状态
        /// </summary>
        public static void UpdateControlsState(this IControlManager cm)
        {
            if (cm.State == StateType.Delete)
            {
                return;
            }

            foreach (IDataControl dc in cm.DisplayManager.DataControls)
            {
                dc.SetState(cm.State);
            }

            cm.StateControls.SetState(cm.State);
        }
        public override void Entrypoint()
        {
            IConnector      connector = this.StartUpContext.Connector;
            IControlManager manager   = connector.ControlManager;

            StringSearcherControl control = new StringSearcherControl(this.StartUpContext.Connector);

            control.Dock = DockStyle.Fill;
            TabPage tabPage = new TabPage("String Searcher");

            tabPage.Controls.Add(control);

            manager.AddTabPage(tabPage);
        }
Exemple #41
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();
                }
            }
        }
 private static Locus SecondAllele(IControlManager cm, IWorld world)
 {
     var mgr = new AlleleManager(cm, world);
     var locus = new Locus("Eye Color", mgr);
     locus.isVisibleLocus = true;
     var h = new Allele("H", false, .4);
     var bl = new Allele("B", true, .25);
     var red = new Allele("R", false, .1);
     var blue = new Allele("L", false, .25);
     locus.AddAllele(h);
     locus.AddAllele(bl);
     locus.AddAllele(blue);
     locus.AddAllele(red);
     return locus;
 }
        private void 实时监控经过地名时间_Load(object sender, EventArgs e)
        {
            m_cm = AssociateDataControlsInControlManager(new Control[] { pnl途径地, pnl途径地时间 },
                "实时监控_车辆作业_途径时间");
            m_cm.AllowInsert = true;
            m_cm.AddNew();

            //switch (this.Text)
            //{
            //    case "起始地":
            //        m_cm.DisplayManager.DataControls["途径地"].SelectedDataValue = m_clzy.专家任务.起始地编号;
            //        break;
            //    case "途径地":
            //        m_cm.DisplayManager.DataControls["途径地"].SelectedDataValue = m_clzy.专家任务.途径地编号;
            //        break;
            //    case "终止地":
            //        m_cm.DisplayManager.DataControls["途径地"].SelectedDataValue = m_clzy.专家任务.终止地编号;
            //        break;
            //    default:
            //        throw new ArgumentOutOfRangeException("实时监控经过地名 out of range");
            //}

            if (m_cm.DisplayManager.DataControls["途径地时间"].SelectedDataValue == null)
            {
                m_cm.DisplayManager.DataControls["途径地时间"].SelectedDataValue = System.DateTime.Now;
            }

            m_cm.DisplayManager.DataControls["途径地编号"].ReadOnly = true;
            if (m_clzy.最新作业状态 == null || string.IsNullOrEmpty(m_clzy.最新作业状态.作业地点))
            {
                m_cm.DisplayManager.DataControls["途径地编号"].SelectedDataValue = m_areas[0];
            }
            else
            {
                string[] ss = m_clzy.最新作业状态.作业地点.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);

                if (ss.Length < m_areas.Length)
                {
                    m_cm.DisplayManager.DataControls["途径地编号"].SelectedDataValue = m_areas[ss.Length];
                }
            }

            if (m_cm.DisplayManager.DataControls["途径地编号"].SelectedDataValue == null)
            {
                this.Close();
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="grid"></param>
        public ArchiveGridHelper(IArchiveGrid grid)
        {
            m_grid = grid;
            m_cm = grid.ControlManager;

            InitializeComponent();

            this.tsmDelete.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconErase.png").Reference;
            this.tsmDeleteBatch.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconErase.png").Reference;
            this.tsmDelete.Visible = false;

            GridInfo gridInfo = ADInfoBll.Instance.GetGridInfo(m_grid.GridName);
            if (Authority.AuthorizeByRule(gridInfo.AllowInnerMenu) || Authority.IsDeveloper())
            {
                m_grid.GridHelper.MergeContenxtMenuStripForCell(this.contextMenuStrip1);
            }
        }
        internal static bool Save(IControlManager cm, SaveType saveType)
        {
            if (cm.State == StateType.Edit)
            {
                if (!cm.SaveCurrent())
                {
                    return false;
                }
            }

            任务 entity = cm.DisplayManager.CurrentItem as 任务;
            switch (saveType)
            {
                case SaveType.正式备案确认:
                    任务Dao.生成任务号(entity);
                    break;
                case SaveType.拒绝确认:
                    entity.是否拒绝 = true;
                    entity.IsActive = false;
                    entity.任务号 = null;
                    break;
                default:
                    break;
            }

            bool ret;
            if (cm.State == StateType.Edit)
            {
                ret = cm.EndEdit(true);
            }
            else
            {
                try
                {
                    cm.Dao.Update(entity);
                    ret = true;
                }
                catch (Exception ex)
                {
                    ExceptionProcess.ProcessWithNotify(ex);
                    ret = false;
                }
            }

            return ret;
        }
        private void 实时监控异常处理_Load(object sender, EventArgs e)
        {
            m_cm = AssociateDataControlsInControlManager(new Control[] { pnl异常情况, pnl处理时间, pnl处理结果 },
                "实时监控_车辆作业_异常处理");
            m_cm.AddNew();

            using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<车辆作业>())
            {
                var clzy = rep.Get<车辆作业>(m_clzy.ID);

                m_cm.DisplayManager.DataControls["异常情况"].ReadOnly = true;
                m_cm.DisplayManager.DataControls["异常情况"].SelectedDataValue = clzy.最新作业状态.异常情况;

                m_cm.DisplayManager.DataControls["处理时间"].SelectedDataValue = DateTime.Now;
            }
            m_dao.处理作业异常(m_clzy, null, null, true);
        }
        public 备案明细窗体(IControlManager cm, string gridName)
        {
            InitializeComponent();

            m_cm = cm;
            m_gridName = gridName;

            MyTemplateForm.AssociateDataControls(new Control[] {
                pnl预录入号, pnl任务性质, pnl转关箱标志, pnl委托人, pnl委托时间, pnl委托联系人, pnl提单号,
                pnl箱号, pnl箱型, pnl箱属船公司, pnl船名, pnl航次,pnl货名, pnl货物特征, pnl价值, pnl重量,
                pnl提箱点, pnl提箱时间要求, pnl还箱进港点, pnl还箱进港时间要求,
                pnl装货地, pnl装货地详细地址, pnl装货时间要求始, pnl装货时间要求止, pnl装货联系人, pnl装货联系手机, pnl装货联系座机,
                pnl卸货地, pnl卸货地详细地址, pnl卸货时间要求始, pnl卸货时间要求止, pnl卸货联系人, pnl卸货联系手机, pnl卸货联系座机,
                pnl备注,pnl卸货地单位,pnl装货地单位}, cm.DisplayManager, gridName, false, this, m_labels);

            m_cm.DisplayManager.SelectedDataValueChanged += new EventHandler<SelectedDataValueChangedEventArgs>(DisplayManager_SelectedDataValueChanged);
            //m_cm.DisplayManager.DataControls["任务性质"].SelectedDataValueChanged += new EventHandler(任务预备案_任务性质_SelectedDataValueChanged);
            m_cm.DisplayManager.DataControls["委托人编号"].SelectedDataValueChanged += new EventHandler(任务预备案_委托人编号_SelectedDataValueChanged);
        }
Exemple #48
0
        private Window2DTest()
            : base(800, 600, "TriEngine2D Test")
        {
            Services.Provide(new InputManager(this), new AudioManager());
            _controlManager = new ControlManager();
            ResourceManager.LoadSong("unknown1", "menu1.ogg");
            ResourceManager.LoadSong("call", "menu2.ogg");
            ResourceManager.LoadSong("pirates", "menu3.ogg").IsLooped = true;
            ResourceManager.LoadSound("test", "test1.wav");
            ResourceManager.LoadSound("test2", "test2.wav");
            //Services.Audio.LoadSong("unknown2", "menu4.ogg");
            _font = ResourceManager.LoadFont("Anon", "Anonymous.ttf", 32);
            _control = new Label
            {
                Rectangle = new Rectangle(100, 100, 250, 250),
                Color = Color.Green,
                Alignment = QFontAlignment.Left,
                Text = "Test"
            };
            ((Label) _control).SetFont(_font);
            _control.Clicked += ControlClicked;
            _controlManager.AddControl(_control);
            _text = new TextObject("Hello, World!", _font, new Point<int>(100, 50), QFontAlignment.Left);
            _label = new Label();
            _label.SetFont(_font);
            _label.Position = new Point<int>(250, 300);
            _label.Text = "Foo Bar Baz";
            _label.Alignment = QFontAlignment.Right;
            _controlManager.AddControl(_label);
            _link = new LinkLabel();
            _link.SetFont(_font);
            _link.Position = new Point<int>(300, 500);

            _link.Text = "Go to google";
            _link.Alignment = QFontAlignment.Centre;
            _link.Url = "http://www.google.com/";
            _controlManager.AddControl(_link);

            _triangle = new Triangle(new Point<int>(100, 25), new Point<int>(50, 100), new Point<int>(150, 100));
            _rectangle = new Graphics.Rectangle(new Rectangle(200, 100, 100, 200));
        }
        private static void AskToReplace(IControlManager cm, string propertyName, object destValue)
        {
            if (propertyName == null || destValue == null)
            {
                return;
            }

            bool replace = true;

            if (//cm.DisplayManager.DataControls[propertyName].SelectedDataValue == null && destValue != null ||
                cm.DisplayManager.DataControls[propertyName].SelectedDataValue != null && destValue == null
                || (cm.DisplayManager.DataControls[propertyName].SelectedDataValue != null && destValue != null &&
                    cm.DisplayManager.DataControls[propertyName].SelectedDataValue.ToString() != destValue.ToString()) && propertyName != "报关单快照")
            {
                if (!MessageForm.ShowYesNo(propertyName + "是否要替换成" + (destValue == null ? "空" : destValue.ToString()), "网上导入"))
                {
                    replace = false;
                }
            }
            if (replace)
            {
                cm.DisplayManager.DataControls[propertyName].SelectedDataValue = destValue;
            }
        }
 /// <summary>
 /// 创建IControlCheckExceptionProcess
 /// </summary>
 /// <param name="cm"></param>
 /// <returns></returns>
 public virtual IControlCheckExceptionProcess CreateControlCheckExceptionProcess(IControlManager cm)
 {
     return null;
 }
 /// <summary>
 /// 创建IStateControlCollection
 /// </summary>
 /// <param name="cm"></param>
 /// <returns></returns>
 public virtual IStateControlCollection CreateStateControlCollection(IControlManager cm)
 {
     IStateControlCollection ret = new StateControlCollection();
     ret.ParentManager = cm;
     return ret;
 }
 public ValidationHelper(IControlManager dm)
 {
     m_cm = dm;
 }
 /// <summary>
 /// 创建ICheckControlCollection
 /// </summary>
 /// <param name="cm"></param>
 /// <returns></returns>
 public virtual ICheckControlCollection CreateCheckControlCollection(IControlManager cm)
 {
     ICheckControlCollection ret = new CheckControlCollection();
     ret.ParentManager = cm;
     return ret;
 }
 public abstract void OpenProject(IControlManager manager, Project project);
 protected virtual void Dispose(bool disposing)
 {
     validationProvider1.Dispose();
     m_cm = null;
 }
 public override void OpenProject(IControlManager manager, Project project)
 {
     manager.OpenDocumentContents.Add(new ProjectDocumentContent(project, new NetProjectSettingsControl((NetProject)project)));
 }
Exemple #57
0
        public static void AddFees(凭证 master, IList<费用> list, IControlManager<凭证费用明细> detailCm, bool add, 收付标志? asDzd收付标志)
        {
            if (list == null)
                return;

            List<费用> newList = new List<费用>();
            foreach (费用 i in list)
            {
                if (i.凭证费用明细 == null)
                {
                    newList.Add(i);
                }
            }

            IList<凭证费用明细> ret = new List<凭证费用明细>();
            if (!asDzd收付标志.HasValue)
            {
                // 费用实体类型. 收付标志, 费用项编号, 相关人编号
                Dictionary<Tuple<int, 收付标志, string, string>, IList<费用>> dict = Utility.GroupFyToPzYsyf(newList);

                foreach (KeyValuePair<Tuple<int, 收付标志, string, string>, IList<费用>> kvp in dict)
                {
                    凭证费用明细 pzs1 = new 凭证费用明细();

                    decimal sum = 0;
                    foreach (费用 k4 in kvp.Value)
                    {
                        sum += k4.金额.Value;
                        k4.凭证费用明细 = pzs1;
                    }

                    //string s = NameValueMappingCollection.Instance.FindNameFromId("信息_业务类型_全部", kvp.Key.Item1);
                    //if (string.IsNullOrEmpty(s))
                    //{
                    //    pzs1.业务类型编号 = null;
                    //}
                    //else
                    //{
                    //    pzs1.业务类型编号 = kvp.Key.Item1;
                    //}
                    pzs1.业务类型编号 = kvp.Key.Item1;

                    pzs1.费用 = kvp.Value;
                    pzs1.费用项编号 = kvp.Key.Item3;
                    pzs1.金额 = sum;
                    pzs1.收付标志 = kvp.Key.Item2;
                    pzs1.相关人编号 = kvp.Key.Item4;

                    // pzs1.凭证 = pz;

                    ret.Add(pzs1);
                }
            }
            else
            {
                Dictionary<Tuple<int, string>, IList<费用>> dict = Utility.GroupFyToDzdYsyf(newList);

                foreach (KeyValuePair<Tuple<int, string>, IList<费用>> kvp in dict)
                {
                    凭证费用明细 pzs1 = new 凭证费用明细();

                    decimal sum = 0;
                    foreach (费用 k4 in kvp.Value)
                    {
                        if (k4.收付标志 == asDzd收付标志.Value)
                        {
                            sum += k4.金额.Value;
                        }
                        else
                        {
                            sum -= k4.金额.Value;
                        }
                        k4.凭证费用明细 = pzs1;
                    }

                    //string s = NameValueMappingCollection.Instance.FindNameFromId("信息_业务类型_全部", kvp.Key.First);
                    //if (string.IsNullOrEmpty(s))
                    //{
                    //    pzs1.业务类型编号 = null;
                    //}
                    //else
                    //{
                    //    pzs1.业务类型编号 = kvp.Key.First;
                    //}
                    pzs1.业务类型编号 = kvp.Key.Item1;

                    pzs1.费用 = kvp.Value;
                    pzs1.费用项编号 = "000";    // 常规应收应付
                    pzs1.金额 = sum;
                    pzs1.收付标志 = asDzd收付标志.Value;
                    pzs1.相关人编号 = kvp.Key.Item2;

                    // pzs1.凭证 = pz;

                    ret.Add(pzs1);
                }
            }

            if (add)
            {
                foreach (凭证费用明细 item in ret)
                {
                    detailCm.AddNew();
                    detailCm.DisplayManager.Items[detailCm.DisplayManager.Position] = item;
                    detailCm.EndEdit();

                    foreach (费用 i in item.费用)
                    {
                        i.凭证费用明细 = item;
                    }
                }
            }
            else
            {
                if (ret.Count == 0)
                    return;

                System.Diagnostics.Debug.Assert(ret.Count <= 1, "选出多个凭证费用明细,请查证!");
                System.Diagnostics.Debug.Assert(ret[0].费用项编号 == detailCm.DisplayManagerT.CurrentEntity.费用项编号, "凭证费用明细费用项和选择的费用项不同!");
                System.Diagnostics.Debug.Assert(ret[0].相关人编号 == detailCm.DisplayManagerT.CurrentEntity.相关人编号, "凭证费用明细费用项和选择的相关人不同!");
                System.Diagnostics.Debug.Assert(ret[0].收付标志 == detailCm.DisplayManagerT.CurrentEntity.收付标志, "凭证费用明细费用项和选择的相关人不同!");

                using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<费用>())
                {
                    rep.Initialize(detailCm.DisplayManagerT.CurrentEntity.费用, detailCm.DisplayManagerT.CurrentEntity);
                }

                if (detailCm.DisplayManagerT.CurrentEntity.费用 == null)
                {
                    detailCm.DisplayManagerT.CurrentEntity.费用 = new List<费用>();
                }
                foreach (费用 i in ret[0].费用)
                {
                    i.凭证费用明细 = detailCm.DisplayManagerT.CurrentEntity;
                }

                detailCm.EditCurrent();
                detailCm.EndEdit();
            }
        }
Exemple #58
0
 public static void AddFees(凭证 master, IList<费用> list, IControlManager<凭证费用明细> detailCm)
 {
     AddFees(master, list, detailCm, true, null);
 }
 /// <summary>
 /// SetControlManager
 /// </summary>
 /// <param name="cm"></param>
 /// <param name="gridName"></param>
 public void SetControlManager(IControlManager cm, string gridName)
 {
     ArchiveGridExtention.SetControlManager(this, cm, gridName);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="cm"></param>
 protected void SetControlManager(IControlManager cm)
 {
     if (cm == null)
     {
         throw new ArgumentNullException("cm");
     }
     m_cm = cm;
 }