コード例 #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;
 }
コード例 #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;
                }
            }
        }
コード例 #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;
            }
        }
コード例 #4
0
 public void Delete(School entity)
 {
     this.Repository.Delete(entity);
     this.Db.Save();
 }
コード例 #5
0
 public void Add(School entity)
 {
     this.Repository.Add(entity);
     this.Db.Save();
 }
コード例 #6
0
 public void Update(School entity)
 {
     this.Repository.Update(entity);
     this.Db.Save();
 }
コード例 #7
0
 public void Save(School entity)
 {
     if(entity.Id==0){
         this.Add(entity);
     }else{
         this.Db.Save();
     }
 }
コード例 #8
0
partial         void BeforeUpdateData(School e, ref ActionResult ar);
コード例 #9
0
partial         void BeforeShowEditView(School e);
コード例 #10
0
partial         void BeforeAddData(School e, ref ActionResult ar);
コード例 #11
0
partial         void AfterUpdateData(School e, ref ActionResult ar);
コード例 #12
0
partial         void AfterAddData(School e, ref ActionResult ar);
コード例 #13
0
partial         void AddRowToGridModel(LigerGridModel m, School e);