Esempio n. 1
0
 private void GetValues(ref core_student item)
 {
     item.id                  = View.ID;
     item.number              = View.Number;
     item.firstname           = View.Firstname;
     item.middlename          = View.Middlename;
     item.lastname            = View.Lastname;
     item.dateofbirth         = View.DateOfBirth;
     item.gender_id           = View.Gender_ID;
     item.civilstatus_id      = View.CivilStatus_ID;
     item.citizenship         = View.Citizenship;
     item.barangay_id         = View.Barangay_ID;
     item.street              = View.Street;
     item.note                = View.Note;
     item.picture             = View.Picture;
     item.fathername          = View.FatherName;
     item.fatheraddress       = View.FatherAddress;
     item.fathercontactnumber = View.FatherContactNumber;
     item.fatheroccupation    = View.FatherOccupation;
     item.mothername          = View.MotherName;
     item.motheraddress       = View.MotherAddress;
     item.mothercontactnumber = View.MotherContactNumber;
     item.motheroccupation    = View.MotherOccupation;
     item.RFID                = View.RFID;
 }
Esempio n. 2
0
        private void CreateStudent()
        {
            try
            {
                if (BrokenRules.Count > 0)
                {
                    View.Notify(Common.Result.ValidationFailed, BrokenRules);
                    return;
                }

                core_student item;
                item = new core_student();
                GetValues(ref item);
                var result = Controller.CreateObject <core_student>(item);
                View.ID = result.id;
                View.Notify(Common.Result.InsertSucceeded, null);
            }
            catch (Exception ex)
            {
                View.Notify(Common.Result.InsertFailed, new List <string> {
                    ex.ToString()
                });
            }
        }
        private void Fixupcore_student(core_student previousValue)
        {
            if (previousValue != null && previousValue.core_guardian.Contains(this))
            {
                previousValue.core_guardian.Remove(this);
            }

            if (core_student != null)
            {
                if (!core_student.core_guardian.Contains(this))
                {
                    core_student.core_guardian.Add(this);
                }
                if (student_id != core_student.id)
                {
                    student_id = core_student.id;
                }
            }
        }