示例#1
0
        //根据数据权限获取
        public IEnumerable <BaseCase> GetAllAuthorizeAndSelf(Com.HSJF.Infrastructure.Identity.Model.User user)
        {
            var pers      = GetDataPermission(user);
            var predicate = PredicateBuilder.True <BaseCase>();

            predicate = predicate.And(testc => pers.Contains(testc.DistrictID));
            predicate = predicate.And(testc => pers.Contains(testc.SalesGroupID));
            predicate = predicate.And(t => t.Version > 0);
            predicate = predicate.Or(t => t.CreateUser == user.UserName);
            return(base.GetAll(predicate));
        }
示例#2
0
        public BaseCase GetSelfCase(object key, Com.HSJF.Infrastructure.Identity.Model.User user)
        {
            var entity = base.Get(key);

            if (entity == null)
            {
                return(null);
            }
            if (entity.CreateUser == user.UserName)
            {
                return(entity);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        public bool IsAuthorize(object key, Com.HSJF.Infrastructure.Identity.Model.User user)
        {
            var entity = base.Get(key);

            if (entity == null)
            {
                return(false);
            }
            var pers = GetDataPermission(user);

            if (((pers.Contains(entity.DistrictID) && pers.Contains(entity.SalesGroupID)) || entity.CreateUser == user.UserName))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
        public BaseCase CopyBaseCase(string ID, Com.HSJF.Infrastructure.Identity.Model.User user)
        {
            var basecase = Get(ID);//进件信息

            if (basecase != null)
            {
                BaseCaseDAL baDal = new BaseCaseDAL();

                #region 主表信息

                BaseCase baModel = new BaseCase()
                {
                    ID           = Guid.NewGuid().ToString(),
                    Version      = 0,
                    BorrowerName = basecase.BorrowerName,
                    //CaseNum = basecase.CaseNum,
                    CaseType          = basecase.CaseType,
                    CreateTime        = DateTime.Now,
                    CreateUser        = user.UserName,
                    LoanAmount        = basecase.LoanAmount,
                    DistrictID        = basecase.DistrictID,
                    SalesGroupID      = basecase.SalesGroupID,
                    SalesID           = basecase.SalesID,
                    Term              = basecase.Term,
                    OpeningBank       = basecase.OpeningBank,
                    OpeningSite       = basecase.OpeningSite,
                    BankCard          = basecase.BankCard,
                    ServiceCharge     = basecase.ServiceCharge,
                    ServiceChargeRate = basecase.ServiceChargeRate,
                    Deposit           = basecase.Deposit,
                    DepositDate       = basecase.DepositDate,
                    IsActivitieRate   = basecase.IsActivitieRate,
                    //年华利率,原本在审核中,现在移动到进件中
                    PaymentFactor = basecase.PaymentFactor, //还款来源
                    Purpose       = basecase.Purpose,       //借款用途
                    AnnualRate    = basecase.AnnualRate
                };
                baDal.Add(baModel);

                #endregion 主表信息

                #region 保存抵押物信息

                SaveCollaterals <Collateral>(basecase.Collaterals, baModel.ID);

                #endregion 保存抵押物信息

                #region 保存关系人信息集合

                SaveRelationPersons <RelationPerson>(basecase.RelationPersons, baModel.ID);

                #endregion 保存关系人信息集合

                #region 保存介绍人信息集合

                SaveIntroducers <Introducer>(basecase.Introducers, baModel.ID);

                #endregion 保存介绍人信息集合

                baDal.AcceptAllChange();
                return(baModel);
            }
            else
            {
                return(null);
            }
        }