Example #1
0
 public ActionResult Add(School e)
 {
     ActionResult ar = null;
     try {
         this.BeforeAddData(e, ref ar);
         if (ar == null) {
             this.Service.Add(e);
             e = this.Service.FindById(e.Id);
             //ar = this.Json(new AjaxOperationResult { Data = e, Successful = true });
             this.AfterAddData(e, ref ar);
         }
     } catch (Exception ex) {
         ar = this.Json(new AjaxOperationResult { Successful = false, Message = ex.Message });
     }
     return ar;
 }
Example #2
0
        private void FixupSchool(School previousValue)
        {
            if (previousValue != null && previousValue.SchoolContacts.Contains(this))
            {
                previousValue.SchoolContacts.Remove(this);
            }

            if (School != null)
            {
                if (!School.SchoolContacts.Contains(this))
                {
                    School.SchoolContacts.Add(this);
                }
                if (SchoolId != School.Id)
                {
                    SchoolId = School.Id;
                }
            }
        }
Example #3
0
        private void FixupGruduateSchool(School previousValue)
        {
            if (previousValue != null && previousValue.Student_File.Contains(this))
            {
                previousValue.Student_File.Remove(this);
            }

            if (GruduateSchool != null)
            {
                if (!GruduateSchool.Student_File.Contains(this))
                {
                    GruduateSchool.Student_File.Add(this);
                }
                if (GruduateSchoolId != GruduateSchool.Id)
                {
                    GruduateSchoolId = GruduateSchool.Id;
                }
            }
            else if (!_settingFK)
            {
                GruduateSchoolId = null;
            }
        }
Example #4
0
 public void Delete(School entity)
 {
     this.Repository.Delete(entity);
     this.Db.Save();
 }
Example #5
0
 public void Add(School entity)
 {
     this.Repository.Add(entity);
     this.Db.Save();
 }
Example #6
0
 public void Update(School entity)
 {
     this.Repository.Update(entity);
     this.Db.Save();
 }
Example #7
0
 public void Save(School entity)
 {
     if(entity.Id==0){
         this.Add(entity);
     }else{
         this.Db.Save();
     }
 }
Example #8
0
partial         void BeforeUpdateData(School e, ref ActionResult ar);
Example #9
0
partial         void BeforeShowEditView(School e);
Example #10
0
partial         void BeforeAddData(School e, ref ActionResult ar);
Example #11
0
partial         void AfterUpdateData(School e, ref ActionResult ar);
Example #12
0
partial         void AfterAddData(School e, ref ActionResult ar);
Example #13
0
partial         void AddRowToGridModel(LigerGridModel m, School e);