public static bool DeleteOrganization(Organization organization) { if (MessageBox.Show(string.Concat("Вы действительно хотите удалить организацию \"", organization.ShortName, "\"?\n\nПри этом будут удалены входящие в неё подразделения и привязанные к ним персоны, если таковые имеются."), "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) { OrganizationList organizationList = OrganizationList.GetUniqueInstance(); if (organizationList.GetChildList(organization).Count() > 0) { if (MessageBox.Show("У филиала имеются зависимые организации, они будут также удалены. Продолжить удаление?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) return false; } PersonList personList = PersonList.GetUniqueInstance(); if (personList.GetItems(organization).Count() > 0) { if (MessageBox.Show("В организации имеются сотрудники, они будут также удалены. Продолжить удаление?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) return false; } organization.Delete(); return true; } return false; }
public FormAddOtherOrganization(Organization organization) { InitializeComponent(); _organization = organization; _realRegionList = RealRegionList.GetUniqueInstance(); _historyList = HistoryList.GetUniqueInstance(); }
public FormAddOrganization(Organization organization) { InitializeComponent(); _organization = organization; _parentLPU = (_organization.ParentOrganization as LPU); _mainSpecList = MainSpecList.GetUniqueInstance(); _historyList = HistoryList.GetUniqueInstance(); }
public static void CheckINN(Organization organization, string inn) { if ((inn.Length != 10) && (inn.Length != 12)) throw new NullReferenceException("Поле ИНН должно содержать 10 или 12 цифр"); if ((inn != organization.INN) && (inn.Length == 12)) { if (MessageBox.Show("Данная организация является ИП?", "ИНН содержит 12 цифр", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) throw new NullReferenceException("Перед сохранением необходимо исправить поле ИНН"); } }
public string GetRecordType(Organization organization) { if (organization.TypeOrg == TypeOrg.ЛПУ) return RecordType.RU_Hospital.ToString(); if ((organization.TypeOrg == TypeOrg.Отделение) || ((organization.TypeOrg == TypeOrg.Аптека) && (organization.ParentOrganization != null))) return RecordType.RU_Department.ToString(); if (organization.TypeOrg == TypeOrg.Аптека) return RecordType.RU_Pharmacy.ToString(); return RecordType.RU_Other.ToString(); }
private Organization GetOrganization(TypeOrg typeOrg, bool haveParent) { Organization organization = new Organization(typeOrg); if (haveParent) { organization.ParentOrganization = OrganizationList.GetUniqueInstance().GetFirst(); } return organization; }
public FormPersonList(Organization organization = null) { InitializeComponent(); if (organization != null) this.Text = string.Concat("Справочник: Персоны-SF, Организация: ", organization.ShortName); _myStatusStrip = new MyStatusStrip(dgv, statusStrip1); _personListController = new PersonListController(dgv, organization); }
public PersonListController(DataGridView dgv, Organization organization) : base(dgv) { _organization = organization; _dgv = dgv; _seacher = new SearchInDgv(_dgv); _personList = PersonList.GetUniqueInstance(); _user = UserLogged.Get(); _filtredDGV = new FilteredDGV(dgv); _sortDGV = new SortDGV(dgv); }
public static TreeNode GetRoot(Organization organization, TreeNode root = null) { TreeNode node = new TreeNode(organization.ShortName); node.Name = organization.ID.ToString(); node.ImageIndex = (organization is LPU) ? 1 : 0; node.SelectedImageIndex = (organization is LPU) ? 1 : 0; if (root != null) root.Nodes.Add(node); OrganizationList organizationList = OrganizationList.GetUniqueInstance(); var list = organizationList.GetChildList(organization); foreach (var item in list) GetRoot(item, node); return node; }
private Organization GetOrganization(OrganizationModel model) { Organization organization = organizationList.GetItem(model.NumberSF); if (organization == null) { try { TypeOrg typeOrg = GetTypeOrg(model); organization = new Organization(typeOrg); } catch (NullReferenceException) { if (model.RecordType == "RU_Other") LogManager.WriteNotFound(model.ClientType, "Organization subtype", model.NumberSF); else LogManager.WriteNotFound(model.RecordType, "Organization type", model.NumberSF); } } return organization; }
public static Organization CreateItem(TypeOrg typeOrg, Organization parentOrganization = null) { Organization organization = (typeOrg == TypeOrg.ЛПУ) ? new LPU(typeOrg) : new Organization(typeOrg); organization.ParentOrganization = parentOrganization; return organization; }
public SubOrganizationList(Organization organization) { OrganizationList organizationList = OrganizationList.GetUniqueInstance(); _list = organizationList.GetSubOrganizationList(organization); _organization = organization; }
private void ShowFormSubLPU(Organization organization) { bool result = false; if (organization is LPU) { FormAddLPU formAddLPU = new FormAddLPU(organization as LPU); result = (formAddLPU.ShowDialog() == System.Windows.Forms.DialogResult.OK); } else { FormAddOrganization formAddOrganization = new FormAddOrganization(organization); result = (formAddOrganization.ShowDialog() == System.Windows.Forms.DialogResult.OK); } if (result) LoadTree(); }
private string GetFormatTypeOrg(Organization organization) { string[] typeOrg = _typeOrgRus; if ((organization.TypeOrg == TypeOrg.ЛПУ) && (organization.ParentOrganization == null)) return typeOrg[0]; else if (organization.TypeOrg == TypeOrg.ЛПУ) return typeOrg[1]; else if (organization.TypeOrg == TypeOrg.Отделение) return typeOrg[2]; else if ((organization.TypeOrg == TypeOrg.Аптека) && (organization.ParentOrganization != null)) return typeOrg[3]; else if (organization.TypeOrg == TypeOrg.Отдел) return typeOrg[4]; else if (organization.TypeOrg == TypeOrg.Аптека) return typeOrg[5]; else if (organization.TypeOrg == TypeOrg.Административное_Учреждение) return typeOrg[6]; else if (organization.TypeOrg == TypeOrg.Дистрибьютор) return typeOrg[7]; return typeOrg[8]; }
private string GetClientType(Organization organization) { if (organization.TypeOrg == TypeOrg.Отдел) return clientType[0]; else if (organization.TypeOrg == TypeOrg.Административное_Учреждение) return clientType[1]; else if (organization.TypeOrg == TypeOrg.Дистрибьютор) return clientType[2]; return string.Empty; }
private string GetAddressWithDistrict(Organization organization) { string district = string.Empty; string street = string.Empty; Organization mainOrganization = (organization.ParentOrganization == null) ? organization : organization.ParentOrganization; if (mainOrganization != null) { street = mainOrganization.Street; } return CheckIsEmpty(district, street); }