예제 #1
0
        public static void 自动生成费用(ArchiveOperationForm masterForm)
        {
            Dictionary <string, object> setData = masterForm.Tag as Dictionary <string, object>;
            费用实体 entity;

            using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <业务费用>())
            {
                rep.BeginTransaction();
                entity = rep.Get <费用实体>(setData["费用实体"]);
                rep.CommitTransaction();
            }

            if (entity.费用实体类型编号 == 11 /*费用实体类型.进口*/)
            {
                using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口票>())
                {
                    进口票 piao = rep.Get <进口票>(setData["费用实体"]);
                    rep.Initialize(piao.箱, piao);
                    process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, (string)setData["费用项"], !setData.ContainsKey("收付标志") ? null : (收付标志?)setData["收付标志"]);
                }
            }
            else if (entity.费用实体类型编号 == 15 /*费用实体类型.内贸出港*/)
            {
                using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <内贸出港票>())
                {
                    内贸出港票 piao = rep.Get <内贸出港票>(setData["费用实体"]);
                    rep.Initialize(piao.箱, piao);
                    process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, (string)setData["费用项"], !setData.ContainsKey("收付标志") ? null : (收付标志?)setData["收付标志"]);
                }
            }
            else if (entity.费用实体类型编号 == 45 /*费用实体类型.进口其他业务*/)
            {
                using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口其他业务票>())
                {
                    进口其他业务票 piao = rep.Get <进口其他业务票>(setData["费用实体"]);
                    rep.Initialize(piao.箱, piao);
                    process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, (string)setData["费用项"], !setData.ContainsKey("收付标志") ? null : (收付标志?)setData["收付标志"]);
                }
            }
            else if (entity.费用实体类型编号 == 13 /*费用实体类型.出口*/)
            {
                using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <出口票>())
                {
                    出口票 piao = rep.Get <出口票>(setData["费用实体"]);
                    rep.Initialize(piao.箱, piao);
                    process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, (string)setData["费用项"], !setData.ContainsKey("收付标志") ? null : (收付标志?)setData["收付标志"]);
                }
            }

            (masterForm.MasterGrid as IBoundGrid).ReloadData();
        }
예제 #2
0
 public static void 生成票费用(费用实体 entity, bool service)
 {
     if (entity.费用实体类型编号 == 11)
     {
         using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口票>())
         {
             进口票 piao = rep.Get <进口票>(entity.ID);
             rep.Initialize(piao.箱, piao);
             process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, null, null, service);
         }
     }
     else if (entity.费用实体类型编号 == 15)
     {
         using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <内贸出港票>())
         {
             内贸出港票 piao = rep.Get <内贸出港票>(entity.ID);
             rep.Initialize(piao.箱, piao);
             process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, null, null, service);
         }
     }
     else if (entity.费用实体类型编号 == 45)
     {
         using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口其他业务票>())
         {
             进口其他业务票 piao = rep.Get <进口其他业务票>(entity.ID);
             rep.Initialize(piao.箱, piao);
             process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, null, null, service);
         }
     }
     else if (entity.费用实体类型编号 == 13)
     {
         using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <出口票>())
         {
             出口票 piao = rep.Get <出口票>(entity.ID);
             rep.Initialize(piao.箱, piao);
             process_fy_yw.批量生成费用(rep, entity.费用实体类型编号, piao, piao.箱, null, null, service);
         }
     }
 }
예제 #3
0
        public static void 批量添加进口其他费用(ArchiveOperationForm masterForm)
        {
            int cnt = 0;
            ArchiveCheckForm form = ServiceProvider.GetService <IWindowFactory>().CreateWindow(ADInfoBll.Instance.GetWindowInfo("选择_批量添加费用_进口其他业务票")) as ArchiveCheckForm;

            if (form.ShowDialog() == DialogResult.OK)
            {
                foreach (object i in form.SelectedEntites)
                {
                    //普通票 entity = i as 普通票;
                    进口其他业务票 entity2 = i as 进口其他业务票;

                    using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口其他业务票>())
                    {
                        rep.Initialize(entity2.箱, entity2);

                        cnt += 批量生成费用(rep, 45, entity2, entity2.箱, null, null);
                    }
                }

                MessageForm.ShowInfo("已生成" + cnt + "条收款费用!");
            }
        }