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;
 }