Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            HrSmartContext    db = new HrSmartContext();
            RefferingEmployee refferingEmployee = db.Refferings.Find(id);

            db.Refferings.Remove(refferingEmployee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
 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));
 }
Esempio n. 5
0
        // 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));
        }
Esempio n. 6
0
        // 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));
        }
Esempio n. 7
0
 public DatabaseFactory()
 {
     dataContext = new HrSmartContext();
 }