Ejemplo n.º 1
0
        public async Task <IActionResult> AdminRegistration(AdminRegisterRequest registerRequest)
        {
            try
            {
                AdminResponseModel data = await _adminBusiness.AdminRegistration(registerRequest);

                bool   status = false;
                string message;
                string token;
                if (data == null)
                {
                    message = "No Data Provided";
                    return(Ok(new { status, message }));
                }
                else
                {
                    status  = true;
                    message = "Admin Account Created Successfully";
                    token   = GenerateToken(data, "Registration");
                    return(Ok(new { status, message, data, token }));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(new { e.Message }));
            }
        }
Ejemplo n.º 2
0
        public IActionResult Registration(Registratin registration)
        {
            var result = _adminBusiness.AdminRegistration(registration);

            if (result != null)
            {
                var success = true;
                var message = "Registration is successfully done";
                return(Ok(new { success, message, result }));
            }
            else
            {
                var success = false;
                var message = "Registration Failed";
                return(BadRequest(new { success, message }));
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Registration(AdminRegistrationRequest adminDetails)
        {
            try
            {
                var data = await _adminBusiness.AdminRegistration(adminDetails);

                if (data != null)
                {
                    success = true;
                    message = "Admin Account Created Successfully";
                    return(Ok(new { success, message, data }));
                }
                else
                {
                    message = "No Data Provided";
                    return(NotFound(new { success, message }));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { ex.Message }));
            }
        }