示例#1
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                this.btnSubmit.Enabled = false;

                if (InputCheck())
                {
                    if (this._currentDeptId == 0)
                    {
                        AddDepartmentInfo();
                    }
                    else
                    {
                        UpdateDepartmentInfo();
                    }

                    RefreshEvent?.Invoke();

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
            finally
            {
                this.btnSubmit.Enabled = true;
            }
        }
示例#2
0
 private void btnRefresh_Click(object sender, RoutedEventArgs e)
 {
     if (RefreshEvent != null)
     {
         RefreshEvent.Invoke();
     }
 }
示例#3
0
        /// <summary>
        /// 返回按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnReturn_Click(object sender, EventArgs e)
        {
            if (this._saveSucceed)
            {
                RefreshEvent?.Invoke();
            }

            this.Close();
        }
示例#4
0
 private void _dialogIDApplication_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_submitSucceedFlag ||
         (this._embedIDOV != null && this._embedIDOV.VoteSucceedFlag) ||
         (this._embedIDOA != null && this._embedIDOA.VoteSucceedFlag) ||
         (this._embedIDOE != null && this._embedIDOE.ProcessSucceedFlag))
     {
         RefreshEvent?.Invoke();
     }
 }
示例#5
0
        /// <summary>
        /// 返回按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnReturn_Click(object sender, EventArgs e)
        {
            if (this._saveSucceed)
            {
                var industryId = int.Parse(this.cbIndustry.SelectedValue());

                RefreshEvent?.Invoke(industryId);
            }

            this.Close();
        }
 /// <summary>
 /// 刷新单元格
 /// </summary>
 public void Refresh()
 {
     if (MergeDataEvent != null)
     {
         MergeDataEvent.Invoke(this, HandlerMergeCells());
     }
     if (RefreshEvent != null)
     {
         RefreshEvent.Invoke(this);
     }
 }
示例#7
0
        private void HandleInventoryUpdate(Action callback)
        {
            AllItems.Clear();
            AllItems.AddRange(VirtualItems);
            AllItems.AddRange(Subscriptions);

            UpdateVirtualCurrencyBalanceEvent?.Invoke(Balance);
            UpdateItemsEvent?.Invoke(VirtualItems);
            UpdateSubscriptionsEvent?.Invoke(Subscriptions);
            RefreshEvent?.Invoke();
            callback?.Invoke();
        }
示例#8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (this.luPrincipal.EditValue == null || this.luPrincipal.EditValue.ToString() == "nulltext")
            {
                DXMessage.ShowTips("请选择主要负责人!");
                return;
            }

            var principal = this.luPrincipal.SelectedValue();

            var logModel = new InvestmentDecisionStockPoolLog()
            {
                StockCode    = StockCode,
                Principal    = principal,
                OperatorCode = LoginInfo.CurrentUser.UserCode,
                OperateTime  = _commonService.GetCurrentServerTime(),
            };

            //修改股票池的场合
            if (this._isEdit)
            {
                var stockPool = _IDService.GetIDStockPoolByCode(StockCode);
                stockPool.Principal = principal;
                stockPool.Remarks   = this.memoRemarks.Text.Trim();

                _IDService.UpdateIDStockPool(stockPool);

                logModel.Type = (int)EnumLibrary.OperateType.Edit;
            }
            //添加股票池的场合
            else
            {
                var stockPool = new InvestmentDecisionStockPool
                {
                    StockCode = this.txtCode.Text.Trim(),
                    StockName = this.txtName.Text.Trim(),
                    Principal = principal,
                    Remarks   = this.memoRemarks.Text.Trim(),
                };

                _IDService.AddIDStockPool(stockPool);

                logModel.Type = (int)EnumLibrary.OperateType.Add;
            }

            //添加股票池操作日志
            _IDService.AddIDStockPoolLog(logModel);

            RefreshEvent?.Invoke();

            this.Close();
        }
示例#9
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var targetPrincipal = this.luTarget.SelectedValue();

            var bandPrincipal = this.luBand.SelectedValue();

            var logModel = new StockPoolLog()
            {
                StockId         = _stockId,
                BandPrincipal   = bandPrincipal,
                TargetPrincipal = targetPrincipal,
                OperatorCode    = LoginInfo.CurrentUser.UserCode,
                OperateTime     = _commonService.GetCurrentServerTime(),
            };

            //修改股票池的场合
            if (this._isEdit)
            {
                var stockPool = _stockService.GetStockPoolInfoByStockId(this._stockId);
                stockPool.BandPrincipal   = bandPrincipal;
                stockPool.TargetPrincipal = targetPrincipal;
                stockPool.StockId         = _stockId;
                stockPool.Remarks         = this.memoRemarks.Text.Trim();

                _stockService.UpdateStockPoolInfo(stockPool);

                logModel.Type = (int)EnumLibrary.OperateType.Edit;
            }
            //添加股票池的场合
            else
            {
                var stockPool = new StockPoolInfo
                {
                    BandPrincipal   = bandPrincipal,
                    TargetPrincipal = targetPrincipal,
                    StockId         = _stockId,
                    Remarks         = this.memoRemarks.Text.Trim(),
                };

                _stockService.AddStockPoolInfo(stockPool);

                logModel.Type = (int)EnumLibrary.OperateType.Add;
            }

            //添加股票池操作日志
            _stockService.AddStockPoolLog(logModel);

            RefreshEvent?.Invoke();

            this.Close();
        }
示例#10
0
 private void btnModify_Click(object sender, RoutedEventArgs e)
 {
     if (ModifyEvent != null)
     {
         bool?result = ModifyEvent.Invoke();
         if (result != null && result.Value)
         {
             if (RefreshEvent != null)
             {
                 RefreshEvent.Invoke();
             }
         }
     }
 }
示例#11
0
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     if (DeleteEvent != null)
     {
         bool?result = DeleteEvent.Invoke();
         if (result != null && result.Value)
         {
             if (RefreshEvent != null)
             {
                 RefreshEvent.Invoke();
             }
         }
     }
 }
示例#12
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                this.btnOk.Enabled = false;

                if (!InputCheck())
                {
                    return;
                }

                //添加
                if (!this._isEdit)
                {
                    var reasonContent = new DecisionReasonContent();

                    reasonContent.CategoryId = int.Parse(this.treeListLookUpEdit1.SelectedValue());
                    reasonContent.Content    = this.memoContent.Text.Trim();
                    reasonContent.Title      = this.txtTitle.Text.Trim();
                    reasonContent.Remarks    = null;

                    _IDService.AddIDReasonContent(reasonContent);
                }
                //修改
                else
                {
                    var reasonContent = _IDService.GetIDReasonContent(ContentId);
                    reasonContent.CategoryId = int.Parse(this.treeListLookUpEdit1.SelectedValue());
                    reasonContent.Content    = this.memoContent.Text.Trim();
                    reasonContent.Title      = this.txtTitle.Text.Trim();

                    _IDService.UpdateIDReasonContent(reasonContent);
                }

                var categoryId = int.Parse(this.treeListLookUpEdit1.SelectedValue());

                RefreshEvent?.Invoke(categoryId);

                this.Close();
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
            finally
            {
                this.btnOk.Enabled = true;
            }
        }
示例#13
0
        /// <summary>
        /// Entry point for the console app.
        ///
        /// There are 3 available commands.
        /// If you enter a number, the app returns that many users from its initial users cache.
        /// If you enter "exit", the app quits.
        /// If you enter anything else, the app refreshes its cache and returns 3 random users from the refreshed cache.
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            SuggestionStream.Dump(d => $"{d.Id} - {d.Login}", "");

            while (true)
            {
                var command = Console.ReadLine();
                if (command == "exit")
                {
                    Environment.Exit(0);
                }
                if (int.TryParse(command, out var count))
                {
                    SuggestEvent?.Invoke("app", count);
                }
                else
                {
                    RefreshEvent?.Invoke(null, null);
                }
            }
        }
