Example #1
0
        public static void Auto油费金额计算(ArchiveSeeForm masterForm)
        {
            (masterForm.ArchiveDetailForm as ArchiveDetailFormAuto).DataControlsCreated += new EventHandler(ArchiveDetailForm_DataControlsCreated);

            //((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[0] as IArchiveGrid).InsertionRow.Cells["付款金额"].DoubleClick += new EventHandler(油费金额计算);
            //((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[0] as IArchiveGrid).InsertionRow.Cells["收款金额"].DoubleClick += new EventHandler(油费金额计算);
        }
        internal static void TestWindow(MyForm form)
        {
            if (form == null)
            {
                return;
            }

            if (form is ArchiveSeeForm)
            {
                var opForm = form as IArchiveMasterForm;

                opForm.DisplayManager.SearchManager.MaxResult = 1;

                SetSearchControlsValues(opForm.DisplayManager.SearchManager);
                opForm.DisplayManager.SearchManager.LoadDataAccordSearchControls();
                opForm.DisplayManager.SearchManager.WaitLoadData();

                SetSearchControlsValues(opForm.DisplayManager.SearchManager, true);
                opForm.DisplayManager.SearchManager.LoadDataAccordSearchControls();
                opForm.DisplayManager.SearchManager.WaitLoadData();

                if (opForm.DisplayManager.Count > 0 && opForm.ArchiveDetailForm != null)
                {
                    ArchiveSeeForm.DoView(opForm);
                }

                foreach (Xceed.Grid.DataRow row in opForm.MasterGrid.DataRows)
                {
                    ExpandDataRow(row);
                }

                if (form is ArchiveOperationForm)
                {
                    var opForm2 = form as ArchiveOperationForm;
                    if (opForm2 != null && opForm2.ArchiveDetailForm != null)
                    {
                        if (operateData)
                        {
                            if (opForm2.ArchiveDetailForm is ArchiveDetailForm)
                            {
                                if (opForm2.ControlManager.AllowInsert)
                                {
                                    opForm2.DoAdd();
                                    (opForm2.ArchiveDetailForm as ArchiveDetailForm).DoCancel();
                                }

                                if (opForm2.DisplayManager.Count > 0)
                                {
                                    if (opForm2.ControlManager.AllowEdit)
                                    {
                                        opForm2.DisplayManager.Position = 0;
                                        opForm2.DoEdit();
                                        (opForm2.ArchiveDetailForm as ArchiveDetailForm).DoCancel();

                                        opForm2.DoEdit();
                                        (opForm2.ArchiveDetailForm as ArchiveDetailForm).DoSave();
                                    }
                                }
                            }

                            if (opForm2.DisplayManager.Count > 0)
                            {
                                if (opForm2.ControlManager.AllowDelete)
                                {
                                    opForm2.DisplayManager.Position = 0;
                                    opForm2.DoDelete();
                                }
                            }
                        }
                    }
                }
            }
            else if (form is ArchiveDataSetReportForm)
            {
                var opForm = form as ArchiveDataSetReportForm;

                opForm.SearchManager.MaxResult = 1;

                SetSearchControlsValues(opForm.SearchManager);
                opForm.SearchManager.LoadDataAccordSearchControls();
                opForm.SearchManager.WaitLoadData();

                SetSearchControlsValues(opForm.SearchManager, true);
                opForm.SearchManager.LoadDataAccordSearchControls();
                opForm.SearchManager.WaitLoadData();
            }
            else if (form is ArchiveDatabaseReportForm)
            {
                var opForm = form as ArchiveDatabaseReportForm;
                opForm.SearchManager.MaxResult = 1;

                SetSearchControlsValues(opForm.SearchManager);
                opForm.SearchManager.LoadDataAccordSearchControls();
                opForm.SearchManager.WaitLoadData();

                SetSearchControlsValues(opForm.SearchManager, true);
                opForm.SearchManager.LoadDataAccordSearchControls();
                opForm.SearchManager.WaitLoadData();
            }

            foreach (ToolStripItem i in form.ToolStrip.Items)
            {
                if (i.Name == "tsbSearch" || i.Name == "tsbFind" || i.Name == "tsbRelatedInfo" ||
                    i.Name == "tsbAttachment" || i.Name == "tsbExportExcel" || i.Name == "tsbPrintPreview" ||
                    i.Name == "tsbGenerateReport" || i.Name == "tsbSetup" || i.Name == "tsbRefresh" ||
                    i.Name == "tsbView" || i.Name == "tsbFilter" || i.Name == "tsbGroup" ||
                    i.Name.StartsWith("tss") || i.Name.StartsWith("binding"))
                {
                    if (haveTestStandartTsb)
                    {
                        continue;
                    }
                }
                i.PerformClick();
            }
            haveTestStandartTsb = true;
        }
