Esempio n. 1
0
        /// <summary>
        /// 終了処理
        /// </summary>
        public override void Dispose()
        {
            Master.Dispose();
            Master = null;

            ClientStaffs.Clear();
            ClientStaffs = null;

            foreach (var summary in Summaries)
            {
                summary.InitializeTotalPrice();
            }

            Summaries.Clear();
            Summaries = null;
        }
Esempio n. 2
0
        /// <summary>
        /// ファイル読込
        /// </summary>
        public override void Read()
        {
            Master       = new MasterFile();
            ClientStaffs = new ObservableCollection <Staff>();
            Summaries    = new ObservableCollection <QuoteSummary>();

            ClientName = GetValue(nameof(ClientName), "");
            QuoteNo    = GetValue(nameof(QuoteNo), "");
            QuoteDate  = GetValue(nameof(QuoteDate), DateTime.Today);
            JobName    = GetValue(nameof(JobName), "");
            Remarks    = GetValue(nameof(Remarks), "");

            if (Element != null)
            {
                var delivery = Element.Element(nameof(DeliveryDate));
                DeliveryDate = new DeliveryDate()
                {
                    No   = GetValue(delivery.Element(nameof(DeliveryDate.No)), 0d),
                    Unit = GetValue(delivery.Element(nameof(DeliveryDate.Unit)), DeliveryUnit.Months)
                };

                foreach (var element in Element.Elements(nameof(ClientStaffs)))
                {
                    ClientStaffs.Add(new Staff(GetValue(element.Element(nameof(Staff.FirstName)), "")
                                               , GetValue(element.Element(nameof(Staff.FirstKana)), "")
                                               , GetValue(element.Element(nameof(Staff.LastName)), "")
                                               , GetValue(element.Element(nameof(Staff.LastKana)), "")
                                               , GetValue(element.Element(nameof(Staff.Department)), "")
                                               , GetValue(element.Element(nameof(Staff.Position)), "")
                                               , GetValue(element.Element(nameof(Staff.EMailAddress)), "")
                                               , GetValue(element.Element(nameof(Staff.MobilePhone)), "")
                                               , GetValue(element.Element(nameof(Staff.Remarks)), "")
                                               , GetAttribute(element, nameof(Staff.CreateDate), DateTime.Now)
                                               , GetAttribute(element, nameof(Staff.IsNotationFullName), false)
                                               , GetAttribute(element, nameof(Staff.IsFullNameJapaneseStyle), true)
                                               , GetAttribute(element, nameof(Staff.IsSelected), false))
                    {
                        IsSelected = GetAttribute(element, nameof(Staff.IsSelected), false)
                    });
                }

                foreach (var element in Element.Elements(nameof(QuoteSummary)))
                {
                    Summaries.Add(new QuoteSummary()
                    {
                        No        = GetValue(element.Element(nameof(QuoteSummary.No)), 1),
                        Summary   = GetValue(element.Element(nameof(QuoteSummary.Summary)), ""),
                        Volume    = GetValue(element.Element(nameof(QuoteSummary.Volume)), 0),
                        Unit      = GetValue(element.Element(nameof(QuoteSummary.Unit)), VolumeUnit.Pieces),
                        UnitPrice = GetValue(element.Element(nameof(QuoteSummary.UnitPrice)), 0),
                    });
                }
            }
            else
            {
                DeliveryDate = new DeliveryDate()
                {
                    No   = 0d,
                    Unit = DeliveryUnit.Months
                };
            }
        }