예제 #1
0
        public HttpResponseMessage VerifyCustomer(customerverificationmodel model)
        {
            GlobalVarible.Clear();
            try
            {
                DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE();

                // get customer information by id
                using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister())
                {
                    objBAL.Entity.dmt_customerid = model.dmt_customerid;
                    ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity);

                    var postdata = new
                    {
                        RemitterId     = customerRegister.dmt_requestno,
                        OTP            = model.verificationotp,
                        CustomerMobile = customerRegister.dmt_mobile
                    };

                    string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation");

                    OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response);

                    if (OV.code == 0)
                    {
                        objBAL.Entity.dmt_status = 1;
                        objBAL.UpdateStatus(objBAL.Entity);

                        GlobalVarible.AddMessage("Customer Verified Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(OV.message.ToString());
                    }
                }
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
예제 #2
0
        public JsonResult VerifyCustomer(customerverificationmodel model)
        {
            GlobalVarible.Clear();
            try
            {
                DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE();

                // get customer information by id
                using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister())
                {
                    objBAL.Entity.dmt_customerid = model.dmt_customerid;
                    ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity);

                    var postdata = new
                    {
                        RemitterId     = customerRegister.dmt_requestno,
                        OTP            = model.verificationotp,
                        CustomerMobile = customerRegister.dmt_mobile
                    };

                    string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation");

                    OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response);

                    if (OV.code == 0)
                    {
                        objBAL.Entity.dmt_status = 1;
                        objBAL.UpdateStatus(objBAL.Entity);

                        GlobalVarible.AddMessage("Customer Verified Successfully.");
                    }
                    else
                    {
                        GlobalVarible.AddError(OV.message.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }