Пример #1
0
        /// <summary>
        /// 创建店员
        /// </summary>
        public void CreateClerkExecute()
        {
            ClerkAccountInfo         = new BzjClerk();
            ClerkAccountInfo.AgentId = _accName;
            ClerkAuthInfo            = new DealerAuthority();
            ClerkAccountWindow window = new ClerkAccountWindow()
            {
                AccNameVisibility = Visibility.Visible,
                Owner             = Application.Current.MainWindow,
                DataContext       = this
            };

            if (window.ShowDialog() == true)
            {
                ClerkAccountInfo.ClerkId = _accName + ClerkAccountInfo.ClerkId;//店员账号默认以金商账户名开头
                ErrType err = _businessService.AddClerk(ClerkAccountInfo, ClerkAuthInfo, _loginID, (int)_accType);
                if (err.Err != ERR.SUCCESS)
                {
                    MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    //Todo:移动到添加的行
                    ClerkAccountList.Add(ClerkAccountInfo);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 获取店员
        /// </summary>
        public void GetClerkExecute()
        {
            if (ClerkAccountList != null && ClerkAccountList.Count > 0)
            {
                ClerkAccountList.Clear();
            }
            GetClerkCondition.IsBusy = true;
            BzjClerkQueryCon con = new BzjClerkQueryCon();

            con.LoginId = _loginID;
            string name = _accName;

            if (_accType == ACCOUNT_TYPE.DealerClerk)
            {
                name = _ClerkAgentId;
            }
            con.AgentId    = name;
            con.ClerkId    = GetClerkCondition.Account;
            con.ClerkName  = GetClerkCondition.UserName;
            con.ClerkPhone = GetClerkCondition.Phone;
            con.UserType   = (int)_accType;
            int     pageCount = 0;
            ErrType err       = _businessService.GetClerkBaseInfoWithPage(con, GetClerkCondition.PageIndex,
                                                                          GetClerkCondition.PageSize, ref pageCount, ref _ClerkAccountList);

            if (err.Err != ERR.SUCCESS)
            {
                MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                GetClerkCondition.PageCount = pageCount;
                ClerkAccountList            = _ClerkAccountList;
            }
            GetClerkCondition.IsBusy = false;
        }