示例#1
0
        public async Task <IHttpActionResult> acceptConsumer(int userID)
        {
            try
            {
                user toAccept = db.users.Find(userID);
                toAccept.userActivationType = "Verified";
                await db.SaveChangesAsync();

                NotificationController notification = new NotificationController();
                string userNum = notification.getPhoneNumFromUserID(userID);
                notification.SendSMS(userNum, "Welcome to NanoFIn! Your application was accepted by our staff. Feel free to use NanoFin, if you are having trouble please email us at: [email protected] or contact us at 0110000000 - a trained professional will assist you.");
            }
            catch (NullReferenceException)
            {
                return(BadRequest("User to reject not found."));
            }
            return(Ok());
        }
示例#2
0
        public async Task <IHttpActionResult> rejectConsumer(int userID)
        {
            try
            {
                user toReject = db.users.Find(userID);
                toReject.userActivationType = "Rejected";
                await db.SaveChangesAsync();

                NotificationController notification = new NotificationController();
                string userNum = notification.getPhoneNumFromUserID(userID);
                notification.SendSMS(userNum, "Hello from NanoFin. We are sorry to inform you that your NanoFin application could not be processed. Please contact us at: [email protected] or visit us at: JoziHub - 44 Stanley Ave, Milpark, Johannesburg");
            }
            catch (NullReferenceException)
            {
                return(BadRequest("User to reject not found."));
            }
            return(Ok());
        }