private void OpenAddType()
        {
            AddTypeOfAgencyWindow wd = new AddTypeOfAgencyWindow();

            this.ListType = DataProvider.Instance.DB.TypeOfAgencies.ToList <TypeOfAgency>();

            string[] rules = this.cache.Split(' ');
            if (this.ListType.Count >= int.Parse(rules[0]))
            {
                MessageBox.Show("Over the limit in Setting");
                return;
            }
            try
            {
                wd.txtID.Text = (this.ListType.Last().ID + 1).ToString();
            }
            catch
            {
                wd.txtID.Text = "1";
            }
            finally
            {
                wd.ShowDialog();
            }
        }
        private void EditType(TypeOfAgencyUC para)
        {
            int stt = int.Parse(para.txbSTT.Text);

            this.ListType = DataProvider.Instance.DB.TypeOfAgencies.ToList();

            AddTypeOfAgencyWindow wd = new AddTypeOfAgencyWindow();

            wd.txtID.Text   = this.ListType[stt - 1].ID.ToString();
            wd.txtName.Text = this.ListType[stt - 1].Name;
            wd.txtDebt.Text = SeparateThousands(this.ListType[stt - 1].MaxOfDebt.ToString());

            wd.ShowDialog();
        }