Example #3
0
        public static void EditLlz(ArchiveSeeForm masterForm)
        {
            Xceed.Grid.Row row = (masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[0].CurrentRow;
            if (row == null)
            {
                throw new InvalidUserOperationException("请选择要编辑理论值的合同费用项!");
            }
            合同费用项 htfyx = (row as Xceed.Grid.DataRow).Tag as 合同费用项;
            using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<费用理论值信息>())
            {
                rep.Initialize(htfyx.费用理论值, htfyx);
            }

            IList<string> llzs = new List<string>();
            if (htfyx.费用理论值 != null)
            {
                foreach (费用理论值信息 i in htfyx.费用理论值)
                {
                    llzs.Add(i.条件);
                    llzs.Add(i.结果);
                }
            }

            Hd.Service.理论值编辑.FrmEditor form = new Hd.Service.理论值编辑.FrmEditor(
                new Dictionary<string, string> { {"委托人编号", "人员单位_委托人"}, {"船公司编号", "人员单位_船公司"},
                {"箱型编号", "备案_箱型_全部"}, {"提箱地编号", "人员单位_港区堆场"}, {"费用项编号", "费用项_全部"}},
                llzs);
            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IList<string> ret = form.GetResult();
                using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<费用理论值信息>())
                {
                    try
                    {
                        rep.BeginTransaction();
                        foreach (费用理论值信息 i in htfyx.费用理论值)
                        {
                            rep.Delete(i);
                        }
                        htfyx.费用理论值.Clear();
                        for (int i = 0; i < ret.Count; i += 2)
                        {
                            费用理论值信息 item = new 费用理论值信息();
                            item.合同费用项 = htfyx;
                            item.结果 = ret[i + 1];
                            item.条件 = ret[i];
                            item.序号 = i / 2;

                            (new HdBaseDao<费用理论值信息>()).Save(rep, item);
                            htfyx.费用理论值.Add(item);
                        }

                        rep.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        rep.RollbackTransaction();
                        ServiceProvider.GetService<IExceptionProcess>().ProcessWithNotify(ex);
                    }
                }
            }
        }
Example #4
0
        public static void 应收应付出凭证(ArchiveSeeForm masterForm)
        {
            if (masterForm.DisplayManager.CurrentItem == null)
            {
                MessageForm.ShowError("请选择相关人!");
                return;
            }
            System.Data.DataRowView row = masterForm.DisplayManager.CurrentItem as System.Data.DataRowView;

            IControlManager cm = (masterForm.ArchiveDetailForm as IControlManagerContainer).ControlManager;
            cm.AddNew();
            凭证 pz = cm.DisplayManager.CurrentItem as 凭证;
            pz.凭证类别 = 凭证类别.付款凭证;  //row["收付标志"].ToString() == "1" ? 凭证类别.收款凭证 : 凭证类别.付款凭证;
            pz.自动手工标志 = 自动手工标志.手工;
            pz.操作人 = "会计";
            pz.相关人编号 = row["相关人"].ToString();

            masterForm.ShowArchiveDetailForm();
        }
