Пример #1
0
 public ActionResult AddRemoveDiv(int id, int divid, bool ischecked)
 {
     var d = DbUtil.Db.DivOrgs.SingleOrDefault(dd => dd.DivId == divid && dd.OrgId == id);
     if (ischecked && d == null)
     {
         d = new DivOrg { OrgId = id, DivId = divid };
         DbUtil.Db.DivOrgs.InsertOnSubmit(d);
         DbUtil.Db.SubmitChanges();
     }
     if (!ischecked && d != null)
     {
         DbUtil.Db.DivOrgs.DeleteOnSubmit(d);
         DbUtil.Db.SubmitChanges();
     }
     return new EmptyResult();
 }
Пример #2
0
 private void detach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = null;
 }
Пример #3
0
 private void attach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = this;
 }
Пример #4
0
 private void detach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = null;
 }
Пример #5
0
 private void attach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = this;
 }