Exemplo n.º 1
0
        /// <summary>
        /// 根据条件,获取T_FB_EXTENSIONALORDER信息
        /// </summary>
        /// <param name="strVacName"></param>
        /// <param name="strVacYear"></param>
        /// <param name="strCountyType"></param>
        /// <param name="strSortKey"></param>
        /// <returns></returns>
        public static IQueryable<T_FB_EXTENSIONALORDER> GetAllExtensionalOrderRdListByMultSearch(string strFilter, List<object> objArgs, string strSortKey)
        {
            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();
            string strOrderBy = string.Empty;

            if (!string.IsNullOrEmpty(strSortKey))
            {
                strOrderBy = strSortKey;
            }
            else
            {
                strOrderBy = " EXTENSIONALORDERID ";
            }

            var q = dalExtensionalOrder.GetExtensionalOrderRdListByMultSearch(strOrderBy, strFilter, objArgs.ToArray());
            return q;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据条件,获取T_FB_EXTENSIONALORDER信息
        /// </summary>
        /// <param name="strVacName"></param>
        /// <param name="strVacYear"></param>
        /// <param name="strCountyType"></param>
        /// <param name="strSortKey"></param>
        /// <returns></returns>
        public static IQueryable <T_FB_EXTENSIONALORDER> GetAllExtensionalOrderRdListByMultSearch(string strFilter, List <object> objArgs, string strSortKey)
        {
            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();
            string strOrderBy = string.Empty;

            if (!string.IsNullOrEmpty(strSortKey))
            {
                strOrderBy = strSortKey;
            }
            else
            {
                strOrderBy = " EXTENSIONALORDERID ";
            }

            var q = dalExtensionalOrder.GetExtensionalOrderRdListByMultSearch(strOrderBy, strFilter, objArgs.ToArray());

            return(q);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取T_FB_EXTENSIONALORDER信息
        /// </summary>
        /// <param name="strExtensionalOrderId">主键索引</param>
        /// <returns></returns>
        public T_FB_EXTENSIONALORDER GetExtensionalOrderByID(string strExtensionalOrderId)
        {
            if (string.IsNullOrEmpty(strExtensionalOrderId))
            {
                return null;
            }

            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();
            StringBuilder strFilter = new StringBuilder();
            List<string> objArgs = new List<string>();

            if (!string.IsNullOrEmpty(strExtensionalOrderId))
            {
                strFilter.Append(" EXTENSIONALORDERID == @0");
                objArgs.Add(strExtensionalOrderId);
            }

            T_FB_EXTENSIONALORDER entRd = dalExtensionalOrder.GetExtensionalOrderRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
            return entRd;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取T_FB_EXTENSIONALORDER信息
        /// </summary>
        /// <param name="strExtensionalOrderId">主键索引</param>
        /// <returns></returns>
        public T_FB_EXTENSIONALORDER GetExtensionalOrderByID(string strExtensionalOrderId)
        {
            if (string.IsNullOrEmpty(strExtensionalOrderId))
            {
                return(null);
            }

            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();
            StringBuilder       strFilter           = new StringBuilder();
            List <string>       objArgs             = new List <string>();

            if (!string.IsNullOrEmpty(strExtensionalOrderId))
            {
                strFilter.Append(" EXTENSIONALORDERID == @0");
                objArgs.Add(strExtensionalOrderId);
            }

            T_FB_EXTENSIONALORDER entRd = dalExtensionalOrder.GetExtensionalOrderRdByMultSearch(strFilter.ToString(), objArgs.ToArray());

            return(entRd);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 借款控件传递的扩展单据数据保存起来,并根据扩展单据的审核状态,及单据类型产生新的预算关联单据(eg:费用报销单,借款申请单)
        /// 并返回预算关联单据号
        /// </summary>
        /// <param name="entRd">扩展单据实体</param>
        /// <returns></returns>
        public string SaveExtensionalOrderRd(T_FB_EXTENSIONALORDER entTemp, string strFormType)
        {
            string strRes = string.Empty;
            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();

            try
            {
                if (entTemp == null)
                {
                    return("NOTFOUND");
                }

                if (entTemp.T_FB_EXTENSIONORDERDETAIL == null)
                {
                    return("NOTFOUND");
                }

                if (entTemp.T_FB_EXTENSIONORDERDETAIL.Count() == 0)
                {
                    return("NOTFOUND");
                }

                if (entTemp.TOTALMONEY == null)
                {
                    return("TOTALMONEYTHANO");
                }

                if (entTemp.TOTALMONEY.Value <= 0)
                {
                    return("TOTALMONEYTHANO");
                }

                dalExtensionalOrder.BeginTransaction();

                string innerOrderID = entTemp.INNERORDERID;

                #region 处理 Extension 单据
                T_FB_EXTENSIONALORDER entAdd = new T_FB_EXTENSIONALORDER();
                Utility.CloneEntity(entTemp, entAdd);
                // 第一次提交
                if ((entTemp.CHECKSTATES == Convert.ToInt32(FBAEnums.CheckStates.Approving) && string.IsNullOrEmpty(innerOrderID)) || strFormType == Convert.ToInt32(FBAEnums.FormTypes.Resubmit).ToString())
                {
                    entTemp.INNERORDERID = Guid.NewGuid().ToString();
                }

                dalExtensionalOrder.Add(entAdd);

                List <T_FB_EXTENSIONORDERDETAIL> entDetails = entTemp.T_FB_EXTENSIONORDERDETAIL.ToList();
                ExtensionOrderDetailDAL          dalDetail  = new ExtensionOrderDetailDAL();
                foreach (T_FB_EXTENSIONORDERDETAIL entDetail in entDetails)
                {
                    dalDetail.Add(entDetail);
                }
                #endregion

                int iCurCheckState = Convert.ToInt32(entTemp.CHECKSTATES.ToString());
                switch (iCurCheckState)
                {
                case 0:
                    break;

                case 1:
                    SaveChargeRdByExtenOrder(strFormType, entAdd);
                    break;

                case 2:
                    SaveChargeRdByExtenOrder(strFormType, entAdd);
                    break;

                case 3:
                    SaveChargeRdByExtenOrder(strFormType, entAdd);
                    break;
                }

                dalExtensionalOrder.CommitTransaction();
            }
            catch (Exception ex)
            {
                dalExtensionalOrder.RollbackTransaction();
                Utility.SaveLog(ex.ToString());
                strRes = "保存预算单据失败:系统错误,请联系管理员!";
            }
            return(strRes);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 借款控件传递的扩展单据数据保存起来,并根据扩展单据的审核状态,及单据类型产生新的预算关联单据(eg:费用报销单,借款申请单)
        /// 并返回预算关联单据号
        /// </summary>
        /// <param name="entRd">扩展单据实体</param>
        /// <returns></returns>
        public string SaveExtensionalOrderRd(T_FB_EXTENSIONALORDER entTemp, string strFormType)
        {
            string strRes = string.Empty;
            ExtensionalOrderDAL dalExtensionalOrder = new ExtensionalOrderDAL();
            try
            {
                if (entTemp == null)
                {
                    return "NOTFOUND";
                }

                if (entTemp.T_FB_EXTENSIONORDERDETAIL == null)
                {
                    return "NOTFOUND";
                }

                if (entTemp.T_FB_EXTENSIONORDERDETAIL.Count() == 0)
                {
                    return "NOTFOUND";
                }

                if (entTemp.TOTALMONEY == null)
                {
                    return "TOTALMONEYTHANO";
                }

                if (entTemp.TOTALMONEY.Value <= 0)
                {
                    return "TOTALMONEYTHANO";
                }

                dalExtensionalOrder.BeginTransaction();

                string innerOrderID = entTemp.INNERORDERID;

                #region 处理 Extension 单据
                T_FB_EXTENSIONALORDER entAdd = new T_FB_EXTENSIONALORDER();
                Utility.CloneEntity(entTemp, entAdd);
                // 第一次提交 
                if ((entTemp.CHECKSTATES == Convert.ToInt32(FBAEnums.CheckStates.Approving) && string.IsNullOrEmpty(innerOrderID)) || strFormType == Convert.ToInt32(FBAEnums.FormTypes.Resubmit).ToString())
                {
                    entTemp.INNERORDERID = Guid.NewGuid().ToString();
                }

                dalExtensionalOrder.Add(entAdd);

                List<T_FB_EXTENSIONORDERDETAIL> entDetails = entTemp.T_FB_EXTENSIONORDERDETAIL.ToList();
                ExtensionOrderDetailDAL dalDetail = new ExtensionOrderDetailDAL();
                foreach (T_FB_EXTENSIONORDERDETAIL entDetail in entDetails)
                {
                    dalDetail.Add(entDetail);
                }
                #endregion

                int iCurCheckState = Convert.ToInt32(entTemp.CHECKSTATES.ToString());
                switch (iCurCheckState)
                {
                    case 0:                        
                        break;
                    case 1:
                        SaveChargeRdByExtenOrder(strFormType, entAdd);
                        break;
                    case 2:
                        SaveChargeRdByExtenOrder(strFormType, entAdd);
                        break;
                    case 3:
                        SaveChargeRdByExtenOrder(strFormType, entAdd);
                        break;
                }

                dalExtensionalOrder.CommitTransaction();
            }
            catch (Exception ex)
            {
                dalExtensionalOrder.RollbackTransaction();
                Utility.SaveLog(ex.ToString());
                strRes = "保存预算单据失败:系统错误,请联系管理员!";
            }
            return strRes;
        }