private void btnConfirmRecharge_Click(object sender, EventArgs e)
        {
            bool resUkey = base.CheckUKey();
            if (!resUkey)
            {
                return;
            }

            if (lvBatchRechargeList.Items.Count > 0)
            {
                foreach (ListViewItem tmpItem in lvBatchRechargeList.Items)
                {
                    if (tmpItem != null)
                    {
                        try
                        {
                            PreRechargeRecord_prr_Info preRechargeInfo = new PreRechargeRecord_prr_Info();
                            preRechargeInfo.prr_cAdd = base.UserInformation.usm_cUserLoginID;
                            preRechargeInfo.prr_cLast = base.UserInformation.usm_cUserLoginID;
                            preRechargeInfo.prr_cRechargeType = DefineConstantValue.ConsumeMoneyFlowType.Recharge_BatchTransfer.ToString();
                            preRechargeInfo.prr_cRecordID = Guid.NewGuid();
                            preRechargeInfo.prr_cStatus = DefineConstantValue.ConsumeMoneyFlowStatus.WaitForAcceptTransfer.ToString();
                            preRechargeInfo.prr_cUserID = new Guid(tmpItem.SubItems[0].Text.ToString());
                            preRechargeInfo.prr_dAddDate = DateTime.Now;
                            preRechargeInfo.prr_dLastDate = DateTime.Now;
                            preRechargeInfo.prr_dRechargeTime = DateTime.Now;
                            preRechargeInfo.prr_fRechargeMoney = Convert.ToDecimal(tmpItem.SubItems[6].Text.ToString());

                            ReturnValueInfo rvInfo = this._IPreRechargeRecordBL.Save(preRechargeInfo, DefineConstantValue.EditStateEnum.OE_Insert);
                            if (rvInfo.boolValue && !rvInfo.isError)
                            {
                                tmpItem.SubItems[7].Text = "成功转账";
                                btnConfirmRecharge.Enabled = false;
                            }
                            else
                            {
                                tmpItem.SubItems[7].Text = "转账失败。" + rvInfo.messageText;
                            }
                        }
                        catch (Exception ex)
                        {
                            tmpItem.SubItems[7].Text = ex.Message;
                            continue;
                        }
                    }
                }

                base.ShowInformationMessage("转账结束。");
            }
        }
Пример #2
0
        private void btnConfirmRefund_Click(object sender, EventArgs e)
        {
            bool resUkey = base.CheckUKey();
            if (!resUkey)
            {
                return;
            }

            if (string.IsNullOrEmpty(tbxRefundMoney.Text.Trim()))
            {
                this.ShowWarningMessage("请输入退款金额。");
                tbxRefundMoney.Focus();
                return;
            }
            decimal fRefund;
            bool res = decimal.TryParse(tbxRefundMoney.Text.Trim(), out fRefund);
            if (!res)
            {
                this.ShowWarningMessage("请检查退款金额的格式。");
                tbxRefundMoney.Focus();
                return;
            }
            if (fRefund <= 0)
            {
                this.ShowWarningMessage("退款金额需大于0,请重新输入。");
                tbxRefundMoney.Focus();
                return;
            }
            else if (fRefund > Common.DefineConstantValue.MaxRechargeVal)
            {
                this.ShowWarningMessage("退款金额不能大于" + Common.DefineConstantValue.MaxRechargeVal.ToString() + ",请重新输入。");
                tbxRefundMoney.Focus();
                tbxRefundMoney.SelectAll();
                return;
            }

            //帐号余额
            ConsumeCardInfo ccInfo = new ConsumeCardInfo();
            ccInfo.CardBalance = decimal.Parse(this.labAccountBalance.Text);

            //查卡号
            UserCardPair_ucp_Info ucpInfo = new UserCardPair_ucp_Info();
            ucpInfo.ucp_cCUSID = this._CurrentUser.cus_cRecordID;
            List<UserCardPair_ucp_Info> ucpList = _IUserCardPairBL.SearchRecords(ucpInfo);
            if (ucpList != null && ucpList.Count > 0)
            {
                ucpList = ucpList.OrderBy(p => p.ucp_dAddDate).ToList();
                ccInfo.CardNo = ucpList[0].ucp_iCardNo.ToString();
            }
            else
            {
                if (MessageBox.Show("该用户未发卡,确认继续进行操作?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {

                }
                else
                {
                    return;
                }
            }

            dlgConfirmInfo dlg = new dlgConfirmInfo();
            dlg.RefundMoney = fRefund;
            dlg.UserInfo = this._CurrentUser;
            dlg.PreCostMoney = computePreCost(this._CurrentUser.cus_cRecordID);
            dlg.CardInfo = ccInfo;
            dlg.IsPrinted = cbxPrint.Checked;
            dlg.IsSkipPreCost = true;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;
                try
                {
                    PreRechargeRecord_prr_Info preRechargeInfo = new PreRechargeRecord_prr_Info();
                    preRechargeInfo.prr_cAdd = base.UserInformation.usm_cUserLoginID;
                    preRechargeInfo.prr_cLast = base.UserInformation.usm_cUserLoginID;
                    preRechargeInfo.prr_cRechargeType = Common.DefineConstantValue.ConsumeMoneyFlowType.Refund_PersonalTransfer.ToString();
                    preRechargeInfo.prr_cRecordID = Guid.NewGuid();
                    preRechargeInfo.prr_cStatus = Common.DefineConstantValue.ConsumeMoneyFlowStatus.WaitForAcceptTransfer.ToString();
                    preRechargeInfo.prr_cUserID = this._CurrentUser.cus_cRecordID;
                    preRechargeInfo.prr_dRechargeTime = DateTime.Now;
                    preRechargeInfo.prr_fRechargeMoney = fRefund;

                    ReturnValueInfo rvInfo = this._IPreRechargeRecordBL.Save(preRechargeInfo, Common.DefineConstantValue.EditStateEnum.OE_Insert);
                    if (rvInfo.boolValue && !rvInfo.isError)
                    {
                        base.ShowInformationMessage("转账成功,请通知卡用户进行退款确认。");

                        if (cbxPrint.Checked)
                        {
                            RechargeDetail rdInfo = new RechargeDetail();
                            //rdInfo.CardNo = Int32.Parse(this.labCardNo.Text);
                            rdInfo.OperationTime = System.DateTime.Now;
                            rdInfo.Operator = this.UserInformation.usm_cUserLoginID;
                            rdInfo.RechargeValue = fRefund;
                            rdInfo.UserName = this.labUserName.Text;
                            rdInfo.ClassName = this.labClassName.Text;
                            //打印小票
                            PrintTicket(rdInfo);
                        }

                    }
                    else
                    {
                        base.ShowErrorMessage("转账失败。" + rvInfo.messageText);
                    }
                }
                catch (Exception ex)
                {
                    this.Cursor = Cursors.Default;
                    this.ShowErrorMessage(ex);
                }

                ResetAllControls();
                this.Cursor = Cursors.Default;
            }
        }
 /// <summary>
 /// 显示等待转账的转账款总额
 /// </summary>
 /// <param name="cardUserMaster_cus_Info"></param>
 private void GetWaitForTransRecharge(CardUserMaster_cus_Info userInfo)
 {
     if (userInfo != null)
     {
         IPreRechargeRecordBL preRecBL = MasterBLLFactory.GetBLL<IPreRechargeRecordBL>(MasterBLLFactory.PreRechargeRecord);
         PreRechargeRecord_prr_Info searchInfo = new PreRechargeRecord_prr_Info();
         searchInfo.prr_cStatus = Common.DefineConstantValue.ConsumeMoneyFlowStatus.WaitForAcceptTransfer.ToString();
         searchInfo.prr_cUserID = userInfo.cus_cRecordID;
         List<PreRechargeRecord_prr_Info> listRecord = preRecBL.SearchRecords(searchInfo);
         if (listRecord != null && listRecord.Count > 0)
         {
             labWaitForTrans.Text = listRecord.Sum(x => x.prr_fRechargeMoney).ToString();
         }
         else
         {
             labWaitForTrans.Text = "0.00";
         }
     }
     else
     {
         labWaitForTrans.Text = "账户信息异常";
     }
 }
