Пример #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
        private void btn修改_Click(object sender, EventArgs e)
        {
            if (m_cm.DisplayManager.CurrentItem != null)
            {
                进口票 entity = m_cm.DisplayManagerT.CurrentEntity;
                if (!Check票(entity))
                {
                    return;
                }

                ArchiveOperationForm.DoEditS(m_cm, m_gridName);
                UpdateContent(m_cm, m_gridName);
            }
        }
Пример #3
0
        private void btn删除_Click(object sender, EventArgs e)
        {
            if (m_cm.DisplayManager.CurrentItem != null)
            {
                进口票 entity = m_cm.DisplayManagerT.CurrentEntity;
                if (entity.IsActive)
                {
                    MessageForm.ShowWarning("此进口票已经预录入发送!");
                    return;
                }

                ArchiveOperationForm.DoDeleteS(m_cm, m_gridName);
            }
        }
Пример #4
0
        private void btn新增任务_Click(object sender, EventArgs e)
        {
            m_cm.AddNew();
            UpdateContent(m_cm, m_gridName);

            进口票 entity = m_cm.DisplayManagerT.CurrentEntity;

            //entity.任务来源 = 任务来源.手工;
            entity.IsActive = false;

            m_cm.DisplayManagerT.CurrentEntity.任务性质 = 任务性质.进口拆箱;
            m_cm.DisplayManager.DataControls["任务性质"].SelectedDataValue = 任务性质.进口拆箱;
            m_cm.DisplayManager.DataControls["委托时间"].SelectedDataValue = System.DateTime.Now;
        }
Пример #5
0
        private void btn备案确认_Click(object sender, EventArgs e)
        {
            进口票 entity = m_cm.DisplayManagerT.CurrentEntity;

            if (entity != null)
            {
                if (!Check票(entity))
                {
                    return;
                }

                ArchiveDetailForm.AddValidations(m_cm, m_gridName);
                bool ret = Save(SaveType.正式备案确认);
            }
        }
Пример #6
0
        private void btn拒绝_Click(object sender, EventArgs e)
        {
            进口票 entity = m_cm.DisplayManagerT.CurrentEntity;

            if (entity != null)
            {
                if (!Check票(entity))
                {
                    return;
                }

                拒绝原因 jjyy = new 拒绝原因(entity);
                if (jjyy.ShowDialog() == DialogResult.OK)
                {
                    bool ret = Save(SaveType.拒绝确认);
                }
            }
        }
Пример #7
0
 internal static bool Check票(进口票 entity)
 {
     if (entity.任务 != null)
     {
         foreach (var i in entity.任务)
         {
             if (!string.IsNullOrEmpty(i.任务号))
             {
                 MessageForm.ShowWarning("此票中已经有任务备案确认过!");
                 return(false);
             }
             if (i.是否拒绝)
             {
                 MessageForm.ShowWarning("此票中已经有任务拒绝过!");
                 return(false);
             }
         }
     }
     return(true);
 }
 internal static bool Check票(进口票 entity)
 {
     if (entity.任务 != null)
     {
         foreach (var i in entity.任务)
         {
             if (!string.IsNullOrEmpty(i.任务号))
             {
                 MessageForm.ShowWarning("此票中已经有任务备案确认过!");
                 return false;
             }
             if (i.是否拒绝)
             {
                 MessageForm.ShowWarning("此票中已经有任务拒绝过!");
                 return false;
             }
         }
     }
     return true;
 }
Пример #9
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);
         }
     }
 }
Пример #10
0
        private bool Check总箱量(进口票 jkp)
        {
            int real  = m_显示区Grid.DataRows.Count;
            int input = 0;

            if (int.TryParse(jkp.总箱量, out input))
            {
            }
            else
            {
                if (jkp.总箱量 != null && jkp.总箱量.Contains('/'))
                {
                    string zxl = jkp.总箱量.Trim();
                    input = Convert.ToInt32(zxl.Substring(0, zxl.IndexOf('/')));
                }
            }
            if (input != real)
            {
                MessageForm.ShowWarning("箱量不一致,无法发送");
                return(false);
            }
            return(true);
        }
Пример #11
0
        public static void 打印货代报关部委托运输联系单(ArchiveOperationForm masterForm)
        {
            进口票过程转关标志 pz     = masterForm.DisplayManager.CurrentItem as 进口票过程转关标志;
            进口票       entity = pz.票;

            if (entity == null)
            {
                MessageForm.ShowError("请选择要打印的票!");
                return;
            }

            using (IRepository rep = ServiceProvider.GetService <IRepositoryFactory>().GenerateRepository <进口票>())
            {
                rep.Initialize(entity.箱, entity);
            }
            MyReportForm form = new MyReportForm("报表_货代报关部委托运输联系单_进口");

            form.FillDataSet(0, new List <进口票> {
                entity
            });
            form.FillDataSet(1, entity.箱);

            form.Show();
        }