Example #5
0
        //public static bool 凭证金额判断汇率(凭证 entity)
        //{
        //    if (Feng.Windows.Forms.MessageForm.ShowYesNo("当前汇率为" + entity.会计金额.Value / entity.金额.数额.Value, "确认")
        //        == System.Windows.Forms.DialogResult.No)
        //    {
        //        return false;
        //    }
        //    else
        //    {
        //        return true;
        //    }
        //}
        public static void AutoExecute(ArchiveSeeForm masterForm)
        {
            ((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[1] as IArchiveGrid).DisplayManager.SelectedDataValueChanged += new EventHandler<SelectedDataValueChangedEventArgs>(DisplayManagerPzsfmx_SelectedDataValueChanged);

            ((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[0] as IArchiveGrid).DisplayManager.SelectedDataValueChanged += new EventHandler<SelectedDataValueChangedEventArgs>(DisplayManagerPzfymx_SelectedDataValueChanged);

            ((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[0] as IArchiveGrid).InsertionRow.EditBegun += new EventHandler(InsertionRow_EditBegun);

            ((masterForm.ArchiveDetailForm as IArchiveDetailFormWithDetailGrids).DetailGrids[1] as IArchiveGrid).InsertionRow.EditBegun += new EventHandler(InsertionRow2_EditBegun);

            (masterForm.ArchiveDetailForm as IArchiveDetailFormAuto).DataControlsCreated += new EventHandler(ArchiveDetailForm_DataControlsCreated);
        }
Example #6
0
 //public static void 发票入账(ArchiveOperationForm masterForm)
 //{
 //    发票 entity = masterForm.DisplayManager.CurrentItem as 发票;
 //    if (entity == null)
 //        return;
 //    if (entity.Submitted)
 //    {
 //        MessageForm.ShowWarning("此发票不能操作!");
 //        return;
 //    }
 //    if (entity.是否作废)
 //    {
 //        MessageForm.ShowWarning("此发票已作废!");
 //        return;
 //    }
 //    entity.Submitted = true;
 //    masterForm.DoEdit();
 //}
 //public static void 作废发票(ArchiveOperationForm masterForm)
 //{
 //    发票 entity = masterForm.DisplayManager.CurrentItem as 发票;
 //    if (entity == null)
 //        return;
 //    if (entity.Submitted)
 //    {
 //        MessageForm.ShowWarning("此发票不能作废!");
 //        return;
 //    }
 //    if (entity.是否作废)
 //    {
 //        MessageForm.ShowWarning("此发票已作废!");
 //        return;
 //    }
 //    entity.是否作废 = true;
 //    masterForm.DoEdit();
 //}
 //public static void 撤销操作发票(ArchiveOperationForm masterForm)
 //{
 //    发票 entity = masterForm.DisplayManager.CurrentItem as 发票;
 //    if (entity == null)
 //        return;
 //    if (!entity.Submitted && !entity.是否作废)
 //    {
 //        MessageForm.ShowWarning("此发票未进行操作!");
 //        return;
 //    }
 //    if (MessageForm.ShowYesNo("是否确认撤销?", "确认") == DialogResult.No)
 //    {
 //        return;
 //    }
 //    Dictionary<string, object> saved = new Dictionary<string, object>();
 //    saved["入账日期"] = entity.入账日期;
 //    entity.Submitted = false;
 //    entity.是否作废 = false;
 //    entity.入账日期 = null;
 //    masterForm.ControlManager.DisplayManager.DisplayCurrent();
 //    masterForm.ControlManager.EditCurrent();
 //    masterForm.ControlManager.EndEdit();
 //}
 public static void AutoExecute(ArchiveSeeForm masterForm)
 {
     (masterForm.ArchiveDetailForm as IArchiveDetailFormAuto).DataControlsCreated += new EventHandler(ArchiveDetailForm_DataControlsCreated);
 }