Пример #1
0
        private void InitializeUserControl(OClientTypes pClientType, Form pMdiParent)
        {
            btnLoanShares.Visible = OClientTypes.Group == pClientType;

            tabControlPerson.TabPages.Remove(tabPageProject);
            tabControlPerson.TabPages.Remove(tabPageCreditCommitee);
            tabControlPerson.TabPages.Remove(tabPageLoansDetails);
            tabControlPerson.TabPages.Remove(tabPageAdvancedSettings);
            tabControlPerson.TabPages.Remove(tabPageLoanRepayment);
            tabControlPerson.TabPages.Remove(tabPageLoanGuarantees);
            tabControlPerson.TabPages.Remove(tabPageSavingDetails);
            tabControlPerson.TabPages.Remove(tabPageContracts);

            InitializeProjectAddress();

            if (pClientType == OClientTypes.Person)
            {
                _personUserControl = new PersonUserControl(_person, pMdiParent)
                {
                    Dock = DockStyle.Fill,
                    Enabled = true,
                    Name = "personUserControl",
                    Visible = true
                };

                _personUserControl.ButtonCancelClick += personUserControl_ButtonCancelClick;
                _personUserControl.ButtonSaveClick += personUserControl_ButtonSaveClick;
                _personUserControl.ButtonBadLoanClick += personUserControl_ButtonBadLoanClick;

                _personUserControl.ButtonAddProjectClick += personUserControl_ButtonAddProjectClick;

                _personUserControl.ViewProject += DisplayUserControl_ViewProject;
                _personUserControl.AddSelectedSaving += PersonUserControl_SavingSelected;
                _personUserControl.ViewSelectedSaving += PersonUserControl_ViewSelectedSaving;
                tabPageDetails.Controls.Add(_personUserControl);

                if (!ServicesProvider.GetInstance().GetGeneralSettings().UseProjects)
                {
                    _personUserControl.RemoveSavings();
                    panelSavingsContracts.Controls.Add(_personUserControl.PanelSavings);
                }
            }
            else if (pClientType == OClientTypes.Group)
            {
                _groupUserControl = new GroupUserControl(_group, pMdiParent)
                {
                    Dock = DockStyle.Fill,
                    Enabled = true,
                    Name = "groupUserControl",
                    Visible = true
                };
                _groupUserControl.ButtonCancelClick += GroupUserControl_ButtonCancelClick;
                _groupUserControl.ButtonSaveClick += GroupUserControl_ButtonSaveClick;
                _groupUserControl.ButtonBadClientClick += GroupUserControl_ButtonBadClientClick;

                _groupUserControl.ButtonAddProjectClick += GroupUserControl_ButtonAddProjectClick;
                _groupUserControl.ViewSelectedSaving += GroupUserControl_ViewSelectedSaving;
                _groupUserControl.AddSelectedSaving += GroupUserControl_AddSelectedSaving;

                _groupUserControl.ViewProject += DisplayUserControl_ViewProject;
                _groupUserControl.MembersChanged += MembersChanged;

                tabPageDetails.Controls.Add(_groupUserControl);

                if (!ServicesProvider.GetInstance().GetGeneralSettings().UseProjects)
                {
                    _groupUserControl.RemoveSavings();
                    panelSavingsContracts.Controls.Add(_groupUserControl.PanelSavings);
                    AddProject(null);
                }
            }
            else
            {
                _corporateUserControl = new CorporateUserControl(_corporate, pMdiParent)
                {
                    Dock = DockStyle.Fill,
                    Enabled = true,
                    Name = "corporateUserControl",
                    Visible = true
                };

                _corporateUserControl.ViewProject += DisplayUserControl_ViewProject;
                _corporateUserControl.ButtonCancel += CorporateUserControl_ButtonCancel;
                _corporateUserControl.ButtonAddProjectClick += corporateUserControl_ButtonAddProjectClick;
                _corporateUserControl.ButtonSaveClick += CorporateUserControl_ButtonSaveClick;
                _corporateUserControl.ViewSelectedSaving += CorporateUserControl_ViewSelectedSaving;
                _corporateUserControl.AddSelectedSaving += CorporateUserControl_AddSelectedSaving;

                if (_closeFormAfterSave)
                    _corporateUserControl.CloseCorporate += CorporateUserControl_Closed;

                tabPageDetails.Controls.Add(_corporateUserControl);

                if (!ServicesProvider.GetInstance().GetGeneralSettings().UseProjects)
                {
                    _corporateUserControl.RemoveSavings();
                    panelSavingsContracts.Controls.Add(_corporateUserControl.PanelSavings);
                    AddProject(null);
                    tabControlPerson.SelectedTab = tabPageCorporate;
                }
            }
        }
Пример #2
0
 public ShowPictureForm(Group group, GroupUserControl groupUserControl, int photoSubId)
 {
     InitializeComponent();
     CaptionText = MultiLanguageStrings.GetString(Ressource.ClientForm, "Group.Text") + ": " + group.Name;
     this.groupUserControl = groupUserControl;
     this.group = group;
     this.photoSubId = photoSubId;
     addPhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionAdd.Text");
     changePhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionChange.Text");
     ShowPicture();
     InitializeButtons();
 }