/// <summary> /// 被授权信息校验 /// </summary> /// <returns></returns> private bool EmpowerValid() { if (empowerAcccountcard == null) { MessageBox.Show("请输入被授权用户的就诊卡号!"); return(false); } if (empowerAcccountcard.Patient == null) { MessageBox.Show("该卡还没有被发放,不能被授权!"); return(false); } HISFC.Models.Account.Account obj = this.accountManager.GetAccountByMarkNo(empowerAcccountcard.MarkNO); if (obj != null) { MessageBox.Show("该卡已存在帐户,不能被授权!"); return(false); } AccountEmpower accountEmpwoer = new AccountEmpower(); int resultValue = accountManager.QueryAccountEmpowerByEmpwoerCardNO(empowerAcccountcard.Patient.PID.CardNO, ref accountEmpwoer); if (resultValue < 0) { MessageBox.Show(this.accountManager.Err); return(false); } if (resultValue > 0) { MessageBox.Show("该帐户已授权不能被再次授权!"); return(false); } return(true); }
/// <summary> /// 授权 /// </summary> protected virtual void Empower() { if (this.spEmpower.Rows.Count == 0) { return; } if (this.spEmpower.ActiveRow.Tag == null) { return; } int rowIndex = this.spEmpower.ActiveRowIndex; if (MessageBox.Show("是否要对该用户进行授权?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } //验证授权人帐户密码 if (!feeIntegrate.CheckAccountPassWord(accountCard.Patient)) { return; } AccountEmpower accountEmpower = this.spEmpower.ActiveRow.Tag as AccountEmpower; //判断被授权用户是否有帐户 HISFC.Models.Account.Account obj = this.accountManager.GetAccountByMarkNo(accountEmpower.EmpowerCard.MarkNO); if (obj != null) { MessageBox.Show("该用户已存在帐户,不能被授权"); return; } if (accountEmpower.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Valid) { MessageBox.Show("该用户已授权,不能被再次授权", "提示"); return; } if (EmpowerManager(accountEmpower, Neusoft.HISFC.Models.Base.EnumValidState.Valid) == 1) { MessageBox.Show("授权成功!", "提示"); } this.spEmpower.Cells[rowIndex, 3].Text = this.GetText(accountEmpower.ValidState); this.spEmpower.Rows[rowIndex].Tag = accountEmpower; this.spEmpower.Rows[rowIndex].BackColor = Color.White; }
/// <summary> /// 授权操作(取消授权、授权) /// </summary> /// <param name="isValid">是否授权</param> private int EmpowerManager(AccountEmpower accountEmpower, Neusoft.HISFC.Models.Base.EnumValidState validState) { accountEmpower.ValidState = validState; accountEmpower.Oper.ID = accountManager.Operator.ID; Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); accountManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); //更新授权表 if (this.accountManager.UpdateEmpower(accountEmpower) < 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新授权表出错!"); return(-1); } //更新帐户授权状态 int resultValue = accountManager.UpdateAccountEmpowerFlag(accountEmpower.AccountNO); if (resultValue == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新帐户授权标识出错!" + accountManager.Err); return(-1); } if (resultValue == 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("授权帐户信息发生变化!"); return(-1); } //插入帐户流水表 if (validState == Neusoft.HISFC.Models.Base.EnumValidState.Valid) { resultValue = this.InsertAccountRecord(OperTypes.RevertEmpower, accountEmpower); } else { resultValue = this.InsertAccountRecord(OperTypes.CancelEmpower, accountEmpower); } if (resultValue < 0) { MessageBox.Show("插入交易表出错!" + accountManager.Err); Neusoft.FrameWork.Management.PublicTrans.RollBack(); return(-1); } Neusoft.FrameWork.Management.PublicTrans.Commit(); return(1); }
/// <summary> /// 显示账户授权信息 /// </summary> /// <param name="accountCard"></param> /// <param name="accountEmpower"></param> /// <returns></returns> private int SetInfo(AccountCard accountCard, AccountEmpower accountEmpower) { this.SetPatientInfo(accountCard); this.txtPrePay.Text = accountEmpower.EmpowerLimit.ToString(); this.txtVacancy.Text = accountEmpower.Vacancy.ToString(); this.txtCost.Text = (accountEmpower.EmpowerLimit - accountEmpower.Vacancy).ToString(); alFee = this.outpatientManager.GetAccountNoPrintFeeItemList(accountCard.Patient.PID.CardNO, Neusoft.HISFC.Models.Base.PayTypes.Balanced, true); if (alFee == null) { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); MessageBox.Show("查询患者费用明细失败!" + outpatientManager.Err); return(-1); } this.SetFeeFp(); return(1); }
private void txtMarkNO_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter) { return; } string markNO = this.txtMarkNO.Text.Trim(); this.Clear(); if (string.IsNullOrEmpty(markNO)) { MessageBox.Show("请输入就诊卡号!"); this.txtMarkNO.Focus(); return; } Neusoft.HISFC.Models.Account.AccountCard accountCard = new Neusoft.HISFC.Models.Account.AccountCard(); if (feeIntegrate.ValidMarkNO(markNO, ref accountCard) <= 0) { MessageBox.Show(feeIntegrate.Err); this.txtMarkNO.Text = string.Empty; this.txtMarkNO.Focus(); return; } Neusoft.HISFC.Models.Account.Account account = accountManager.GetAccountByCardNo(accountCard.Patient.PID.CardNO); if (account == null) { AccountEmpower accountEmpower = new AccountEmpower(); if (accountManager.QueryAccountEmpowerByEmpwoerCardNO(accountCard.Patient.PID.CardNO, ref accountEmpower) < 0) { MessageBox.Show("该患者不能存在账户或有效的授权信息!" + accountManager.Err); this.Clear(); return; } else { SetInfo(accountCard, accountEmpower); } } else { SetInfo(accountCard, account); } }
/// <summary> /// 取消授权 /// </summary> protected virtual void CancelEmpower() { if (this.spEmpower.Rows.Count == 0) { return; } if (this.spEmpower.ActiveRow.Tag == null) { return; } int rowIndex = this.spEmpower.ActiveRowIndex; if (MessageBox.Show("是否要取消该用户的授权?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } //验证授权人帐户密码 if (!feeIntegrate.CheckAccountPassWord(accountCard.Patient)) { return; } AccountEmpower accountEmpower = this.spEmpower.ActiveRow.Tag as AccountEmpower; if (accountEmpower.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Invalid) { MessageBox.Show("该用户已取消授权!", "提示"); return; } if (EmpowerManager(accountEmpower, Neusoft.HISFC.Models.Base.EnumValidState.Invalid) == 1) { MessageBox.Show("取消授权成功!", "提示"); } this.spEmpower.Cells[rowIndex, 3].Text = this.GetText(accountEmpower.ValidState); this.spEmpower.Rows[rowIndex].Tag = accountEmpower; this.spEmpower.Rows[rowIndex].BackColor = Color.Red; }
/// <summary> /// 显示帐户授权信息 /// </summary> /// <param name="tempEmpwoer">授权实体</param> private void SetEmpowerToFp(AccountEmpower tempEmpwoer) { int rowindex = 0; this.spEmpower.Rows.Add(this.spEmpower.Rows.Count, 1); rowindex = this.spEmpower.Rows.Count - 1; this.spEmpower.Cells[rowindex, 0].Text = tempEmpwoer.AccountCard.Patient.Name; //姓名 this.spEmpower.Cells[rowindex, 1].Text = tempEmpwoer.EmpowerCard.Patient.Name; //被授权用户姓名 this.spEmpower.Cells[rowindex, 2].Text = tempEmpwoer.EmpowerLimit.ToString(); //授权限额 this.spEmpower.Cells[rowindex, 3].Text = this.GetText(tempEmpwoer.ValidState); //状态 if (tempEmpwoer.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Invalid) //是否可用 { this.spEmpower.Rows[rowindex].BackColor = Color.Red; } //查询操作原信息 HISFC.Models.Base.Employee employee = managerIntegrate.GetEmployeeInfo(tempEmpwoer.Oper.ID); if (employee != null) { this.spEmpower.Cells[rowindex, 4].Text = employee.Name; //操作原姓名 } this.spEmpower.Cells[rowindex, 5].Text = tempEmpwoer.Oper.OperTime.ToString(); //操作时间 this.spEmpower.Rows[rowindex].Tag = tempEmpwoer; }
/// <summary> /// 修改授权信息 /// </summary> protected virtual void EditEmpowerInfo() { if (this.spEmpower.Rows.Count == 0) { return; } if (this.spEmpower.ActiveRow.Tag == null) { return; } int rowIndex = this.spEmpower.ActiveRowIndex; AccountEmpower accountEmpower = this.spEmpower.ActiveRow.Tag as AccountEmpower; if (accountEmpower == null) { return; } if (accountEmpower.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Invalid) { MessageBox.Show("该用户已取消授权,不能编辑其授权信息"); return; } //验证密码 if (!feeIntegrate.CheckAccountPassWord(accountCard.Patient)) { return; } ucEmpowerInfo uc = new ucEmpowerInfo(accountEmpower, true); Neusoft.FrameWork.WinForms.Classes.Function.ShowControl(uc); if (uc.FindForm().DialogResult == DialogResult.OK) { this.GetEmpowerList(account.ID); } }
/// <summary> /// 保存 /// </summary> protected virtual void save() { //授权信息校验 if (!Valid()) { this.txtMarkNO.Text = string.Empty; this.txtMarkNO.Focus(); return; } //被授权信息校验 if (!EmpowerValid()) { this.txtepMarkNO.Text = string.Empty; this.txtepMarkNO.Focus(); return; } //验证授权人帐户密码 if (!feeIntegrate.CheckAccountPassWord(accountCard.Patient)) { return; } AccountEmpower accountEmpower = new AccountEmpower(); //弹出ucEmpowerInfo,输入授权信息 ucEmpowerInfo uc = new ucEmpowerInfo(accountEmpower, false); Neusoft.FrameWork.WinForms.Classes.Function.ShowControl(uc); if (uc.FindForm().DialogResult != DialogResult.OK) { return; } //生成授权实体 accountEmpower.AccountCard = accountCard; accountEmpower.Vacancy = accountEmpower.EmpowerLimit; accountEmpower.EmpowerCard = empowerAcccountcard; accountEmpower.ValidState = Neusoft.HISFC.Models.Base.EnumValidState.Valid; accountEmpower.AccountNO = account.ID; accountEmpower.Oper.ID = accountManager.Operator.ID; accountEmpower.Oper.OperTime = accountManager.GetDateTimeFromSysDateTime(); Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); accountManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); //插入授权信息 if (accountManager.InsertEmpower(accountEmpower) < 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("插入授权表出错!" + accountManager.Err); return; } //更新帐户授权标记 int resultValue = accountManager.UpdateAccountEmpowerFlag(accountEmpower.AccountNO); if (resultValue == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("更新帐户授权标识出错!" + accountManager.Err); return; } if (resultValue == 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show("授权帐户信息发生变化!"); return; } //插如流水信息 resultValue = this.InsertAccountRecord(OperTypes.Empower, accountEmpower); if (resultValue < 0) { MessageBox.Show("插入交易表出错!" + accountManager.Err); Neusoft.FrameWork.Management.PublicTrans.RollBack(); return; } Neusoft.FrameWork.Management.PublicTrans.Commit(); MessageBox.Show("授权成功!"); this.ClearEmpower(); SetEmpowerToFp(accountEmpower); }
/// <summary> /// 构造函数 /// </summary> /// <param name="obj">授权实体</param> public ucEmpowerInfo(AccountEmpower obj, bool isedit) { InitializeComponent(); accountEmpower = obj; isEdit = isedit; }