示例#14
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                this.btnSubmit.Enabled = false;

                if (SubmitProcess())
                {
                    RefreshEvent?.Invoke();

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
            finally
            {
                this.btnSubmit.Enabled = true;
            }
        }
示例#15
0
 private void OnRefresh(object sender, EventArgs args) => RefreshEvent?.Invoke(sender, args);
示例#16
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                this.btnOk.Enabled = false;

                if (!InputCheck())
                {
                    return;
                }

                //添加用户
                if (!this._isEdit)
                {
                    var newUser = new UserInfo();

                    newUser.AllotFund      = string.IsNullOrEmpty(txtAllotFund.Text.Trim()) ? 0 : decimal.Parse(txtAllotFund.Text.Trim());
                    newUser.Code           = txtCode.Text.Trim();
                    newUser.CooperatorCode = luCooperator.SelectedValue();
                    newUser.DepartmentId   = int.Parse(luDepartment.SelectedValue());
                    newUser.IsAdmin        = chkAdmin.Checked ? true : false;
                    newUser.IsDealer       = chkDealer.Checked ? true : false;
                    newUser.IsDeleted      = false;
                    newUser.IsManager      = chkManager.Checked ? true : false;
                    newUser.Name           = txtName.Text.Trim();
                    newUser.Password       = txtCode.Text.Trim();
                    newUser.PositionCode   = int.Parse(cbPosition.SelectedValue());
                    newUser.Remarks        = memoRemarks.Text.Trim();
                    newUser.RandomKey      = null;
                    newUser.Superior       = luSuperior.SelectedValue();
                    newUser.TypeCode       = 1;

                    var isExisted = _userService.IsExistedUser(newUser.Code);

                    if (!isExisted)
                    {
                        _userService.AddUserInfo(newUser);

                        this._userId = newUser.Id;
                    }
                    else
                    {
                        DXMessage.ShowTips("系统已经存在该用户编号,无法添加!");
                        this.txtCode.Focus();
                        return;
                    }
                }
                //修改用户
                else
                {
                    var user = _userService.GetUserInfoById(_userId);

                    user.AllotFund      = string.IsNullOrEmpty(txtAllotFund.Text.Trim()) ? 0 : decimal.Parse(txtAllotFund.Text.Trim());
                    user.Code           = txtCode.Text.Trim();
                    user.CooperatorCode = luCooperator.SelectedValue();
                    user.DepartmentId   = int.Parse(luDepartment.SelectedValue());
                    user.IsAdmin        = chkAdmin.Checked ? true : false;
                    user.IsDealer       = chkDealer.Checked ? true : false;
                    user.IsManager      = chkManager.Checked ? true : false;
                    user.Name           = txtName.Text.Trim();
                    user.PositionCode   = int.Parse(cbPosition.SelectedValue());
                    user.Remarks        = memoRemarks.Text.Trim();
                    user.Superior       = luSuperior.SelectedValue();

                    var isExisted = _userService.IsExistedUser(user.Code, user.Id);

                    if (!isExisted)
                    {
                        _userService.UpdateUserInfo(user);
                    }
                    else
                    {
                        DXMessage.ShowTips("系统已经存在该用户编号,无法修改!");
                        this.txtCode.Focus();
                        return;
                    }
                }

                var departmentId = int.Parse(luDepartment.SelectedValue());

                RefreshEvent?.Invoke(departmentId);

                this.Close();
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
            finally
            {
                this.btnOk.Enabled = true;
            }
        }
