public FormHistoryCallOrder(string telephone, Action<object, EventArgs> orderAction, ref GoodsGroup currentGoodsGroup)
 {
     m_Telephone = telephone;
     m_OrderAction = orderAction;
     m_GoodsGroup = currentGoodsGroup;
     InitializeComponent();
 }
Beispiel #2
0
        private void btnGroup_Click(object sender, EventArgs e)
        {
            CrystalButton btnGroup = sender as CrystalButton;
            if (btnGroup == null) return;
            if (btnGroup.Tag is GoodsGroup)
            {
                _currentGoodsGroup = btnGroup.Tag as GoodsGroup;
                Color pressedColor = ConstantValuePool.PressedColor;
                foreach (ButtonStyle btnStyle in ConstantValuePool.ButtonStyleList)
                {
                    if (_currentGoodsGroup.ButtonStyleID.Equals(btnStyle.ButtonStyleID))
                    {
                        pressedColor = ColorConvert.RGB(btnStyle.ClickedBackColor);
                        break;
                    }
                }
                btnGroup.BackColor = pressedColor;
                if (_prevPressedButton == null)
                {
                    _prevPressedButton = btnGroup;
                }
                else
                {
                    if (btnGroup.Text != _prevPressedButton.Text)
                    {
                        _prevPressedButton.BackColor = _prevPressedButton.DisplayColor;
                    }
                    _prevPressedButton = btnGroup;
                }
                _itemPageIndex = 0;
                DisplayGoodsButton();
            }
            if (btnGroup.Tag is DetailsGroup)
            {
                _prevPressedButton.BackColor = _prevPressedButton.DisplayColor;

                DetailsGroup detailsGroup = btnGroup.Tag as DetailsGroup;
                Color pressedColor = ConstantValuePool.PressedColor;
                foreach (ButtonStyle btnStyle in ConstantValuePool.ButtonStyleList)
                {
                    if (detailsGroup.ButtonStyleID.Equals(btnStyle.ButtonStyleID))
                    {
                        pressedColor = ColorConvert.RGB(btnStyle.ClickedBackColor);
                        break;
                    }
                }
                btnGroup.BackColor = pressedColor;
                _prevPressedButton = btnGroup;
                if (detailsGroup.DetailsList != null && detailsGroup.DetailsList.Count > 0)
                {
                    _currentDetailsGroup = detailsGroup;
                    _itemPageIndex = 0;
                    DisplayDetailButton();
                }
            }
        }
Beispiel #3
0
 private void btnRecords_Click(object sender, EventArgs e)
 {
     string telephone = this.txtTelephone.Text.Trim();
     if (!string.IsNullOrEmpty(telephone))
     {
         GoodsGroup tempGoodsGroup = null;
         if (_currentGoodsGroup != null)
         {
             //如果存在,则将对象暂存局部变量
             tempGoodsGroup = CopyExtension.Clone<GoodsGroup>(_currentGoodsGroup);
         }
         else
         {
             _currentGoodsGroup = new GoodsGroup();
         }
         FormHistoryCallOrder formHistoryOrder = new FormHistoryCallOrder(telephone, btnItem_Click, ref _currentGoodsGroup);
         formHistoryOrder.ShowDialog();
         _currentGoodsGroup = tempGoodsGroup;
     }
 }