Exemple #1
0
        private void TaoTreeView()
        {
            Presentation.Process.KeToanProcess process = new Presentation.Process.KeToanProcess();
            AutoComboBox au = new AutoComboBox();

            try
            {
                AutoCompleteEntry auDonVi = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi);
                if (auDonVi != null)
                {
                    trvPhanLoai.Items.Clear();
                    dtMaPhanLoai = process.getDanhSachMaPhanLoai(auDonVi.KeywordStrings[0], "(''" + BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri() + "'')", BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), "%");
                    if (dtMaPhanLoai != null && dtMaPhanLoai.Tables.Count > 0)
                    {
                        dtMaPhanLoai.Relations.Add("Master2Detail", dtMaPhanLoai.Tables[0].Columns["ID"], dtMaPhanLoai.Tables[0].Columns["ID_PLOAI_CHA"]);
                        DataView dv = dtMaPhanLoai.Tables[0].DefaultView;
                        dv.RowFilter            = "ID_PLOAI_CHA IS NULL";
                        trvPhanLoai.ItemsSource = dv;
                    }
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                au      = null;
                process = null;
            }
        }