Пример #1
0
        /// <summary>
        /// 根据条件,获取T_FB_REPAYAPPLYDETAIL信息
        /// </summary>
        /// <param name="strVacName"></param>
        /// <param name="strVacYear"></param>
        /// <param name="strCountyType"></param>
        /// <param name="strSortKey"></param>
        /// <returns></returns>
        public static IQueryable <T_FB_REPAYAPPLYDETAIL> GetAllRepayApplyDetailRdListByMultSearch(string strFilter, List <object> objArgs, string strSortKey)
        {
            RepayApplyDetailDAL dalRepayApplyDetail = new RepayApplyDetailDAL();
            string strOrderBy = string.Empty;

            if (!string.IsNullOrEmpty(strSortKey))
            {
                strOrderBy = strSortKey;
            }
            else
            {
                strOrderBy = " REPAYAPPLYDETAILID ";
            }
            try
            {
                var q = dalRepayApplyDetail.GetRepayApplyDetailRdListByMultSearch(strOrderBy, strFilter, objArgs.ToArray());
                return(q);
            }
            catch (Exception ex)
            {
                string ErrInfo = new RepayApplyDetailBLL().GetType().ToString() + ":GetAllRepayApplyDetailRdListByMultSearch," + System.DateTime.Now.ToString() + "," + ex.Message;
                Tracer.Debug(ErrInfo);
            }
            return(null);
        }
Пример #2
0
 /// <summary>
 /// 一起删除还款主表和明细表   add by zl
 /// </summary>
 /// <param name="repayMasterID"></param>
 /// <returns></returns>
 public bool DelRepayApplyMasterAndDetail(string repayMasterID)
 {
     try
     {
         RepayApplyDetailBLL repayDetailBll = new RepayApplyDetailBLL();
         dal.BeginTransaction();
         if (!repayDetailBll.DelRepayApplyDetail(repayMasterID))
         {
             dal.RollbackTransaction();
             return(false);
         }
         if (!DelRepayApplyMaster(repayMasterID))
         {
             dal.RollbackTransaction();
             return(false);
         }
         dal.CommitTransaction();
         return(true);
     }
     catch (Exception ex)
     {
         string ErrInfo = this.GetType().ToString() + ":DelRepayApplyMasterAndDetail," + System.DateTime.Now.ToString() + "," + ex.Message;
         Tracer.Debug(ErrInfo);
         dal.RollbackTransaction();
         return(false);
     }
 }
Пример #3
0
        public int GetRepayApplyForMobile(string Repayid, string StrCheckState)
        {
            string sResult = string.Empty;
            T_FB_REPAYAPPLYMASTER master = new T_FB_REPAYAPPLYMASTER();

            master             = GetRepayApplyMasterByID(Repayid);
            master.CHECKSTATES = Convert.ToInt32(StrCheckState);

            RepayApplyDetailBLL          bllRepayApplyDetail = new RepayApplyDetailBLL();
            List <T_FB_REPAYAPPLYDETAIL> entRds = bllRepayApplyDetail.GetRepayApplyDetailByMasterID(Repayid);

            if (entRds != null)
            {
                //if (UptRepayApplyCheckState(master, entRds.ToList()))
                //{
                //    return 1;
                //}
                sResult = UptRepayApplyCheckState(master, entRds.ToList());
                if (!string.IsNullOrEmpty(sResult))
                {
                    throw new Exception(sResult);
                }
                else
                {
                    return(1);
                }
            }
            return(0);
        }
Пример #4
0
        /// <summary>
        /// 修改还款申请记录
        /// </summary>
        /// <param name="strActionType"></param>
        /// <param name="entity"></param>
        /// <param name="detailList"></param>
        /// <param name="strMsg"></param>
        public void UptRepayApplyMasterAndDetailForMobile(string strActionType, T_FB_REPAYAPPLYMASTER entity,
                                                          List <T_FB_REPAYAPPLYDETAIL> detailList, ref string strMsg)
        {
            try
            {
                bool isReturn = CheckRepay(ref entity, ref detailList, ref strMsg, "2");
                if (!isReturn)
                {
                    return;
                }
            }
            catch
            {
            }
            bool re = false;

            if (LockOrder(entity.REPAYAPPLYMASTERID))
            {
                strMsg = "单据正在提交或审核中,不可重复操作!";
                return;
            }

            try
            {
                FBAEnums.CheckStates  dOldChecksates = FBAEnums.CheckStates.UnSubmit;
                T_FB_REPAYAPPLYMASTER cha            = GetRepayApplyMasterByID(entity.REPAYAPPLYMASTERID);
                if (cha == null)
                {
                    strMsg = "提交的单据不存在或已删除,不可继续操作!";
                    return;
                }
                object checkStatesOld = cha.CHECKSTATES;
                dOldChecksates = (FBAEnums.CheckStates) int.Parse(checkStatesOld.ToString());
                object checkStatesNew = entity.CHECKSTATES;
                FBAEnums.CheckStates dNewCheckStates = (FBAEnums.CheckStates) int.Parse(checkStatesNew.ToString());
                if ((dOldChecksates == FBAEnums.CheckStates.Approved || dOldChecksates == FBAEnums.CheckStates.UnApproved) &&
                    strActionType.ToUpper() != "RESUBMIT")
                {
                    strMsg = "单据已审核完毕,不可再次操作";
                    return;
                }
                Utility.CloneEntity(entity, cha);
                cha.UPDATEDATE = DateTime.Now;
                bool n = Update(cha);
                if (n == false)
                {
                    dal.RollbackTransaction();
                    strMsg = "单据更新异常!";
                    return;
                }
                RepayApplyDetailBLL bllRepayDetail = new RepayApplyDetailBLL();
                re = bllRepayDetail.UpdateRepayApplyDetail(cha.REPAYAPPLYMASTERID, detailList);//删除报销明细
                if (!re)
                {
                    dal.RollbackTransaction();
                    strMsg = "单据明细更新异常!";
                    return;
                }
                if (dOldChecksates == dNewCheckStates && dOldChecksates == (int)FBAEnums.CheckStates.UnSubmit &&
                    strActionType.ToUpper() == "EDIT")
                {
                    strMsg = "单据更新成功!";
                    return;
                }
            }
            catch (Exception ex)
            {
                string ErrInfo = this.GetType().ToString() + ":UptRepayApplyMasterAndDetailForMobile," + System.DateTime.Now.ToString() + "," + ex.Message;
                Tracer.Debug(ErrInfo);
            }
            finally
            {
                ReleaseOrder(entity.REPAYAPPLYMASTERID);
            }
        }
