public HttpResponseMessage insertAddres(AddresBO address) { address.CustomerID = (int)HttpContext.Current.Session["CustomerID"]; int addrs = iaddres.AddAddres(address); var session = HttpContext.Current.Session; if (session != null) { HttpContext.Current.Session["AddresID"] = addrs; } return(Request.CreateResponse(HttpStatusCode.OK, "saved successfully")); }
public int AddAddres(AddresBO address) { try { Addre addr = new Addre(); addr.AddressType = address.AddressType; addr.Addres = address.Address; addr.City = address.City; addr.States = address.State; addr.Country = address.Country; addr.pincode = address.pincode; addr.CustomerID = address.CustomerID; _db.Addres.Add(addr); _db.SaveChanges(); return(addr.AddresID); } catch (Exception ex) { throw ex; } }
public ActionResult Datastore() { AddresBO address = new AddresBO(); return(View("Address", address)); }