/// <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(); } } }
/// <summary> /// 更新记录 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Update(OrganizationBase entity) { return(_repository.Update(entity)); }
public void SetUp() { _ctx = new TestUtil.TestContext(); _organization = new BookClub(_ctx.Listen360, TestUtil.GetXmlDocument("<book-club><id type=\"integer\">1</id></book-club>")); }
/// <summary> /// 创建记录 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Create(OrganizationBase entity) { return(_repository.CreateObject(entity)); }
public bool Update(OrganizationBase entity) { var flag = _repository.Update(entity); return(flag); }