Пример #5
0
        /// <summary>
        /// 更新还款主从表数据  add by zl
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="detailList"></param>
        /// <returns></returns>
        public void UptRepayApplyMasterAndDetail(string strActionType, T_FB_REPAYAPPLYMASTER entity,
                                                 List <T_FB_REPAYAPPLYDETAIL> detailList, ref string strMsg)
        {
            try
            {
                var company = OrgClient.GetCompanyById(entity.OWNERCOMPANYID);
                if (company != null)
                {
                    entity.OWNERCOMPANYNAME = company.CNAME;
                }
            }
            catch
            {
            }
            bool re = false;

            if (LockOrder(entity.REPAYAPPLYMASTERID))
            {
                strMsg = "单据正在提交或审核中,不可重复操作!";
                return;
            }

            try
            {
                FBAEnums.CheckStates  dOldChecksates = FBAEnums.CheckStates.UnSubmit;
                T_FB_REPAYAPPLYMASTER cha            = GetRepayApplyMasterByID(entity.REPAYAPPLYMASTERID);
                if (cha == null)
                {
                    strMsg = "提交的单据不存在或已删除,不可继续操作!";
                    return;
                }

                object checkStatesOld = cha.CHECKSTATES;
                dOldChecksates = (FBAEnums.CheckStates) int.Parse(checkStatesOld.ToString());

                object checkStatesNew = entity.CHECKSTATES;
                FBAEnums.CheckStates dNewCheckStates = (FBAEnums.CheckStates) int.Parse(checkStatesNew.ToString());

                if ((dOldChecksates == FBAEnums.CheckStates.Approved || dOldChecksates == FBAEnums.CheckStates.UnApproved) &&
                    strActionType.ToUpper() != "RESUBMIT")
                {
                    strMsg = "单据已审核完毕,不可再次操作";
                    return;
                }

                //不用月结可以进行借还款
                //#region 是否本月有结算

                //bool isChecked = SystemSettingsBLL.IsChecked;
                //// 没月结,只能处理报销。
                //string entityType = entity.GetType().Name;
                //string[] EntityTypes = new string[] { typeof(T_FB_BORROWAPPLYMASTER).Name,
                //    typeof(T_FB_REPAYAPPLYMASTER).Name, typeof(T_FB_CHARGEAPPLYMASTER).Name};
                //// 月结不可操作:1.日常报销类型的单据的审核或提交,2.所有单据的提交或重新提交
                //if (!isChecked && (EntityTypes.Contains(entityType) || (strActionType.ToUpper() == "SUBMIT")
                //    || (strActionType.ToUpper() == "RESUBMIT")))
                //{
                //    strMsg = "本月尚未结算,无法提交或审核!";
                //    return;
                //}

                //#endregion

                Utility.CloneEntity(entity, cha);
                cha.UPDATEDATE = DateTime.Now;

                bool n = Update(cha);
                if (n == false)
                {
                    dal.RollbackTransaction();
                    strMsg = "单据更新异常!";
                    return;
                }

                RepayApplyDetailBLL bllRepayDetail = new RepayApplyDetailBLL();
                re = bllRepayDetail.UpdateRepayApplyDetail(cha.REPAYAPPLYMASTERID, detailList);//删除报销明细
                if (!re)
                {
                    dal.RollbackTransaction();
                    strMsg = "单据明细更新异常!";
                    return;
                }

                if (dOldChecksates == dNewCheckStates && dOldChecksates == (int)FBAEnums.CheckStates.UnSubmit &&
                    strActionType.ToUpper() == "EDIT")
                {
                    strMsg = "单据更新成功!";
                    return;
                }

                //if (dNewCheckStates == FBAEnums.CheckStates.Approving && ((strActionType.ToUpper() == "SUBMIT" && dOldChecksates == FBAEnums.CheckStates.UnSubmit)
                //    || (strActionType.ToUpper() == "RESUBMIT" && dOldChecksates == FBAEnums.CheckStates.UnApproved)))
                //{
                //    BudgetAccountBLL budgetBLL = new BudgetAccountBLL();
                //    budgetBLL.UpdateAccount(cha, (int)dNewCheckStates);
                //}
            }
            catch (Exception ex)
            {
                string ErrInfo = this.GetType().ToString() + ":UptRepayApplyMasterAndDetail," + System.DateTime.Now.ToString() + "," + ex.Message;
                Tracer.Debug(ErrInfo);
            }
            finally
            {
                ReleaseOrder(entity.REPAYAPPLYMASTERID);
            }
        }