Пример #1
0
        /// <summary>
        /// 解锁账户信息
        /// </summary>
        /// <param name="accountId">账户ID</param>
        /// <param name="mark">操作描述说明</param>
        /// <param name="operId">操作ID</param>
        /// <param name="subjecId">操作子系统编码</param>
        /// <param name="message">返回信息</param>
        /// <returns></returns>
        public static bool UnBlockAccountInfo(int accountId, string userCode, string userName, string operId, string mark, string subjecCode, out string message)
        {
            message = "";
            bool retFlag = false;
            using (AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext())
            {
                Base_t_AccountInfo bai = new Base_t_AccountInfo();
                bai = adsdc.Base_t_AccountInfo.FirstOrDefault(p => p.id == accountId);
                if (bai != null)
                {
                    try
                    {
                        bai.status = 1;
                        adsdc.SubmitChanges();
                        retFlag = true;
                    }
                    catch (Exception ex)
                    {
                        message = ex.Message;
                        retFlag = false;
                    }
                }
                else
                {
                    message = "该账户不存在!";
                    retFlag = false;
                }

                //如果锁定成功,插入流水记录
                if (retFlag)
                {
                    Base_t_AccountDetailEntity bade = new Base_t_AccountDetailEntity();
                    bade.Type = 3;
                    bade.AccountId = accountId;
                    bade.OpTime = DateTime.Now;
                    bade.CustmerCode = userCode;
                    bade.CustmerName = userName;
                    bade.OpUser = operId;
                    bade.Resume = mark;
                    bade.SubjectCode = subjecCode;

                    //插入流水信息记录
                    InsertOperBalanceInfo(bade, out message);
                    retFlag = true;
                }

                return retFlag;
            }
        }
Пример #2
0
        /// <summary>
        /// 查询账户信息
        /// </summary>
        /// <param name="starTime">起始时间</param>
        /// <param name="endTime"> 结止时间</param>
        /// <returns></returns>
        public static List<Base_t_AccountDetailEntity> SelectAllAccountDetailInfoByTime(int accountId, string starTime, string endTime)
        {
            using (AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext())
            {
                List<Base_t_AccountDetailEntity> badeList = new List<Base_t_AccountDetailEntity>();
                Base_t_AccountDetailEntity bade;
                List<Base_t_AccountDetail> badList = new List<Base_t_AccountDetail>();
                try
                {
                    var results = from C in adsdc.Base_t_AccountDetail select C;
                    if (accountId > 0)
                        results = results.Where(c => c.accountId == accountId);
                    if (!string.IsNullOrEmpty(starTime))
                        results = results.Where(c => c.opTime >= DateTime.Parse(starTime));
                    if (!string.IsNullOrEmpty(endTime))
                        results = results.Where(c => c.opTime <= DateTime.Parse(endTime).AddDays(1));
                    badList = results.OrderByDescending(c => c.opTime).ToList();
                    if (badList != null && badList.Count > 0)
                    {
                        foreach (Base_t_AccountDetail bad in badList)
                        {
                            bade = new Base_t_AccountDetailEntity();
                            PublicFunction.ObjectCopyTo(bad, bade);
                            if (bade != null)
                            {
                                badeList.Add(bade);
                            }
                        }
                    }

                    return badeList;
                }
                catch (System.Exception ex)
                {
                    return null;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 新增账户流水信息
        /// </summary>
        /// <param name="baaie"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static bool InsertOperBalanceInfo(Base_t_AccountDetailEntity bade, out string message)
        {
            message = "";
            bool retFlag = false;

            Base_t_AccountDetail bad = new Base_t_AccountDetail();

            //检查入参
            if (bade == null)
            {
                message = "传入参数有误";
                return false;
            }

            //进行实体转换
            PublicFunction.ObjectCopyTo(bade, bad);

            AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext();
            try
            {
                if (bad != null)
                {
                    adsdc.Base_t_AccountDetail.InsertOnSubmit(bad);
                    adsdc.SubmitChanges();
                    retFlag = true;
                    message = "新增账户流水信息成功";

                }
                else
                {
                    message = "传入信息转换时出错";
                }
            }
            catch (Exception ex)
            {
                retFlag = false;
                message = ex.Message;
            }
            return retFlag;
        }
Пример #4
0
        /// <summary>
        /// 审核待审核记录
        /// </summary>
        /// <param name="auditId"></param>
        /// <returns></returns>
        public static bool AuditOperBalanceInfo(int auditId, string operUserId,bool status, out string message)
        {
            message = "";
            bool retFlag = false;
            using (AccountDataSourceDataContext adsdc = new AccountDataSourceDataContext())
            {
                DbTransaction tran = adsdc.Connection.BeginTransaction();
                Base_t_AccountAuditInfo baai = new Base_t_AccountAuditInfo();
                Base_t_AccountInfo bai = new Base_t_AccountInfo();

                baai = adsdc.Base_t_AccountAuditInfo.FirstOrDefault(p => p.id == auditId);
                try
                {
                    //审核待审核记录
                    if (baai != null)
                    {
                        //如果流水记如存在,则根据流水记录中的账户ID取账户信息
                        bai = adsdc.Base_t_AccountInfo.FirstOrDefault(p => p.id == baai.accountId);

                        baai.status = true;
                        baai.opUser = operUserId;
                        baai.opTime = DateTime.Now;
                        adsdc.SubmitChanges();
                        retFlag = true;
                    }

                    //审核成功,插入操作记录到流水记录表
                    if (retFlag)
                    {
                        string mess = "";
                        Base_t_AccountDetailEntity bade = new Base_t_AccountDetailEntity();
                        PublicFunction.ObjectCopyTo(baai, bade);

                        //自动赋值后,处理各别不同的属性值
                        bade.Id = 0;
                        bade.Orderid = baai.refId;
                        bade.Resume = baai.direction;
                        bade.UseBalance = (decimal)baai.opBalance;
                        if (baai.type == 0)
                            bade.EndBalance = (decimal)bai.balance + (decimal)baai.opBalance;
                        else
                            bade.EndBalance = (decimal)bai.balance - (decimal)baai.opBalance;

                        InsertOperBalanceInfo(bade, out mess);
                        message = mess;
                    }
                    tran.Commit();
                }
                catch(Exception ex)
                {
                    tran.Rollback();
                    message = ex.Message;
                    retFlag = false;
                }
            }
            return retFlag;
        }
Пример #5
0
 /// <summary>
 /// 新增账户流水信息
 /// </summary>
 /// <param name="baaie"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public bool InsertOperBalanceInfo(Base_t_AccountDetailEntity bade, out string message)
 {
     return AccountBusiness.InsertOperBalanceInfo(bade, out  message);
 }