コード例 #1
0
        /// <summary>
        /// 保存新增或修改会员信息
        /// </summary>
        /// <param name="memberInfo">会员信息</param>
        /// <param name="memberAccount">帐户信息</param>
        private void SaveMemberInfo(ME_MemberInfo memberInfo, ME_MemberAccount memberAccount)
        {
            if ((NewFlag == 1) || (NewFlag == 5))
            {
                memberInfo.MemberID     = 0;
                memberAccount.AccountID = 0;
                //if (string.IsNullOrEmpty(txtCardNO.Text))
                //{
                //    MessageBoxEx.Show("帐户号码必须填写", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                if (txtCardNO.Text != "")
                {
                    bool checkCard = (bool)InvokeController("CheckCardNO");
                    if (checkCard)
                    {
                        MessageBoxEx.Show("帐户号码:" + txtCardNO.Text.Trim() + "使用中,请更换!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
            }

            if (MemberEntity.Validate())
            {
                bool result = (bool)InvokeController("SaveMemberEntity", NewFlag, memberInfo, memberAccount);   //获取前台控制器返回结果

                if (result)
                {
                    if (NewFlag == 1)
                    {
                        PageNO          = 1;
                        PageSize        = 20;
                        MemberGridIndex = 0;
                        PageNO          = 1;
                    }

                    InvokeController("BindMemberInfo", SqlCondition, PageNO, PageSize, MemberGridIndex);
                    MemberEntity.Clear();
                    this.Close();
                }
                else
                {
                    if ((NewFlag == 1) || (NewFlag == 5))
                    {
                        MessageBoxEx.Show("新增会员信息与会员帐户信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MessageBoxEx.Show("修改会员信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    return;
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 保存会员信息
        /// </summary>
        /// <param name="memberInfo">会员信息</param>
        /// <param name="memberAccount">会员账号信息</param>
        private void SaveMemberInfo2(ME_MemberInfo memberInfo, ME_MemberAccount memberAccount)
        {
            if (NewFlag == 5)
            {
                //if (string.IsNullOrEmpty(txtCardNO.Text))
                //{
                //    MessageBoxEx.Show("帐户号码必须填写", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    return;
                //}
                if (txtCardNO.Text != string.Empty)
                {
                    bool checkCard = (bool)InvokeController("CheckCardNO");
                    if (checkCard)
                    {
                        MessageBoxEx.Show("帐户号码:" + txtCardNO.Text.Trim() + "使用中,请更换!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
            }

            if (MemberEntity.Validate())
            {
                SaveResult = (int)InvokeController("SaveMemberEntity2", NewFlag, memberInfo, memberAccount);   //获取前台控制器返回结果

                if (SaveResult > 0)
                {
                    MemberEntity.Clear();
                    this.Close();
                }
                else
                {
                    if (NewFlag == 5)
                    {
                        MessageBoxEx.Show("新增会员信息与会员帐户信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MessageBoxEx.Show("修改会员信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    return;
                }
            }
        }