示例#17
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                this.btnLogin.Enabled  = false;
                this.btnCancel.Enabled = false;

                if (txtAccount.Text.Length == 0)
                {
                    DXMessage.ShowTips("请输入账号!");
                    txtAccount.Focus();
                    return;
                }

                if (txtPassword.Text.Length == 0)
                {
                    DXMessage.ShowTips("请输入密码!");
                    txtPassword.Focus();
                    return;
                }

                var userCode = txtAccount.Text;
                var pwd      = txtPassword.Text;
                var info     = _userService.GetUserInfoByCode(userCode);

                if (info == null)
                {
                    DXMessage.ShowTips("账号不存在,请重新输入!");
                    txtAccount.Focus();
                    return;
                }

                if (info.IsDeleted)
                {
                    DXMessage.ShowTips("该账号已被禁用,请联系管理员!");
                    txtAccount.Focus();
                    return;
                }

                if (info.Password != pwd)
                {
                    DXMessage.ShowTips("密码不正确,请重新输入!");
                    txtPassword.Text = string.Empty;
                    txtPassword.Focus();
                    return;
                }

                SaveLoginInfo(info);

                SaveLoginLog(info);

                SaveLoginInfoToFile();

                this.DialogResult = DialogResult.OK;

                if (this.ReLogin)
                {
                    RefreshEvent?.Invoke();
                }

                this.Close();
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
            finally
            {
                this.btnLogin.Enabled  = true;
                this.btnCancel.Enabled = true;
            }
        }
示例#18
0
 public void ForceRefresh()
 {
     RefreshEvent.Invoke();
 }
示例#19
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!InputCheck())
            {
                return;
            }

            //编辑的场合
            if (this._isEdit)
            {
                var stockModel = _stockService.GetStockInfoById(_stockId);

                if (stockModel.Code != this.txtStockCode.Text.Trim())
                {
                    var sameCodeStock = _stockService.GetStockInfoByCode(this.txtStockCode.Text.Trim());
                    if (sameCodeStock != null)
                    {
                        DXMessage.ShowTips("该股票代码已经存在,无法修改!");
                        this.txtStockCode.Focus();
                        return;
                    }
                }

                if (stockModel.Name != this.txtStockName.Text.Trim())
                {
                    var sameNameStock = _stockService.GetStockInfoByName(this.txtStockName.Text.Trim());
                    if (sameNameStock != null)
                    {
                        DXMessage.ShowTips("该股票名称已经存在,无法修改!");
                        this.txtStockName.Focus();
                        return;
                    }
                }

                stockModel.Code      = this.txtStockCode.Text.Trim();
                stockModel.Name      = this.txtStockName.Text.Trim();
                stockModel.FullCode  = stockModel.Code + this.cbTradeMarket.SelectedValue();
                stockModel.Remarks   = this.memoRemarks.Text.Trim();
                stockModel.IsDeleted = false;

                _stockService.UpdateStockInfo(stockModel);
            }
            //添加的场合
            else
            {
                var stockModel = new StockInfo
                {
                    Code      = this.txtStockCode.Text.Trim(),
                    Name      = this.txtStockName.Text.Trim(),
                    FullCode  = this.txtStockCode.Text.Trim() + this.cbTradeMarket.SelectedValue(),
                    Remarks   = this.memoRemarks.Text.Trim(),
                    IsDeleted = false,
                };

                var sameCodeStock = _stockService.GetStockInfoByCode(stockModel.Code);
                if (sameCodeStock != null)
                {
                    DXMessage.ShowTips("该股票代码已经存在,无法添加!");
                    this.txtStockCode.Focus();
                    return;
                }

                var sameNameStock = _stockService.GetStockInfoByName(stockModel.Name);
                if (sameNameStock != null)
                {
                    DXMessage.ShowTips("该股票名称已经存在,无法添加!");
                    this.txtStockName.Focus();
                    return;
                }

                _stockService.AddStockInfo(stockModel);
            }

            RefreshEvent?.Invoke();

            this.Close();
        }
示例#20
0
 /// <summary>
 /// Invokes Refresh event if it's not null
 /// </summary>
 /// <param name="sender">Object that called this method</param>
 public static void Refresh(object sender)
 {
     RefreshEvent?.Invoke(sender, EventArgs.Empty);
 }
示例#21
0
 private static void OnRefreshEvent(AbstractManager manager)
 {
     RefreshEvent?.Invoke(manager);
 }