Esempio n. 1
0
 //private string Host = Constant.WebService.Production.Host;
 //private string getSms = Constant.WebService.Production.Api.User.getSms;
 //private m_profile _profile;
 public ListSms(profile_data profile)
 {
     InitializeComponent();
     this.Title = profile.CUST_NAME;
     //_profile = profile;
     if (profile != null)
     {
         var items = Services.User.getSms(profile.CUST_NO);
         if (items.code == 200)
         {
             DependencyService.Get <IMessage>().longAlert("ดึงข้อมูลสำเร็จ");
             if (items.data.Count != 0)
             {
                 listSms.ItemsSource = items.data;
             }
         }
         else
         {
             DependencyService.Get <IMessage>().longAlert(items.message);
         }
     }
     else
     {
         DependencyService.Get <IMessage>().longAlert("ไม่พบข้อมูลของคุณในระบบ SMS");
     }
 }
Esempio n. 2
0
 public ExitPage(profile_data Profile, string device_id, string serialSim, string version)
 {
     InitializeComponent();
     _profile   = Profile;
     _device_id = device_id;
     _serialSim = serialSim;
     _version   = version;
 }
Esempio n. 3
0
 public PaymentView(string url, profile_data profile, string deviceId, string serialSim, string version)
 {
     InitializeComponent();
     Title           = "หน้าชำระเงิน";
     _profile        = profile;
     _deviceId       = deviceId;
     _serialSim      = serialSim;
     _version        = version;
     bankView.Source = url;
 }
Esempio n. 4
0
 public LoanPage(profile_data profile, string deviceId, string serialSim, string version)
 {
     InitializeComponent();
     this.Title = profile.CUST_NAME;
     _profile   = profile;
     _deviceId  = deviceId;
     _serialSim = serialSim;
     _version   = version;
     //var loan = User.getContract(profile.CUST_NO);
     //if(loan.code == 200)
     //{
     //    //listContract.ItemsSource = null;
     //    listContract.ItemsSource = loan.data;
     //}
 }
Esempio n. 5
0
 public Payment(profile_data profile, contract_data contract, string deviceId, string serialSim, string version)
 {
     InitializeComponent();
     //BindingContext = contract;
     _contract        = contract;
     _profile         = profile;
     _deviceId        = deviceId;
     _serialSim       = serialSim;
     _version         = version;
     Title            = "สัญญา " + contract.con_no;
     txtBanlance.Text = String.Format("{0:#,##0}", contract.bal_amt);  //contract.bal_amt.ToString();
     txtPay.Text      = String.Format("{0:#,##0}", contract.pay_amt);  //contract.pay_amt.ToString();
     txtDiscount.Text = String.Format("{0:#,##0}", contract.disc_amt); //contract.disc_amt.ToString();
     _banks           = Payments.getBanks();
     //img0.Source = _banks.data[0].channel_img;
     btnBank0.Source = _banks.data[0].channel_img;
     btnBank1.Source = _banks.data[1].channel_img;
     btnBank2.Source = _banks.data[2].channel_img;
     btnBank3.Source = _banks.data[3].channel_img;
     btnBank4.Source = _banks.data[4].channel_img;
     btnBank5.Source = _banks.data[5].channel_img;
 }