Пример #12
0
 public 拒绝原因(进口票 piao)
 {
     InitializeComponent();
     m_piao = piao;
 }
Пример #13
0
        private bool Save(SaveType saveType)
        {
            if (m_cm.State == StateType.Edit)
            {
                this.ValidateChildren();

                if (!m_cm.SaveCurrent())
                {
                    return(false);
                }
            }

            进口票 entity = m_cm.DisplayManagerT.CurrentEntity;

            switch (saveType)
            {
            case SaveType.正式备案确认:
                if (entity.任务 != null)
                {
                    for (int i = 0; i < entity.任务.Count; ++i)
                    {
                        任务Dao.生成任务号(entity.任务[i], i);
                        m_cm2.Dao.Update(entity.任务[i]);
                    }
                }
                break;

            case SaveType.拒绝确认:
                entity.IsActive = false;
                if (entity.任务 != null)
                {
                    foreach (任务 i in entity.任务)
                    {
                        i.是否拒绝     = true;
                        i.IsActive = false;
                        i.任务号      = null;
                        m_cm2.Dao.Update(i);
                    }
                }
                break;

            default:
                break;
            }

            bool ret;

            if (m_cm.State == StateType.Edit)
            {
                ret = m_cm.EndEdit(true);
            }
            else
            {
                try
                {
                    m_cm.Dao.Update(entity);
                    ret = true;
                }
                catch (Exception ex)
                {
                    ExceptionProcess.ProcessWithNotify(ex);
                    ret = false;
                }
            }

            if (m_cm.State == StateType.View)
            {
                ArchiveDetailForm.UpdateStatusDataControl(m_cm, m_gridName);

                m_cm.DisplayManager.OnPositionChanged(System.EventArgs.Empty);
            }

            return(ret);
        }
Пример #14
0
 public 拒绝原因(进口票 piao)
 {
     InitializeComponent();
     m_piao = piao;
 }
 private bool Check总箱量(进口票 jkp)
 {
     int real = m_显示区Grid.DataRows.Count;
     int input = 0;
     if (int.TryParse(jkp.总箱量, out input))
     {
     }
     else
     {
         if (jkp.总箱量 != null && jkp.总箱量.Contains('/'))
         {
             string zxl = jkp.总箱量.Trim();
             input = Convert.ToInt32(zxl.Substring(0, zxl.IndexOf('/')));
         }
     }
     if (input != real)
     {
         MessageForm.ShowWarning("箱量不一致,无法发送");
         return false;
     }
     return true;
 }
Пример #16
0
        private void Save(SaveType saveType)
        {
            // 验证控件有效值(有些控件需移出焦点后对其他控件产生影响,如果这里不Validate,会先执行Save)
            this.ValidateChildren();

            进口票 jkp = m_cm.DisplayManager.CurrentItem as 进口票;

            if (jkp == null)
            {
                return;
            }

            if (m_cm.SaveCurrent())
            {
                switch (saveType)
                {
                case SaveType.暂存待确认:
                    jkp.IsActive = false;

                    for (int i = 0; i < m_显示区Grid.DataRows.Count; ++i)
                    {
                        任务 entity = m_显示区Grid.DataRows[i].Tag as 任务;
                        entity.任务来源 = 任务来源.手工;
                        entity.任务性质 = 任务性质.进口拆箱;
                        任务Dao.生成预录入号(entity, i);

                        m_cm2.Dao.Update(entity);
                    }
                    break;

                case SaveType.预录入发送:
                    if (!Check总箱量(jkp))
                    {
                        return;
                    }

                    jkp.IsActive = true;

                    for (int i = 0; i < m_显示区Grid.DataRows.Count; ++i)
                    {
                        任务 entity = m_显示区Grid.DataRows[i].Tag as 任务;

                        if (string.IsNullOrEmpty(entity.预录入号))
                        {
                            entity.任务来源 = 任务来源.手工;
                            entity.任务性质 = 任务性质.进口拆箱;
                            任务Dao.生成预录入号(entity, i);
                        }
                        entity.IsActive = true;
                        entity.是否拒绝     = false;

                        m_cm2.Dao.Update(entity);
                    }

                    break;

                default:
                    break;
                }
                m_cm.EndEdit(true);

                if (m_cm.State == StateType.View)
                {
                    ArchiveDetailForm.UpdateStatusDataControl(m_cm, m_gridName);
                    m_cm.DisplayManager.OnPositionChanged(System.EventArgs.Empty);
                }
            }
        }