Beispiel #1
0
        //констркутор формы для добавления заключенного
        public Add_Form(int index, Prison jailed)
        {
            InitializeComponent();
            this.jailed  = jailed;
            this.forEdit = true;
            this.index   = index;
            Prisoner prisoner = jailed[index];

            First_Name.Text  = prisoner.First_Name;
            Second_Name.Text = prisoner.Second_Name;
            Room.Text        = Convert.ToString(prisoner.Room);
            Criminality.Text = prisoner.Criminality;
            Day.Text         = Convert.ToString(prisoner.DateOfJailed.Day);
            Month.Text       = Convert.ToString(prisoner.DateOfJailed.Month);
            Year.Text        = Convert.ToString(prisoner.DateOfJailed.Year);
            PITPH.Text       = prisoner.PITPH;
            Relatives.Text   = prisoner.Relatives;
            Temper.Text      = prisoner.Temper;
        }
        private void DisplayPrisoner(Prisoner prisoner, int index)
        {
            DataRow row = table.NewRow();

            row["№"]                         = index;
            row["Имя"]                       = prisoner.First_Name;
            row["Фамилия"]                   = prisoner.Second_Name;
            row["Камера"]                    = prisoner.Room;
            row["Статья"]                    = prisoner.Criminality;
            row["Дата заключения"]           = prisoner.DateOfJailed.Day + "/" + prisoner.DateOfJailed.Month + "/" + prisoner.DateOfJailed.Year;
            row["Место в тюремной иерархии"] = prisoner.PITPH;
            if (prisoner.Relatives == "")
            {
                row["Родственики"] = "-";
            }
            else
            {
                row["Родственики"] = prisoner.Relatives;
            }
            row["Характер"] = prisoner.Temper;
            table.Rows.Add(row);
        }