Example #1
0
        /// <summary>
        /// 修改门诊病人信息
        /// </summary>
        /// <param name="memberEntity">会员信息</param>
        public void UpdateOPPatientInfo(ME_MemberInfo memberEntity)
        {
            string sql = @" UPDATE OP_CostHead SET PatName='{0}',PatTypeID={1} WHERE MemberID={2}";

            sql = string.Format(sql, memberEntity.Name, memberEntity.PatType, memberEntity.MemberID);
            oleDb.DoCommand(sql);
            sql = @" UPDATE OP_FeeItemHead SET PatName='{0}' WHERE MemberID={1}";
            sql = string.Format(sql, memberEntity.Name, memberEntity.MemberID);
            oleDb.DoCommand(sql);

            sql = @" UPDATE OP_FeeRefundHead SET PatName='{0}' WHERE PatListID IN (SELECT PatListID FROM OP_PatList WHERE MemberID={1})";
            sql = string.Format(sql, memberEntity.Name, memberEntity.MemberID);
            oleDb.DoCommand(sql);
            string sex = string.Empty;

            if (memberEntity.Sex == "1")
            {
                sex = "男";
            }
            else if (memberEntity.Sex == "2")
            {
                sex = "女";
            }

            AgeValue      ag          = AgeExtend.GetAgeValue(memberEntity.Birthday);
            string        age         = ag.ReturnAgeStr_EN();
            string        patTypeName = string.Empty;
            Basic_PatType model       = (Basic_PatType)NewObject <Basic_PatType>().getmodel(memberEntity.PatType);

            patTypeName = model.PatTypeName;
            sql         = @" UPDATE OP_PatList SET PatTypeID={0},PatName='{1}',PatSex='{2}',Birthday='{3}',Age='{4}',Allergies='{5}',WorkUnit='{6}',PatTypeName='{7}' WHERE MemberID={8}";
            sql         = string.Format(sql, memberEntity.PatType, memberEntity.Name, sex, memberEntity.Birthday.ToString("yyyy-MM-dd HH:mm:ss"), age, memberEntity.Allergies, memberEntity.WorkUnit, patTypeName, memberEntity.MemberID);
            oleDb.DoCommand(sql);
        }
        public int SaveMemberEntity2(int newFlag, ME_MemberInfo memberInfo, ME_MemberAccount memberAccount)
        {
            memberInfo.OpenDate     = System.DateTime.Now;
            memberInfo.OperateDate  = System.DateTime.Now;
            memberInfo.OperateID    = LoginUserInfo.EmpId;
            memberInfo.UseFlag      = 1;                    //默认值没有发生作用
            memberInfo.RegisterWork = LoginUserInfo.WorkId; //注册机构

            memberAccount.OperateID = LoginUserInfo.EmpId;

            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                request.AddData(memberInfo);
                request.AddData(memberAccount);
                request.AddData(newFlag);

                if (newFlag == 4)  //修改帐户号码
                {
                    request.AddData(memberAccount.AccountID);
                }
                else
                {
                    request.AddData(0);
                }
            });
            ServiceResponseData retdata = InvokeWcfService("OPProject.Service", "MemberController", "SaveMemberInfo", requestAction);

            return(retdata.GetData <int>(1));
        }
