Exemplo n.º 1
0
 /// <summary>
 /// 追加资金
 /// </summary>
 /// <param name="model">追加资金实体</param>
 /// <param name="mess">返回信息</param>
 /// <returns>返回是否成功</returns>
 public bool AddFundFP(ManagementCenter.Model.UM_FundAddInfo model, out string mess)
 {
     UserManage.Out_TransactionManage tm = new Out_TransactionManage();
     return(tm.AddFundFP(model, out mess));
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ManagementCenter.Model.UM_FundAddInfo model)
 {
     dal.Update(model);
 }
        /// <summary>
        /// 追加资金
        /// </summary>
        /// <param name="model">追加资金实体</param>
        /// <param name="mess"></param>
        /// <returns></returns>
        public bool AddFund(ManagementCenter.Model.UM_FundAddInfo model, out string mess)
        {
            mess = string.Empty;
            UM_UserInfo user = StaticDalClass.UserInfoDAL.GetModel((int)model.UserID);

            if (user == null || user.RoleID != (int)ManagementCenter.Model.CommonClass.Types.RoleTypeEnum.Transaction)
            {
                mess = "GL-0219:交易员编号不存在!"; //写调试信息
                LogHelper.WriteDebug(mess);
                return(false);
            }

            CT_Counter T = GetCounterByUserID((int)model.UserID);

            if (T == null)
            {
                mess = "GL-0220:交易员对应的柜台不存在!"; //写调试信息
                LogHelper.WriteDebug(mess);
                return(false);
            }
            UM_DealerAccount DealerAccount = StaticDalClass.DealerAccountDAL.GetModelByUserIDAndType((int)model.UserID,
                                                                                                     (int)
                                                                                                     GTA.VTS.Common.CommonObject.Types.
                                                                                                     AccountAttributionType
                                                                                                     .
                                                                                                     BankAccount);

            if (DealerAccount == null)
            {
                mess = "GL-0221:交易员对应的银行帐号不存在!"; //写调试信息
                LogHelper.WriteDebug(mess);
                return(false);
            }
            try
            {
                AddCapitalEntity AddCapitalEntity = new AddCapitalEntity();
                AddCapitalEntity.AddHKAmount        = (decimal)model.HKNumber;
                AddCapitalEntity.AddRMBAmount       = (decimal)model.RMBNumber;
                AddCapitalEntity.AddUSAmount        = (decimal)model.USNumber;
                AddCapitalEntity.TraderID           = model.UserID.ToString();
                AddCapitalEntity.BankCapitalAccount = DealerAccount.DealerAccoutID;
                if (!ServiceIn.AccountManageServiceProxy.GetInstance().AddCapital(T, AddCapitalEntity, out mess))
                {
                    mess = "GL-0222:调用柜台追加资金方法AddCapital()失败!" + mess; //写调试信
                    LogHelper.WriteDebug(mess);
                    return(false);
                }
            }
            catch (VTException Ex)
            {
                mess = Ex.ToString();
                //写错误日志
                return(false);
            }
            try
            {
                if (model.HKNumber == decimal.MaxValue)
                {
                    model.HKNumber = null;
                }
                if (model.RMBNumber == decimal.MaxValue)
                {
                    model.RMBNumber = null;
                }
                if (model.USNumber == decimal.MaxValue)
                {
                    model.USNumber = null;
                }
                StaticDalClass.FundAddInfoDAL.Add(model);
            }
            catch (Exception ex)
            {
                string      errCode = "GL-0223";
                string      errMsg  = "追加资金失败!";
                VTException vte     = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(vte.ToString(), vte.InnerException);
                mess = vte.ToString();
                return(false);
            }
            return(true);
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ManagementCenter.Model.UM_FundAddInfo model)
 {
     return(dal.Add(model));
 }