Пример #1
0
        public FormAddPerson(Person person, int addressId)
        {
            InitializeComponent();
            _repo = new Repository();
            _addressId = addressId;
            _person = person;

            this.Text = "Изменить";
            textBoxFirstName.Text = person.FirstName;
            textBoxLastName.Text = person.LastName;
            textBoxPatronymic.Text = person.Patronymic;
            dateEditDoB.DateTime = DateTime.FromBinary(person.DoB);
            comboBoxEditGender.SelectedIndex = person.Gender ? 0 : 1;
            textBoxSeries.Text = person.PassportSeries;
            textBoxNumber.Text = person.PassportNumber;
            comboBoxDocType.SelectedIndex = person.Type.Equals("Паспорт") ? 0 : 1;

            buttonSave.Click -= buttonSave_Click;
            buttonSave.Click += new System.EventHandler(buttonSave_ClickUpdate);
        }
Пример #2
0
        public XtraReportLivingCertificate(Person person, Address address, List<Person> family)
        {
            InitializeComponent();
            _person = person;

            string lastName = person.Gender
                ? Grammatic.GetDeclinedMaleLastName(person.LastName)
                : Grammatic.GetDeclinedFemaleLastName(person.LastName);

            string firstName = person.Gender
                ? Grammatic.GetDeclinedMaleFirstName(person.FirstName)
                : Grammatic.GetDeclinedFemaleFirstName(person.FirstName);

            string patronymic = person.Gender
                ? Grammatic.GetDeclinedMalePatrinymic(person.Patronymic)
                : Grammatic.GetDeclinedFemalePatronymic(person.Patronymic);

            string dob = DateTime.FromBinary(_person.DoB).Year + " г.р.,";

            xrLabelPerson.Text = lastName + " " + firstName + " " + patronymic + ", " + dob;

            string gender = person.Gender ? "он" : "она";
            string registration = person.Gender ? string.Empty : "a";

            xrLabelText.Text = "в том, что " + gender + " действительно зарегистрирован" + registration + " и проживает по адресу: ";

            string apartment = (address.Apartment == 0) ? string.Empty : ", кв." + address.Apartment;
            string addr = "г." + address.City + ", " + address.District + " район, ул."
                + address.Street + ", д." + address.Building + apartment + ".";

            xrLabelAddress.Text = addr;

            foreach (var member in family)
            {
                xrLabelFamilyMembers.Text += member.LastName + " " + member.FirstName + " " + member.Patronymic + ", "
                                          + DateTime.FromBinary(member.DoB).Year + " г.р.\n";
            }
        }