Example #1
0
        public static dynamic sendOTP(householdMappingModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                SMSService.SMSService objSMS = new SMSService.SMSService();
                Random objRan   = new Random();
                string otp      = objRan.Next(111111, 999999).ToString();
                string message  = "GSWS OTP : " + otp + "\n OTP will Expire in 15 minutes";
                string response = objSMS.SendTeluguSMS(obj.mobileNum, message);
                if (response.Contains("402"))
                {
                    objdata.status = true;
                    objdata.result = otp;
                }
                else
                {
                    objdata.status = false;
                    objdata.result = "Failed to send OTP please try again !!!";
                }
            }
            catch (Exception ex)
            {
                objdata.status = 500;
                objdata.result = ex.Message.ToString();
                return(objdata);
            }
            return(objdata);
        }
Example #2
0
        public static dynamic Citizendetails(householdMappingModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                gswsModel objGsws = new gswsModel();
                objGsws.type = "8";
                objGsws.uid  = obj.uidNum;
                DataTable dt = routerModule.householdMappingProc(objGsws);
                if (dt != null && dt.Rows.Count > 0)
                {
                    objdata.status = true;
                    objdata.result = dt;
                }
                else
                {
                    objdata.status = false;
                    objdata.result = "No data found for citizen aadhaar number";
                    ;
                }
            }
            catch (Exception ex)
            {
                objdata.status = 500;
                objdata.result = ex.Message.ToString();
                return(objdata);
            }
            return(objdata);
        }
Example #3
0
        public IHttpActionResult sendOTP(dynamic data)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                string value = token_gen.Authorize_aesdecrpty(data);
                householdMappingModel rootobj = JsonConvert.DeserializeObject <householdMappingModel>(value);
                return(Ok(householdMappingHelper.sendOTP(rootobj)));
            }
            catch (Exception ex)
            {
                objdata.status = 500;
                objdata.result = "Session Expired !!! Please login again to continue...";
                return(Ok(objdata));
            }
        }