Example #1
0
        public IHttpActionResult PutTenantAdmin(int id, TenantAdmin tenantAdmin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tenantAdmin.TenantAdminID)
            {
                return(BadRequest());
            }

            db.Entry(tenantAdmin).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TenantAdminExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            TenantAdmin tenantAdmin = db.TenantAdmis.Find(id);

            db.TenantAdmis.Remove(tenantAdmin);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
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"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "TenantAdminID,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone")] TenantAdmin tenantAdmin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tenantAdmin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tenantAdmin));
 }
Example #5
0
        public IHttpActionResult GetTenantAdmin(int id)
        {
            TenantAdmin tenantAdmin = db.TenantAdmis.Find(id);

            if (tenantAdmin == null)
            {
                return(NotFound());
            }

            return(Ok(tenantAdmin));
        }
Example #6
0
        public IHttpActionResult PostTenantAdmin(TenantAdmin tenantAdmin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TenantAdmis.Add(tenantAdmin);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tenantAdmin.TenantAdminID }, tenantAdmin));
        }
Example #7
0
        public IHttpActionResult DeleteTenantAdmin(int id)
        {
            TenantAdmin tenantAdmin = db.TenantAdmis.Find(id);

            if (tenantAdmin == null)
            {
                return(NotFound());
            }

            db.TenantAdmis.Remove(tenantAdmin);
            db.SaveChanges();

            return(Ok(tenantAdmin));
        }
Example #8
0
        // GET: TenantAdmins/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TenantAdmin tenantAdmin = db.TenantAdmis.Find(id);

            if (tenantAdmin == null)
            {
                return(HttpNotFound());
            }
            return(View(tenantAdmin));
        }
Example #9
0
 public void UpdateTenantAdmin(TenantAdmin t)
 {
     utOfWork.TenantAdminRepository.Update(t);
     utOfWork.Commit();
 }
Example #10
0
        /// <param name="Employeeid"></param>
        /// <returns></returns>


        ////////////   TenantAdmin    ///////////



        public void AddTenantAdmin(TenantAdmin t)
        {
            utOfWork.TenantAdminRepository.Add(t);
            utOfWork.Commit();
        }