Ejemplo n.º 1
0
        public CorporateUserControl(Corporate corporate, Form pMdiParent, IApplicationController applicationController)
        {
            _applicationController = applicationController;
            _mdifrom     = pMdiParent;
            _corporate   = corporate;
            _fundingLine = null;
            InitializeComponent();
            InitializeUserControlsAddress();
            InitializeCorporate();
            PicturesServices ps = ServicesProvider.GetInstance().GetPicturesServices();

            if (ps.IsEnabled())
            {
                pictureBox1.Image    = ps.GetPicture("CORPORATE", corporate.Id, true, 0);
                pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
                pictureBox2.Image    = ps.GetPicture("CORPORATE", corporate.Id, true, 1);
                pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
            }
            else
            {
                pictureBox1.Visible           = false;
                pictureBox2.Visible           = false;
                linkLabelChangePhoto.Visible  = false;
                linkLabelChangePhoto2.Visible = false;
            }
        }
Ejemplo n.º 2
0
        public void InitializePhoto()
        {
            PicturesServices ps = ServicesProvider.GetInstance().GetPicturesServices();

            if (!ps.IsEnabled())
            {
                pictureBox.Visible               = false;
                pictureBox2.Visible              = false;
                pbSignature.Visible              = false;
                changePhotoLinkLabel.Visible     = false;
                changePhotoLinkLabel2.Visible    = false;
                changeSignatureLinkLabel.Visible = false;
                tabPageSignature.Hide();
                return;
            }

            int photoSubId = 0;//it means that we want to get 1st picture

            pictureBox.Image    = ps.GetPicture(_tempPerson.Id, photoSubId, true);
            pictureBox.SizeMode = PictureBoxSizeMode.Zoom;

            photoSubId           = 1;//it means that we want to get 2nd picture
            pictureBox2.Image    = ps.GetPicture(_tempPerson.Id, photoSubId, true);
            pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;

            photoSubId           = 2;//it means that we want to get signature
            pbSignature.Image    = ps.GetPicture(_tempPerson.Id, photoSubId, true);
            pbSignature.SizeMode = PictureBoxSizeMode.Zoom;
        }
Ejemplo n.º 3
0
        protected void InitDocuments()
        {
            Debug.Assert(Tabs != null, "TabControl is null");
            Debug.Assert(Client != null, "Client is null");

            PicturesServices ps = ServicesProvider.GetInstance().GetPicturesServices();

            if (!ps.IsEnabled())
            {
                return;
            }
        }
Ejemplo n.º 4
0
        private void InitializeControls()
        {
            _ucAddress              = new AddressUserControl();
            _ctxProducts            = new ContextMenuStrip();
            _ucAddress.ExtraVisible = false;
            _ucAddress.Dock         = DockStyle.Fill;
            gbAddress.Controls.Add(_ucAddress);
            InitializeLoanOfficers();
            if (_village != null && _village.Id > 0)
            {
                tbName.Text         = _village.Name;
                dtDate.Value        = _village.EstablishmentDate.HasValue ? _village.EstablishmentDate.Value : TimeProvider.Now;
                _ucAddress.District = _village.District;
                _ucAddress.City     = _village.City;
                _ucAddress.Comments = _village.Address;
                _ucAddress.ZipCode  = _village.ZipCode;
                btnSave.Text        = MultiLanguageStrings.GetString(Ressource.VillageForm, "Update.Text");
                DisplayMembers();
                DisplaySavings();
                DisplayLoans();

                if (_village.MeetingDay.HasValue)
                {
                    cmbWeekDay.SelectedIndex = (int)_village.MeetingDay;
                    cbMeetingDay.Checked     = true;
                }

                if (_village.LoanOfficer != null)
                {
                    foreach (object item in cbLoanOfficers.Items)
                    {
                        User user = item as User;
                        if (user != null && user.Id == _village.LoanOfficer.Id)
                        {
                            cbLoanOfficers.SelectedItem = item;
                            break;
                        }
                    }
                }
            }
            else
            {
                tabPageLoan.Enabled    = false;
                tabPageSavings.Enabled = false;
            }

            PicturesServices ps = ServicesProvider.GetInstance().GetPicturesServices();

            if (ps.IsEnabled())
            {
                pictureBox1.Image    = ps.GetPicture("VILLAGE", _village.Id, true, 0);
                pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
                pictureBox2.Image    = ps.GetPicture("VILLAGE", _village.Id, true, 1);
                pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
            }
            else
            {
                pictureBox1.Visible           = false;
                pictureBox2.Visible           = false;
                linkLabelChangePhoto.Visible  = false;
                linkLabelChangePhoto2.Visible = false;
            }

            foreach (Branch branch in User.CurrentUser.Branches)
            {
                cbBranch.Items.Add(branch);
            }
            if (_village.Id > 0)
            {
                cbBranch.SelectedItem = _village.Branch;
            }
            else if (cbBranch.Items.Count > 0)
            {
                cbBranch.SelectedIndex = 0;
            }

            btnPrint.ReportInitializer = report => report.SetParamValue("village_id", _village.Id);
            btnPrint.LoadReports();
        }