Exemple #1
0
        public void EqualToDepotObject(uint id, uint other, bool expectedResult)
        {
            Depot depot  = new Depot(id);
            Depot depot2 = new Depot(other);

            Assert.Equal(depot.Equals((object)depot2), expectedResult);
        }
Exemple #2
0
        private async Task GotoDepot()
        {
            if (Depot_status)
            {
                if (Depot.Equals("") || Round.Equals(""))
                {
                    Invalid_round = true;
                }
                else
                {
                    //I assumed current entered value is 999, 99.
                    if (Depot.Equals("999") && Round.Equals("99"))
                    {
                        Invalid_round = false;
                        //Detect Timeout
                        DateTime curDepotDate    = DateTime.Now.ToLocalTime();
                        string   curDepotDateStr = curLoginDate.ToString("yyyy-MM-dd HH:mm:ss");
                        DateTime x = curLoginDate;
                        double   difference_minute = (curDepotDate - x).TotalMinutes;

                        if (difference_minute >= 5)
                        {
                            Timeout = true;
                        }
                        else
                        {
                            Starting_round = true;
                            customerId     = Mvx.Resolve <ILocalStorage>().RetrieveSet("customer");

                            //post the device information message to the NX Framework, clear any consignment already stored in the local database
                            //
                            var deviceUrl = "http://nxfrontend-qa.nxframework.com/NXRest.svc/senddata?customer=" + customerId + "&session=" + login_session_id + "&metatype=17&filename=device.xml&notes=Sent&datetime=" + curDepotDateStr + "&priority=3";

                            string deviceInfo       = Mvx.Resolve <IChangeXMLBase64>().GetDeviceXMLToBase64();
                            var    deviceXMLContent = new StringContent(deviceInfo);

                            var senddataresult = new DataInfo();

                            senddataresult = await APIAccess.APIAccess.SendData(deviceUrl, deviceXMLContent);

                            if (senddataresult.SendDataResult.Result == 1)
                            {
                                var loginUrl = "http://nxfrontend-qa.nxframework.com/NXRest.svc/senddata?customer=" + customerId + "&session=" + login_session_id + "&metatype=17&filename=login.xml&notes=Sent&datetime=" + curDepotDateStr + "&priority=3";

                                string loginInfo       = Mvx.Resolve <IChangeXMLBase64>().GetLoginXMLToBase64();
                                var    loginXMLContent = new StringContent(loginInfo);

                                var sendloginresult = new DataInfo();

                                sendloginresult = await APIAccess.APIAccess.SendData(loginUrl, loginXMLContent);

                                if (sendloginresult.SendDataResult.Result == 1)
                                {
                                    this.ShowViewModel <ConsignmentSummaryViewModel>();
                                }
                                else
                                {
                                    // Sending Login.XML failure
                                }
                            }
                            else
                            {
                                // Sending Device.XML failure
                            }
                        }
                    }
                    else
                    {
                        Invalid_round = true;
                    }
                }
            }
        }
Exemple #3
0
        public void EqualToObject(uint id, object other, bool expectedResult)
        {
            Depot depot = new Depot(id);

            Assert.Equal(depot.Equals(other), expectedResult);
        }