コード例 #1
0
        public bool ValidateRegistrationNumber()
        {
            IsOnline = VerifyInternet();
            bool result = false;

            if (IsOnline)
            {
                if (App.Current.Properties.ContainsKey("apitoken"))
                {
                    CustomerVehicle obj_CustomerVehicle = new CustomerVehicle();
                    obj_CustomerVehicle.CustomerID              = CustomerID;
                    obj_CustomerVehicle.CustomerVehicleID       = CustomerVehicleID;
                    obj_CustomerVehicle.CustomerVehicleMapperID = CustomerVehicleMapperID;
                    obj_CustomerVehicle.RegistrationNumber      = txtRegNumber.Text.Trim();

                    var json    = JsonConvert.SerializeObject(obj_CustomerVehicle);
                    var content = new StringContent(json, Encoding.UTF8, "application/json");
                    OCustomerVehicle resultObj = dal_Vehicle.ValidateRegistrationNumber(Convert.ToString(App.Current.Properties["apitoken"]), obj_CustomerVehicle);

                    if (resultObj.CustomerVehicleID != 0)
                    {
                        result = false;
                    }
                    else
                    {
                        result = true;
                    }
                }
            }
            else
            {
                DisplayAlert("", "Please check your network connectivity", "Ok");
            }
            return(result);
        }
コード例 #2
0
        public bool ValidateRegistrationNumber()
        {
            bool result = false;

            if (App.Current.Properties.ContainsKey("apitoken"))
            {
                CustomerVehicle obj_CustomerVehicle = new CustomerVehicle();
                obj_CustomerVehicle.CustomerID              = CustomerID;
                obj_CustomerVehicle.CustomerVehicleID       = 0;
                obj_CustomerVehicle.CustomerVehicleMapperID = 0;
                obj_CustomerVehicle.RegistrationNumber      = txtRegNumber.Text.Trim();

                var json    = JsonConvert.SerializeObject(obj_CustomerVehicle);
                var content = new StringContent(json, Encoding.UTF8, "application/json");
                dal_Vehicle = new DALVehicle();
                OCustomerVehicle resultObj = dal_Vehicle.ValidateRegistrationNumber(Convert.ToString(App.Current.Properties["apitoken"]), obj_CustomerVehicle);

                if (resultObj.CustomerVehicleID != 0)
                {
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            return(result);
        }