예제 #1
0
 public ActionResult Add(SmallInfoSource 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 FixupInfoSourceSmall(SmallInfoSource previousValue)
        {
            if (previousValue != null && previousValue.Students.Contains(this))
            {
                previousValue.Students.Remove(this);
            }

            if (InfoSourceSmall != null)
            {
                if (!InfoSourceSmall.Students.Contains(this))
                {
                    InfoSourceSmall.Students.Add(this);
                }
                if (SmallInfoSourceId != InfoSourceSmall.Id)
                {
                    SmallInfoSourceId = InfoSourceSmall.Id;
                }
            }
            else if (!_settingFK)
            {
                SmallInfoSourceId = null;
            }
        }
예제 #3
0
partial         void BeforeShowEditView(SmallInfoSource e);
예제 #4
0
partial         void BeforeUpdateData(SmallInfoSource e, ref ActionResult ar);
예제 #5
0
partial         void AfterUpdateData(SmallInfoSource e, ref ActionResult ar);
예제 #6
0
partial         void AddRowToGridModel(LigerGridModel m, SmallInfoSource e);
예제 #7
0
 public void Delete(SmallInfoSource entity)
 {
     this.Repository.Delete(entity);
     this.Db.Save();
 }
예제 #8
0
 public void Add(SmallInfoSource entity)
 {
     this.Repository.Add(entity);
     this.Db.Save();
 }
예제 #9
0
 public void Save(SmallInfoSource entity)
 {
     if(entity.Id==0){
         this.Add(entity);
     }else{
         this.Db.Save();
     }
 }