Пример #1
0
        public 付款合同 Get付款合同(IRepository rep, int 费用实体类型)
        {
            string key = 费用实体类型.ToString();

            if (!s_fkhts.ContainsKey(key))
            {
                IList <付款合同> list = (rep as Feng.NH.INHibernateRepository).List <付款合同>(NHibernate.Criterion.DetachedCriteria.For <付款合同>()
                                                                                       .Add(NHibernate.Criterion.Expression.Eq("业务类型编号", 费用实体类型))
                                                                                       .Add(NHibernate.Criterion.Expression.Le("生效时间", System.DateTime.Today))
                                                                                       .AddOrder(NHibernate.Criterion.Order.Desc("生效时间"))
                                                                                       .SetMaxResults(1));

                if (list.Count > 0)
                {
                    付款合同 fkht = list[0];
                    rep.Initialize(fkht.合同费用项, fkht);
                    s_fkhts[key] = fkht;
                }
                else
                {
                    s_fkhts[key] = null;
                }
            }
            return(s_fkhts[key]);
        }
Пример #2
0
        public static void 批量生成费用付款(IRepository rep, int 费用实体类型, 普通票 票, IEnumerable 箱s, string 费用项编号, 收付标志?收付标志, IList <业务费用理论值> llzs, bool service)
        {
            if (!收付标志.HasValue || 收付标志.Value == Hd.Model.收付标志.付)
            {
                // 生成付款费用
                付款合同 fkht = HdDataBuffer.Instance.Get付款合同(rep, 费用实体类型);
                if (fkht != null)
                {
                    foreach (付款合同费用项 htfyx in fkht.合同费用项)
                    {
                        // 如果指定费用项,则只生成此费用项下的费用
                        if (!string.IsNullOrEmpty(费用项编号) &&
                            htfyx.费用项编号 != 费用项编号)
                        {
                            continue;
                        }

                        // 不是服务运行时(即界面上点按钮),付款合同费用项.是否生成实际费用 = false 不生产费用
                        if (!service && !htfyx.是否生成实际费用)
                        {
                            continue;
                        }

                        批量生成费用(rep, 票, 箱s, Hd.Model.收付标志.付, htfyx, llzs, !string.IsNullOrEmpty(费用项编号));
                    }
                }
                if (费用实体类型 == 11)
                {
                    bool?cybz = ConvertHelper.ToBoolean(EntityScript.GetPropertyValue(票, "承运标志"));
                    if (cybz.HasValue && cybz.Value)
                    {
                        // 受托人合同
                        string str = ConvertHelper.ToString(EntityScript.GetPropertyValue(票, "承运人编号"));
                        if (!string.IsNullOrEmpty(str))
                        {
                            // 生成付款费用
                            受托人合同 strht = HdDataBuffer.Instance.Get受托人合同(rep, 费用实体类型, str);
                            if (strht != null)
                            {
                                foreach (受托人合同费用项 htfyx in strht.合同费用项)
                                {
                                    // 如果指定费用项,则只生成此费用项下的费用
                                    if (!string.IsNullOrEmpty(费用项编号) &&
                                        htfyx.费用项编号 != 费用项编号)
                                    {
                                        continue;
                                    }

                                    批量生成费用(rep, 票, 箱s, Hd.Model.收付标志.付, htfyx, llzs, !string.IsNullOrEmpty(费用项编号));
                                }
                            }
                        }
                    }
                }
            }
        }