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();
 }
Esempio n. 2
0
 private void detach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = null;
 }
Esempio n. 3
0
 private void attach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = this;
 }
Esempio n. 4
0
 private void detach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = null;
 }
Esempio n. 5
0
 private void attach_DivOrgs(DivOrg entity)
 {
     this.SendPropertyChanging();
     entity.Division = this;
 }