示例#1
0
 public bool SaveRecord(Record r)
 {
     if (r != null)
     {
         var p = new Person {_firstname = r._firstname,
                             _lastname = r._lastname,
                             _age = r._age,
                             _sex = r._sex
         };
         return p.create() > 0 ? true : false;
     }
     return false;
 }
示例#2
0
        public Record GetRecord()
        {
            if (!GuiTools.HasBlankControls(this,typeof(TextBox)))
            {
                var r = new Record
                            {
                                _firstname = FirstName,
                                _lastname = LastName,
                                _sex = Sex.ToString(),
                                _age = new Age(BirthDate).Years
                            };

                return r;
            }
            else
            {
                MessageBox.Show(@"Please fill the necessary informations.Thanks");
            }
            return null;
        }