Example #3
0
        /// <summary>
        /// 保存帐户信息
        /// </summary>
        /// <param name="memberInfo">会员实体</param>
        /// <param name="accountEntity">帐户实体</param>
        private void SaveAccountInfo(ME_MemberInfo memberInfo, ME_MemberAccount accountEntity)
        {
            //  txtCardNO.Text = txtTele.Text;
            if (NewFlag == 3)
            {
                bool[] checkCard = (bool[])InvokeController("CheckNewAccount", accountEntity.MemberID, txtCardNO.Text.Trim(), Convert.ToInt16(cbbCardType.SelectedValue));

                if (checkCard[0] == false)
                {
                    MessageBoxEx.Show("会员已有该类型帐户,请更换帐户类型或退出!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (checkCard[1] == true)
                {
                    MessageBoxEx.Show("手机号码:" + txtCardNO.Text.Trim() + "使用中,请更换!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtTele.Focus();
                    return;
                }
            }
            else
            {
                bool isCheck = (bool)InvokeController("CheckCardNOForEdit", accountEntity.AccountID, Convert.ToInt16(cbbCardType.SelectedValue), txtCardNO.Text.Trim());

                if (isCheck == false)
                {
                    MessageBoxEx.Show("手机号码:" + txtCardNO.Text.Trim() + "使用中,请更换!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtTele.Focus();
                    return;
                }
            }

            bool result = (bool)InvokeController("SaveMemberEntity", NewFlag, memberInfo, accountEntity);   //获取前台控制器返回结果

            if (result)
            {
                InvokeController("GetAccountInfo", accountEntity.MemberID);

                InvokeController("BindAccount", AccountGridInex);
                this.Close();
            }
            else
            {
                if (NewFlag == 3)
                {
                    MessageBoxEx.Show("新增会员帐户信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    MessageBoxEx.Show("修改会员帐户信息保存失败!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                return;
            }
        }
Example #4
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;
                }
            }
        }
Example #5
0
        public ServiceResponseData SaveMemberInfo()
        {
            ME_MemberInfo    memberList  = requestData.GetData <ME_MemberInfo>(0);
            ME_MemberAccount accountList = requestData.GetData <ME_MemberAccount>(1);
            int newFlag   = requestData.GetData <int>(2);
            int accountID = requestData.GetData <int>(3);
            int res       = NewObject <Memberanagement>().RegMemberInfo(memberList, accountList, newFlag, accountID);

            responseData.AddData(true);
            responseData.AddData(res);
            return(responseData);
        }
Example #6
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;
                }
            }
        }
Example #7
0
        /// <summary>
        /// 保存会员信息并产生一条默认帐户信息
        /// </summary>
        /// <param name="memberEntity">会员实体</param>
        /// <param name="accountEntity">帐户实体</param>
        /// <param name="newFlag">新增标识</param>
        /// <param name="accountID">帐户id</param>
        /// <returns>1成功</returns>
        public int RegMemberInfo(ME_MemberInfo memberEntity, ME_MemberAccount accountEntity, int newFlag, int accountID)
        {
            int res = -1;

            switch (newFlag)
            {
            case 1:        //新增会员信息同时新增帐户信息
                this.BindDb(memberEntity);
                memberEntity.save();
                accountEntity.MemberID = memberEntity.MemberID;
                accountEntity.Score    = 0;
                accountEntity.UseFlag  = 1;
                this.BindDb(accountEntity);
                accountEntity.save();
                if (accountEntity.CardNO == string.Empty)
                {
                    accountEntity.CardNO = accountEntity.AccountID.ToString();
                    this.BindDb(accountEntity);
                    accountEntity.save();
                }
                res = memberEntity.MemberID;
                break;

            case 2:       //保存会员修改信息
                this.BindDb(memberEntity);
                memberEntity.save();
                res = memberEntity.MemberID;
                break;

            case 3:      //保存新增帐户信息
                this.BindDb(accountEntity);
                accountEntity.save();
                if (accountEntity.CardNO == string.Empty)
                {
                    accountEntity.CardNO = accountEntity.AccountID.ToString();
                    this.BindDb(accountEntity);
                    accountEntity.save();
                }
                res = accountEntity.AccountID;
                break;

            case 4:      //保存修改帐户信息
                this.BindDb(accountEntity);
                if (accountEntity.CardNO == string.Empty)
                {
                    accountEntity.CardNO = accountEntity.AccountID.ToString();
                }
                NewObject <MemberAccountManagement>().UpdateCardNO(accountEntity, accountID);
                res = accountID;
                break;

            case 5:      //其他界面调用新增会员功能时保存会员信息
                this.BindDb(memberEntity);
                memberEntity.save();
                accountEntity.MemberID = memberEntity.MemberID;
                accountEntity.Score    = 0;
                accountEntity.UseFlag  = 1;
                this.BindDb(accountEntity);
                accountEntity.save();
                if (accountEntity.CardNO == string.Empty)
                {
                    accountEntity.CardNO = accountEntity.AccountID.ToString();
                    this.BindDb(accountEntity);
                    accountEntity.save();
                }
                res = memberEntity.MemberID;
                break;

            case 6:     //其他界面调用修改会员功能时保存会员信息
                this.BindDb(memberEntity);
                memberEntity.save();
                res = memberEntity.MemberID;
                UpdateOPPatientInfo(memberEntity);
                break;
            }

            return(res);
        }
Example #8
0
 /// <summary>
 /// 修改病人信息
 /// </summary>
 /// <param name="memberEntity">会员实体</param>
 public void UpdateOPPatientInfo(ME_MemberInfo memberEntity)
 {
     NewDao <IOPMemberInfoDao>().UpdateOPPatientInfo(memberEntity);
 }