コード例 #1
0
        public async Task <IActionResult> SendOTP(ExistingCustomer request)
        {
            dt = new DataTable();
            dc = new Dictionary <string, string>();
            dt = await acc.CheckExistingRegister("", request.LineUserId);

            string agreementNo = "";
            string PhoneNumber = "";

            PhoneNumber = request.PhoneNumber.Remove(0, 1);
            PhoneNumber = "66" + PhoneNumber;
            if (dt.Rows.Count == 0)
            {
                dc.Add("refCode", "");
                dc.Add("result", "ไม่พบบัญชีนี้ในระบบ");
                return(NotFound(dc));
            }
            agreementNo = dt.Rows[0]["Agreement No_"].ToString();
            dt          = new DataTable();
            dt          = management.REST_GenerateOTP(request.PhoneNumber, agreementNo, "UpdateMobile");
            string urlData = string.Format(state.SMSConfigs.UrlBase + "user={0}&pass={1}&type={2}&to={3}&from={4}&text={5}&servid={6}", state.SMSConfigs.User, state.SMSConfigs.Pass, state.SMSConfigs.Type, PhoneNumber, state.SMSConfigs.From, func.ToHexString(dt.Rows[0]["Message"].ToString()), state.SMSConfigs.ServID);

            acc.CallAPI(urlData);
            dc = new Dictionary <string, string>();
            dc.Add("refCode", dt.Rows[0]["OTP_Reference"].ToString());
            dc.Add("result", "Success");
            return(Ok(dc));
        }
コード例 #2
0
        public void AddTest()
        {
            CustomerBetter anotherCustomer  = new AnotherCustomer();
            CustomerBetter existingCustomer = new ExistingCustomer();

            Assert.ReferenceEquals(anotherCustomer, existingCustomer);
            Assert.IsInstanceOfType(anotherCustomer, typeof(CustomerBetter));
            Assert.IsInstanceOfType(existingCustomer, typeof(CustomerBetter));
        }
コード例 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="data"></param>
        private void existCustomerFormNavAction(object sender, object data)
        {
            if (sender == null || data == null)
            {
                throw new ApplicationException("Existing customer form navigation action handler received invalid data");
            }

            NavBox           existCustNavBox = (NavBox)sender;
            ExistingCustomer existCustForm   = (ExistingCustomer)data;

            NavBox.NavAction action = existCustNavBox.Action;
            if (action == NavBox.NavAction.BACKANDSUBMIT)
            {
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                action = NavBox.NavAction.SUBMIT;
            }

            switch (action)
            {
            case NavBox.NavAction.SUBMIT:
                if (existCustNavBox.IsCustom)
                {
                    string custDet = existCustNavBox.CustomDetail;
                    if (custDet.Equals("ManagePawnApplication"))
                    {
                        this.nextState = NewPawnLoanFlowState.ManagePawnApplication;
                    }
                    else if (custDet.Equals("ViewPawnCustomerInformation"))
                    {
                        this.nextState = NewPawnLoanFlowState.ViewCustomerInformation;
                    }
                }
                break;

            case NavBox.NavAction.BACK:
                this.nextState = NewPawnLoanFlowState.LookupCustomer;
                break;

            case NavBox.NavAction.CANCEL:
                this.nextState = NewPawnLoanFlowState.CancelFlow;
                break;
            }
            this.executeNextState();
        }
コード例 #4
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.WriteLine("For Existing Account, enter 1, for New Account, enter 2");
         string inputEntered = Console.ReadLine();
         if (inputEntered == "1")
         {
             ExistingCustomer.Operations();
             //AdminCreate.RetrieveAccounts();
             break;
         }
         else if (inputEntered == "2")
         {
             AdminCreate.Login();
             break;
         }
     }
 }