public ActionResult Create(TenantAdmin re) { HrSmartContext db = new HrSmartContext(); HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:22905/"); client.PostAsJsonAsync <TenantAdmin>("api/TenantAdmins", re); return(RedirectToAction("Index")); }
public ActionResult Create(RefferingEmployee re) { HrSmartContext db = new HrSmartContext(); HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:22905/"); client.PostAsJsonAsync <RefferingEmployee>("Api/RefferingEmployees", re); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { HrSmartContext db = new HrSmartContext(); RefferingEmployee refferingEmployee = db.Refferings.Find(id); db.Refferings.Remove(refferingEmployee); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role,RewardCredit")] RefferingEmployee refferingEmployee) { if (ModelState.IsValid) { HrSmartContext db = new HrSmartContext(); db.Entry(refferingEmployee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(refferingEmployee)); }
// GET: Reffering/Edit/5 // POST: Reffering/Edit/5 public ActionResult Edit(int?id) { HrSmartContext db = new HrSmartContext(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RefferingEmployee refferingEmployee = db.Refferings.Find(id); if (refferingEmployee == null) { return(HttpNotFound()); } return(View(refferingEmployee)); }
// GET: Recruters public ActionResult Index() { HrSmartContext db = new HrSmartContext(); List <Recruter> lst = new List <Recruter>(); HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:22905/"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage Response = client.GetAsync("api/Recruters").Result; if (Response.IsSuccessStatusCode) { lst = Response.Content.ReadAsAsync <List <Recruter> >().Result; } return(View(lst)); }
public DatabaseFactory() { dataContext = new HrSmartContext(); }