Пример #4
0
        public ReturnValueInfo UpdateRecord(PreRechargeRecord_prr_Info infoObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            try
            {
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PreRechargeRecord_prr record = db.PreRechargeRecord_prr.Where(x => x.prr_cRecordID == infoObject.prr_cRecordID).FirstOrDefault();

                        if (record != null)
                        {
                            record.prr_cAdd = infoObject.prr_cAdd;
                            record.prr_cLast = infoObject.prr_cLast;
                            record.prr_cRCRID = infoObject.prr_cRCRID;
                            record.prr_cRechargeType = infoObject.prr_cRechargeType;
                            record.prr_cStatus = infoObject.prr_cStatus;
                            record.prr_cUserID = infoObject.prr_cUserID;
                            record.prr_dAddDate = infoObject.prr_dAddDate;
                            record.prr_dLastDate = DateTime.Now;
                            record.prr_dRechargeTime = infoObject.prr_dRechargeTime;
                            record.prr_fRechargeMoney = infoObject.prr_fRechargeMoney;
                            record.prr_cDesc = infoObject.prr_cDesc;

                            db.SubmitChanges();
                            rvInfo.boolValue = true;
                        }
                        else
                        {
                            rvInfo.messageText = "GetEntity is null";
                        }
                    }
                }
                else
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }
Пример #5
0
        public ReturnValueInfo InsertRecord(PreRechargeRecord_prr_Info infoObject)
        {
            ReturnValueInfo rvInfo = new ReturnValueInfo();
            try
            {
                if (infoObject != null)
                {
                    using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                    {
                        PreRechargeRecord_prr record = Common.General.CopyObjectValue<PreRechargeRecord_prr_Info, PreRechargeRecord_prr>(infoObject);
                        record.prr_dAddDate = DateTime.Now;
                        record.prr_dLastDate = DateTime.Now;

                        if (record != null)
                        {
                            db.PreRechargeRecord_prr.InsertOnSubmit(record);
                            db.SubmitChanges();
                            rvInfo.boolValue = true;
                            infoObject.prr_dAddDate = record.prr_dAddDate;
                            infoObject.prr_dLastDate = record.prr_dLastDate;
                            rvInfo.ValueObject = infoObject;
                        }
                        else
                        {
                            rvInfo.messageText = "TransEntity is null";
                        }
                    }
                }
                else
                {
                    rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
                }
            }
            catch (Exception ex)
            {
                rvInfo.isError = true;
                rvInfo.messageText = ex.Message;
            }
            return rvInfo;
        }