Example #1
0
        /// <summary>
        /// 修改实体审核状态
        /// </summary>
        /// <param name="strEntityName">实体名</param>
        /// <param name="EntityKeyName">主键名</param>
        /// <param name="EntityKeyValue">主键值</param>
        /// <param name="CheckState">审核状态</param>
        public int UpdateCheckState(string strEntityName, string EntityKeyName, string EntityKeyValue, string CheckState)
        {
            using (CommDal <TEntity> dal = new CommDal <TEntity>())
            {
                int intResult = 0;
                Tracer.Debug("进入了COMMONBLL,实体名:" + strEntityName + ",DateTime:" + System.DateTime.Now.ToString());
                Tracer.Debug("实体ID名:" + EntityKeyName + "实体主键值:" + EntityKeyValue);
                Tracer.Debug("审核的状态:" + CheckState);
                switch (strEntityName)
                {
                case "T_FB_BORROWAPPLYMASTER":    //借款申请
                    BorrowApplyMasterBLL bll = new BorrowApplyMasterBLL();
                    intResult = bll.GetBorrowApplyForMobile(EntityKeyValue, CheckState);
                    break;

                case "T_FB_CHARGEAPPLYMASTER":
                    ChargeApplyMasterBLL Chargebll = new ChargeApplyMasterBLL();
                    intResult = Chargebll.GetChargeApplyForMobile(EntityKeyValue, CheckState);
                    break;

                case "T_FB_REPAYAPPLYMASTER":
                    RepayApplyMasterBLL Repaybll = new RepayApplyMasterBLL();
                    intResult = Repaybll.GetRepayApplyForMobile(EntityKeyValue, CheckState);
                    break;

                default:
                    intResult = dal.UpdateCheckState(strEntityName, EntityKeyName, EntityKeyValue, CheckState);
                    break;
                }


                return(intResult);
            }
        }
Example #2
0
        /// <summary>
        /// 更新还款明细
        /// </summary>
        /// <param name="strRepayMasterID"></param>
        /// <param name="detailList"></param>
        /// <returns></returns>
        public bool UpdateRepayApplyDetail(string strRepayMasterID, List <T_FB_REPAYAPPLYDETAIL> detailList)
        {
            bool bRes = false;

            try
            {
                if (string.IsNullOrWhiteSpace(strRepayMasterID))
                {
                    return(bRes);
                }

                RepayApplyMasterBLL   masterBLL = new RepayApplyMasterBLL();
                T_FB_REPAYAPPLYMASTER entMaster = masterBLL.GetRepayApplyMasterByID(strRepayMasterID);
                bRes = DelRepayApplyDetail(strRepayMasterID);

                foreach (T_FB_REPAYAPPLYDETAIL item in detailList)
                {
                    if (item.EntityKey != null)
                    {
                        item.EntityKey = null;
                    }

                    item.REPAYAPPLYDETAILID = System.Guid.NewGuid().ToString();
                    if (item.T_FB_REPAYAPPLYMASTER == null)
                    {
                        item.T_FB_REPAYAPPLYMASTER = entMaster;
                    }
                    item.T_FB_REPAYAPPLYMASTER.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_REPAYAPPLYMASTER", "REPAYAPPLYMASTERID", item.T_FB_REPAYAPPLYMASTER.REPAYAPPLYMASTERID);

                    if (item.T_FB_SUBJECT != null)
                    {
                        item.T_FB_SUBJECT.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_SUBJECT", "SUBJECTID", item.T_FB_SUBJECT.SUBJECTID);
                    }

                    if (item.T_FB_BORROWAPPLYDETAIL != null)
                    {
                        item.T_FB_BORROWAPPLYDETAIL.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_BORROWAPPLYDETAIL", "BORROWAPPLYDETAILID", item.T_FB_BORROWAPPLYDETAIL.BORROWAPPLYDETAILID);
                    }

                    Add(item);
                }
                bRes = true;
            }
            catch (Exception ex)
            {
                Tracer.Debug(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "调用函数 UpdateRepayApplyDetail 出现异常,异常信息为:" + ex.ToString());
                bRes = false;
            }

            return(bRes);
        }