예제 #1
0
 /// <summary>
 /// 終了処理
 /// </summary>
 public void Dispose()
 {
     if (_File != null)
     {
         _File.Dispose();
         _File = null;
     }
 }
예제 #2
0
        /// <summary>
        /// 指定取引先の担当一覧を作成
        /// </summary>
        /// <param name="clientName">指定取引先</param>
        /// <param name="selectedStaffs">選択済の担当一覧</param>
        private void MakeClientStaffs(string clientName, ObservableCollection <Staff> selectedStaffs)
        {
            string wildName = "";

            // 初期化
            InitializeStaffs();
            Staffs = new ObservableCollection <Staff>();

            ClientName = clientName;

            // 取引先一覧の取得
            var clientList = new ClientsFile();

            // 取引先一覧より指定取引先を検索
            foreach (var client in clientList.Clients)
            {
                if (client.Name.Equals(clientName))
                {
                    wildName = client.FileWildName;
                    break;
                }
            }

            // メモリ解放
            clientList.Dispose();
            clientList = null;

            if (!wildName.Equals(""))
            {
                // 取引先詳細の取得
                var client = new ClientDetailFile(wildName);

                // 担当一覧の取得
                foreach (var staff in client.Staffs)
                {
                    Staffs.Add((Staff)staff.Clone());

                    bool isSelected         = false;
                    bool isNotationFullName = false;
                    var  index = selectedStaffs.IndexOf(staff);

                    if (!index.Equals(-1))
                    {
                        isSelected         = selectedStaffs[index].IsSelected;
                        isNotationFullName = selectedStaffs[index].IsNotationFullName;
                    }

                    Staffs[Staffs.Count - 1].IsSelected         = isSelected;
                    Staffs[Staffs.Count - 1].IsNotationFullName = isNotationFullName;
                }

                // メモリ解放
                client.Dispose();
                client = null;
            }
        }
예제 #3
0
        /// <summary>
        /// 終了処理
        /// </summary>
        public void Dispose()
        {
            _JobFile.Dispose();
            _JobFile = null;

            if (_ClientsFile != null)
            {
                _ClientsFile.Dispose();
                _ClientsFile = null;
            }
        }