Exemplo n.º 1
0
        private void 前一个ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectedToolButton(this.前一个ToolStripMenuItem);
            if (CurrentModel == null)
            {
                MessageBox.Show("当前记录为空,请选择记录!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            Code.Common.Iterator <LeadModel> iteratorSS = new ConcreteIterator <LeadModel>(ItemsSource);
            var cModel = ItemsSource.FirstOrDefault(x => x.ID == CurrentModel.ID);

            if (cModel != null)
            {
                iteratorSS.SetCurrent(cModel);
                if (iteratorSS.MoveBefore())
                {
                    CurrentModel = iteratorSS.Before();
                    BindValue(CurrentModel);
                }
                else
                {
                    MessageBox.Show("已经到了最前的记录!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }
        }