public virtual ActionResult AddBidType(BidTypeEditModel bidType) { if (ModelState.IsValid) { var newtype = new BidType(); UpdateModel(newtype); Repository.Add(newtype); Repository.Save(); return RedirectToAction(MVC.AppSetting.BidTypeList()); } return View(bidType); }
private void FixupBidType(BidType previousValue) { if (previousValue != null && previousValue.Contracts.Contains(this)) { previousValue.Contracts.Remove(this); } if (BidType != null) { if (!BidType.Contracts.Contains(this)) { BidType.Contracts.Add(this); } if (BidTypeId != BidType.Id) { BidTypeId = BidType.Id; } } else if (!_settingFK) { BidTypeId = null; } }