// POST: api/Admin public IHttpActionResult Post([FromBody] Admin admin) { int response = adminobj.AdminInsert(admin); if (response == 1) { return(Ok()); } else { return(NotFound()); } }
public IHttpActionResult Register(RegisterBindingModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Admin admin = new Admin() { Admin_id = model.Admin_id, Admin_username = model.Username, Admin_email = model.Email, Admin_type_id = model.Admin_type_id, Admin_pwd = model.Password, IsDeleted = false }; int response = _adminLog.AdminInsert(admin); //int inserData = binding.Save(); if (response == 1) { return(Ok("Record added to the database")); } else { return(BadRequest("Not able to save the record in database")); } }