Ejemplo n.º 1
0
        /// <summary>
        /// Метод для проверки наличая базы при старте программы
        /// </summary>
        private void BaseCheck()
        {
            if (File.Exists("base.json"))
            {
                repo = new OrganizationBase();
                //repo.RandomBaseGenerator();

                organization = repo.GetOrganization();
                //CalcSalary();
            }
            else
            {
                MessageBox.Show("База в месте по умолчанию не обнаруженна,введите название для организации!");
                repo         = new OrganizationBase("base.json");
                organization = repo.GetOrganization();
                AddDepartment adddep = new AddDepartment(organization);

                if (adddep.ShowDialog() == true)
                {
                    mainorg_expanded();
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新记录
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool Update(OrganizationBase entity)
 {
     return(_repository.Update(entity));
 }
Ejemplo n.º 3
0
 public void SetUp()
 {
     _ctx          = new TestUtil.TestContext();
     _organization = new BookClub(_ctx.Listen360, TestUtil.GetXmlDocument("<book-club><id type=\"integer\">1</id></book-club>"));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 创建记录
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public bool Create(OrganizationBase entity)
 {
     return(_repository.CreateObject(entity));
 }
Ejemplo n.º 5
0
        public bool Update(OrganizationBase entity)
        {
            var flag = _repository.Update(entity);

            return(flag);
        }