Ejemplo n.º 1
0
 public ActionResult Create(int organizationId)
 {
     OrganizationAddress organizationaddress = new OrganizationAddress();
     organizationaddress.OrganizationID = organizationId;
     ViewBag.PossibleOrganizationAddressCategories = organizationaddresscategoryRepository.All;
     ViewBag.PossibleCountries = countryRepository.All;
     return View(organizationaddress);
 }
Ejemplo n.º 2
0
 public ActionResult Create(OrganizationAddress organizationaddress,int organizationId)
 {
     if (ModelState.IsValid) {
         organizationaddressRepository.InsertOrUpdate(organizationaddress);
         organizationaddressRepository.Save();
         return RedirectToAction("Index",new { organizationId=organizationId });
     } else {
         ViewBag.PossibleOrganizationAddressCategories = organizationaddresscategoryRepository.All;
         ViewBag.PossibleCountries = countryRepository.All;
         return View(organizationaddress);
     }
 }
Ejemplo n.º 3
0
 public void InsertOrUpdate(OrganizationAddress organizationaddress)
 {
     if (organizationaddress.OrganizationAddressID == default(int)) {
         // New entity
         context.OrganizationAddress.Add(organizationaddress);
     } else {
         // Existing entity
         context.Entry(organizationaddress).State = EntityState.Modified;
     }
 }
Ejemplo n.º 4
0
 public ViewResult Search(OrganizationAddress searchOrganizationAddress,int organizationId)
 {
     if(searchOrganizationAddress!=null)
     {
                     }
                 return View("Index",organizationaddressRepository.AllIncluding(organizationId,organizationaddress => organizationaddress.Organization, organizationaddress => organizationaddress.OrganizationAddressCategory, organizationaddress => organizationaddress.Country, organizationaddress => organizationaddress.State));
 }
Ejemplo n.º 5
0
 public ActionResult Edit(OrganizationAddress organizationaddress,int organizationId)
 {
     if (ModelState.IsValid) {
         organizationaddressRepository.InsertOrUpdate(organizationaddress);
         organizationaddressRepository.Save();
         return RedirectToAction("Index",new { organizationId=organizationId });
     } else {
                 ViewBag.PossibleOrganizationAddressCategories = organizationaddresscategoryRepository.All;
                 ViewBag.PossibleCountries = countryRepository.All;
                 if (organizationaddress.CountryID.HasValue)
     {
         ViewBag.PossibleStates = stateRepository.FindAllByCountryID(organizationaddress.CountryID.Value);
     }
                     return View(organizationaddress);
     }
 }