Esempio n. 6
0
        //private string Host = Constant.WebService.Production.Host;
        //private string Identify = Constant.WebService.Production.Api.User.identify;
        public Mainpage(profile_data profile, string deviceId, string serialSim, string version)
        {
            InitializeComponent();

            //var connection = new HubConnection("http://dba2df14.ngrok.io/signalr");
            //var notifyHub = connection.CreateHubProxy("NotificationHub");
            //connection.Start();

            //notifyHub.On("connect", async (string message) =>
            //{
            //    Debug.WriteLine(message);
            //    Debug.WriteLine(message);
            //    Debug.WriteLine(message);
            //    Debug.WriteLine(message);
            //    Debug.WriteLine(message);
            //    Debug.WriteLine(message);
            //    await notifyHub.Invoke("registerContext", deviceId);
            //});
            //notifyHub.On("notify", (string message) =>
            //{
            //    Debug.WriteLine($"pipe => New notification is {message}");
            //});
            //connection.Closed += () =>
            //{
            //    Debug.WriteLine("pipe => Connection closed......");
            //    //await Task.Delay(new Random().Next(0, 5) * 1000);
            //    //await connection.Start();
            //};
            //connection.Reconnected += () =>
            //{
            //    Debug.WriteLine("pipe => Connection reconnected.......");
            //};
            //connection.Reconnecting += () => {
            //    Debug.WriteLine("pipe => Connection reconnecting.......");
            //};

            this.Title = string.Empty;
            var navigationPage = new NavigationPage(new ChatSms(profile, version));

            //this.BarTextColor = Color.Teal;
            navigationPage.Title = "ข้อความ";
            navigationPage.BarBackgroundColor = Color.White;
            navigationPage.BarTextColor       = Color.Teal;
            //navigationPage.Icon = "message.png";
            Children.Add(navigationPage);
            navigationPage       = new NavigationPage(new LoanPage(profile, deviceId, serialSim, version));
            navigationPage.Title = "สัญญา";
            //navigationPage.Icon = "assignment.png";
            navigationPage.BarBackgroundColor = Color.White;
            navigationPage.BarTextColor       = Color.Teal;
            Children.Add(navigationPage);
            if (Device.RuntimePlatform == Device.iOS)
            {
                navigationPage       = new NavigationPage(new ExitPage(profile, deviceId, serialSim, version));
                navigationPage.Title = "Logout";
                // navigationPage.Icon = "exit2.png";
                navigationPage.BarBackgroundColor = Color.White;
                navigationPage.BarTextColor       = Color.Teal;
                Children.Add(navigationPage);
            }
        }
Esempio n. 7
0
        //private int count = 0;
        //private double _notiWidth;

        public ChatSms(profile_data profile, string version)
        {
            InitializeComponent();
            _cust_name  = profile.CUST_NAME;
            Title       = profile.CUST_NAME;
            app_version = profile.APP_VERSION;

            current_version = double.Parse(version);
            //getListColor();
            //notiBox.BackgroundColor = colors[count].Color;
            //notiTxt.Text = colors[count].Name;
            if (profile.BROADCAST != null)
            {
                notiBox.IsVisible         = true;
                notiFrame.BackgroundColor = Color.GhostWhite;
                notiTxt.Text = profile.BROADCAST.NOTE;
            }

            //if (2.8 > current_version)
            //{
            //    var toolBarItem = new ToolbarItem("update", "update.png", () =>
            //    {
            //        Device.OpenUri(new Uri("https://play.google.com/store/apps/details?id=com.Domestic.DmobileApp"));
            //    }, 0, 0);

            //    ToolbarItems.Add(toolBarItem);
            //}

            if (app_version > current_version)
            {
                var toolBarItem = new ToolbarItem();
                toolBarItem.Text     = "กดอัพเดท\nเวอร์ชั่นใหม่";
                toolBarItem.Clicked += (sender, e) => {
                    //if (count != 0)
                    //{
                    //    count--;
                    //    notiBox.BackgroundColor = colors[count].Color;
                    //    notiTxt.Text = colors[count].Name;
                    //}
                    if (Device.RuntimePlatform == Device.Android)
                    {
                        Device.OpenUri(new Uri("https://play.google.com/store/apps/details?id=com.Domestic.DmobileApp"));
                    }
                    else if (Device.RuntimePlatform == Device.iOS)
                    {
                        Device.OpenUri(new Uri("https://itunes.apple.com/us/app/d-mobileapp/id1457641979?ls=1&mt=8"));
                    }
                };
                ToolbarItems.Add(toolBarItem);
                //toolBarItem = new ToolbarItem("กดอัพเดท", "update.png", () =>
                //{
                //    Device.OpenUri(new Uri("https://play.google.com/store/apps/details?id=com.Domestic.DmobileApp"));
                //},0,0);
                //ToolbarItems.Add(toolBarItem);
            }
            else
            {
                if (Device.RuntimePlatform == Device.Android)
                {
                    ToolbarItems.Add(new ToolbarItem()
                    {
                        Text = "เวอร์ชั่น\n" + version
                    });
                }
                else if (Device.RuntimePlatform == Device.iOS)
                {
                    ToolbarItems.Add(new ToolbarItem()
                    {
                        Text = "เวอร์ชั่น" + version
                    });
                }
            }

            _cust_no = profile.CUST_NO;
            if (profile.CHAT == "ON")
            {
                chatBox.IsVisible = true;
            }
            //BindingContext = new MainPageViewModel(profile.CUST_NO);

            //var last = MessagesListView.ItemsSource.Cast<MessageViewModel>().LastOrDefault();
            //MessagesListView.ScrollTo(last, ScrollToPosition.End, true);
        }