Пример #1
0
        public void Place()
        {//searching for book
            Thread.Sleep(1000);
            Thread.Sleep(5000);
            SearchTab.SendKeys("Scion of Ikshvaku");
            Search.Click();
            Thread.Sleep(5000);
            //buying the book
            Book.Click();
            Thread.Sleep(5000);
            driver.SwitchTo().Frame(frame);
            Thread.Sleep(5000);
            // Switching to innerframe
            Placeorder.Click();
            Thread.Sleep(50000);

            Paynow.Click();
            Thread.Sleep(1000);
            IPlaceTheOrder placeOrder;

            placeOrder = new AddressDetails(driver);  //address details
            placeOrder.Processing();
            placeOrder = new SavaAndContinue(driver); //*/..
            placeOrder.Processing();
        }
Пример #2
0
        protected void loadAddrAndCurrDetails()
        {
            AddressDetails addrObj = BackEndObjects.AddressDetails.
                                     getAddressforMainBusinessEntitybyIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            Label_Addr1.Text = addrObj.getAddrLine1();
            loadLocalityDetails(addrObj.getLocalityId());

            Dictionary <String, Currency> currDict = BackEndObjects.Currency.getAllCurrencyDetailsDB();

            foreach (KeyValuePair <String, Currency> kvp in currDict)
            {
                ListItem lt = new ListItem();
                lt.Text  = ((Currency)kvp.Value).getCurrencyName();
                lt.Value = ((Currency)kvp.Value).getCurrencyId();

                DropDownList_Base_Curr.Items.Add(lt);

                if (addrObj.getBaseCurrencyId() != null && !addrObj.getBaseCurrencyId().Equals("") &&
                    addrObj.getBaseCurrencyId().Equals(((Currency)kvp.Value).getCurrencyId()))
                {
                    DropDownList_Base_Curr.SelectedValue = lt.Value;
                }
            }
        }
Пример #3
0
        public string SaveAddressDetails(AddressDetails addressDetails)
        {
            string AddressDetailsId = new Guid().ToString();
            string connectionString = System.Configuration.ConfigurationManager.
                                      ConnectionStrings["DBConnectionString"].ConnectionString;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                string     query      = "insert into AddressDetails(AddressDetailsId,StudentId,FullAddress,PhoneNumberOffice,PhoneNumberResidence,EmailId,status) values(@AddressDetailsId,@StudentId,@FullAddress,@PhoneNumberOffice,@PhoneNumberResidence,@EmailId,@status)";
                SqlCommand sqlCommand = new SqlCommand(query, connection);
                sqlCommand.Parameters.Add("@AddressDetailsId", System.Data.SqlDbType.NVarChar).Value    = addressDetails.AddressDetailsId;
                sqlCommand.Parameters.Add("@FullAddress", System.Data.SqlDbType.NVarChar).Value         = addressDetails.FullAddress;
                sqlCommand.Parameters.Add("@PhoneNumberOffice", System.Data.SqlDbType.VarChar).Value    = addressDetails.PhoneNumberOffice;
                sqlCommand.Parameters.Add("@PhoneNumberResidence", System.Data.SqlDbType.VarChar).Value = addressDetails.PhoneNumberResidence;
                sqlCommand.Parameters.Add("@EmailId", System.Data.SqlDbType.VarChar).Value = addressDetails.EmailId;
                if (string.IsNullOrEmpty(addressDetails.StudentId))
                {
                    sqlCommand.Parameters.AddWithValue("@StudentId", DBNull.Value);
                }
                else
                {
                    sqlCommand.Parameters.Add("@StudentId", System.Data.SqlDbType.NVarChar).Value = addressDetails.StudentId;
                }
                sqlCommand.Parameters.Add("@status", System.Data.SqlDbType.Bit).Value = true;
                connection.Open();
                sqlCommand.ExecuteNonQuery();
            }
            return(AddressDetailsId);
        }
Пример #4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ClientDetails clientModel = new ClientDetails();
            //Client Details
            int i = ClientDGView.SelectedCells[0].RowIndex;

            clientModel.ClientId = (int)ClientDGView.CurrentRow.Cells[0].Value;
            clientModel.Name     = ClientDGView.Rows[i].Cells[1].Value.ToString();


            ContactDetails contactDetails = new ContactDetails();

            //Client Contact
            contactDetails.CellNumber = ClientDGView.Rows[i].Cells[7].Value.ToString();
            contactDetails.WorkTel    = ClientDGView.Rows[i].Cells[8].Value.ToString();

            //Client Address
            AddressDetails clientAddress = new AddressDetails();

            clientAddress.WorkAddress = ClientDGView.Rows[i].Cells[5].Value.ToString();
            clientAddress.ResAddress  = ClientDGView.Rows[i].Cells[4].Value.ToString();
            clientAddress.PosAddress  = ClientDGView.Rows[i].Cells[6].Value.ToString();

            clientServiceClient.UpdateClient(clientModel.ClientId, clientModel, clientAddress, contactDetails);

            MessageBox.Show("Client Updated Succesfully", "Update Status", MessageBoxButtons.OK);

            HomeForm home = new HomeForm();

            Hide();
            home.Show();
        }
Пример #5
0
        private Entity CreateAddress(AddressDetails address, Entity postCode, Entity country)
        {
            Entity city   = null;
            Entity county = null;

            if (address.City != null || address.City != "")
            {
                city = FindOrCreateCity(country.ToEntityReference(), address.City);
            }

            if (address.County != null || address.County != "")
            {
                county = FindOrCreateCounty(country.ToEntityReference(), address.County);
            }

            var addrEntity = new Entity("new_address");

            addrEntity["new_addressname"]       = address.BuildingDetails;
            addrEntity["new_addressnumbertext"] = address.Number;

            addrEntity["new_county"]  = county.ToEntityReference();
            addrEntity["new_country"] = country.ToEntityReference();
            addrEntity["new_city"]    = city.ToEntityReference();

            addrEntity["new_street1"] = address.street1;
            addrEntity["new_street2"] = address.street2;
            addrEntity["new_street3"] = address.street3;

            addrEntity["new_addressorigin"] = AddressOrigin.Manual.ToOptionSet();
            addrEntity["new_postalcode"]    = postCode.ToEntityReference();

            var createdAddress = svc.Create(addrEntity);

            return(svc.Retrieve("new_address", createdAddress, new ColumnSet(true)));
        }
 /// <summary>
 /// Initializes a new instance of the CreateCheckoutSessionRequest class.
 /// </summary>
 /// <param name="checkoutReviewReturnUrl">Checkout review URL provided by the merchant. Amazon Pay will redirect to this URL after the buyer selects their preferred payment instrument and shipping address.</param>
 /// <param name="storeId">Store ID as defined in Seller Central.</param>
 public CreateCheckoutSessionRequest(string checkoutReviewReturnUrl, string storeId) : base()
 {
     WebCheckoutDetails.CheckoutReviewReturnUrl = checkoutReviewReturnUrl;
     StoreId = storeId;
     DeliverySpecifications = new DeliverySpecifications();
     AddressDetails         = new AddressDetails();
 }
Пример #7
0
        public ActionResult SaveAddressDetails(FormCollection formCollection)
        {
            AddressDetails addressDetails = new AddressDetails();

            if (!string.IsNullOrEmpty(formCollection["AddressDetails.FullAddress"]))
            {
                addressDetails.FullAddress = formCollection["AddressDetails.FullAddress"].ToString();
            }
            if (!string.IsNullOrEmpty(formCollection["AddressDetails.PhoneNumberOffice"]))
            {
                addressDetails.PhoneNumberOffice = formCollection["AddressDetails.PhoneNumberOffice"].ToString();
            }
            if (!string.IsNullOrEmpty(formCollection["AddressDetails.PhoneNumberResidence"]))
            {
                addressDetails.PhoneNumberResidence = formCollection["AddressDetails.PhoneNumberResidence"].ToString();
            }
            if (!string.IsNullOrEmpty(formCollection["AddressDetails.EmailId"]))
            {
                addressDetails.EmailId = formCollection["AddressDetails.EmailId"].ToString();
            }
            StudentDetailsDal studentDetailsDal = new StudentDetailsDal();

            addressDetails.AddressDetailsId = studentDetailsDal.SaveAddressDetails(addressDetails);
            return(View());
        }
Пример #8
0
 private void lstvAddress_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (ListViewItem li in lstvAddress.SelectedItems)
     {
         secili = li.Tag as AddressDetails;
     }
 }
Пример #9
0
        public async Task <bool> UpdateRepository(AddressDetails addressToEdit)
        {
            this.addressesRepository.Update(addressToEdit);
            var result = await this.addressesRepository.SaveChangesAsync();

            return(result > 0);
        }
Пример #10
0
        public ActionResult EditAddress(AddressDetails model)
        {
            if (ModelState.IsValid)
            {
                if (string.IsNullOrEmpty(model.PostalCity))
                {
                    model.PostalCity = model.City;
                }

                _IAddressesRepository.EditAddress(new Address
                {
                    id               = model.AddressID,
                    city             = model.City,
                    house_number     = model.HouseNumber,
                    apartment_number = model.ApartmentNumber,
                    street           = model.Street,
                    postal_city      = model.PostalCity,
                    postal_code      = model.PostalCode
                });
                TempData["Success"] = "Pomyślnie edytowano adres.";
            }
            else
            {
                TempData["Warning"] = "Wystąpił błąd. Spróbuj jeszcze raz.";
            }

            return(RedirectToAction("Index"));
        }
Пример #11
0
        public int UpdateClient(int clientId, ClientDetails clientDetails, AddressDetails addressDetails, ContactDetails contactDetails)
        {
            dbConn.openConnection();
            string sqlClientUpdate = "UPDATE ClientDetails "
                                     + "SET name = '" + clientDetails.Name + "'"
                                     + " WHERE clientId = " + clientId;
            SqlCommand cmdUpdateClient = new SqlCommand(sqlClientUpdate, dbConn.connection);

            cmdUpdateClient.ExecuteNonQuery();

            string sqlAddressUpdate = "UPDATE ClientAddress "
                                      + "SET resAddress = '" + addressDetails.ResAddress + "'"
                                      + ", posAddress = '" + addressDetails.PosAddress + "'"
                                      + ", workAddress = '" + addressDetails.WorkAddress + "'"
                                      + "WHERE clientId = " + clientId;
            SqlCommand cmdUpdateAddress = new SqlCommand(sqlAddressUpdate, dbConn.connection);

            cmdUpdateAddress.ExecuteNonQuery();


            string sqlContactUpdate = "UPDATE ClientContact "
                                      + "SET cellNumber = '" + contactDetails.CellNumber + "'"
                                      + ", workTel = '" + contactDetails.WorkTel + "'"
                                      + "WHERE clientId = " + clientId;

            SqlCommand cmdUpdateContact = new SqlCommand(sqlContactUpdate, dbConn.connection);
            int        res = cmdUpdateContact.ExecuteNonQuery();


            return(res);
        }
 internal OrderItemResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, OrderItemDetails orderItemDetails, AddressDetails addressDetails, DateTimeOffset?startOn, string orderId) : base(id, name, resourceType, systemData, tags, location)
 {
     OrderItemDetails = orderItemDetails;
     AddressDetails   = addressDetails;
     StartOn          = startOn;
     OrderId          = orderId;
 }
Пример #13
0
        /// <summary>
        /// Creates the purchase event.
        /// </summary>
        private Purchase SetupPurchase(CheckoutDetailsViewModel checkoutDetails, BasketViewModel basketViewModel)
        {
            var shippingAddress = new AddressDetails
            {
                FirstName   = checkoutDetails.User.FirstName,
                LastName    = checkoutDetails.User.LastName,
                PhoneNumber = checkoutDetails.User.Phone,
                Street1     = checkoutDetails.ShippingAddress.Address1,
                Street2     = checkoutDetails.ShippingAddress.Address2,
                City        = checkoutDetails.ShippingAddress.City,
                State       = checkoutDetails.ShippingAddress.State,
                ZipCode     = checkoutDetails.ShippingAddress.ZipCode,
                Country     = checkoutDetails.ShippingAddress.CountryRegion
            };

            var billingAddress = new AddressDetails
            {
                FirstName   = checkoutDetails.User.FirstName,
                LastName    = checkoutDetails.User.LastName,
                PhoneNumber = checkoutDetails.User.Phone,
                Street1     = checkoutDetails.BillingAddress.Address1,
                Street2     = checkoutDetails.BillingAddress.Address2,
                City        = checkoutDetails.BillingAddress.City,
                State       = checkoutDetails.BillingAddress.State,
                ZipCode     = checkoutDetails.BillingAddress.ZipCode,
                Country     = checkoutDetails.BillingAddress.CountryRegion
            };

            var device = new DeviceContext
            {
                DeviceContextId  = _contextAccessor.GetSessionId(),
                ExternalDeviceId = Guid.NewGuid().ToString(),
                IPAddress        = _contextAccessor.HttpContext.Connection.RemoteIpAddress.ToString(),
                Provider         = DeviceContextProvider.DFPFingerPrinting.ToString()
            };
Пример #14
0
        public void CorrectCustomerAddress(AddressDetails addressDetails)
        {
            if (string.IsNullOrWhiteSpace(addressDetails.Postcode))
                throw new UnknownPostcodeException();

            logger.Info("corrected!");
        }
Пример #15
0
        public ActionResult ContactDetails(ContactDetails data, string prevBtn, string nextBtn)
        {
            Customer obj = GetCustomer();

            if (prevBtn != null)
            {
                AddressDetails ad = new AddressDetails();
                ad.Address    = obj.Address;
                ad.City       = obj.City;
                ad.Country    = obj.Country;
                ad.PostalCode = obj.PostalCode;
                return(View("AddressDetails", ad));
            }
            if (nextBtn != null)
            {
                if (ModelState.IsValid)
                {
                    obj.ContactName = data.ContactName;
                    obj.Phone       = data.Phone;
                    obj.Fax         = data.Fax;
                    NorthwindEntities db = new NorthwindEntities();
                    db.Customers.Add(obj);
                    db.SaveChanges();
                    RemoveCustomer();
                    return(View("Success"));
                }
            }
            return(View("ContactDetails"));
        }
Пример #16
0
        public void Handle(OrderCreated @event)
        {
            using (var context = _contextFactory.Invoke())
            {
                var identicalAddresses = from a in context.Query <AddressDetails>()
                                         where a.AccountId == @event.AccountId
                                         where (a.Apartment ?? string.Empty) == (@event.PickupAddress.Apartment ?? string.Empty)
                                         where a.FullAddress == @event.PickupAddress.FullAddress
                                         where (a.RingCode ?? string.Empty) == (@event.PickupAddress.RingCode ?? string.Empty)
// ReSharper disable once CompareOfFloatsByEqualityOperator
                                         where a.Latitude == @event.PickupAddress.Latitude
// ReSharper disable once CompareOfFloatsByEqualityOperator
                                         where a.Longitude == @event.PickupAddress.Longitude
                                         select a;

                if (!identicalAddresses.Any())
                {
                    var address = new AddressDetails();
                    Mapper.Map(@event.PickupAddress, address);
                    address.Id         = Guid.NewGuid();
                    address.AccountId  = @event.AccountId;
                    address.IsHistoric = true;
                    context.Save(address);
                }
            }
        }
Пример #17
0
    public PersonAddressDetails[] filter(AddressDetails addressDetails)
    {
        PersonAddressDetails[] personAddress=DaycareAccess.GetInstancesOfTypeWithinDistance(addressDetails, 5, 2);

        /*foreach (DataRow dataRow in dataTable.Rows)
        {
            string name = dataRow.ToString();
        }*/

        /*AddressDetails[] addresses = new AddressDetails[2];

        addresses[0] = new AddressDetails();
        addresses[0].City = "Ottawa";
        addresses[0].State = "ON";
        addresses[0].Country = "Canada";
        addresses[0].AddressL1 = "360 Croydon";
        addresses[0].PostalCode = "K2B 8A4";

        addresses[1] = new AddressDetails();
        addresses[1].City = "Ottawa";
        addresses[1].State = "ON";
        addresses[1].Country = "Canada";
        addresses[1].AddressL1 = "800 king Edward";
        addresses[1].PostalCode = "K1N 6N5";*/

        return personAddress;
    }
Пример #18
0
        public bool AddContact(AddressDetails addressDetails)
        {
            try
            {
                var filter = Builders <AddressDetails> .Filter.Eq(a => a.FirstName, addressDetails.FirstName) &
                             Builders <AddressDetails> .Filter.Eq(a => a.LastName, addressDetails.LastName);

                var result = _addressCollection.Find(filter);

                if (result.CountDocuments() > 0)
                {
                    throw new Exception("Contact already exists");
                }


                _addressCollection
                .InsertOne(addressDetails);

                return(true);
            }
            catch (DbException ex)
            {
                throw;
            }
        }
Пример #19
0
        public HttpResponseMessage insertAddressDetails(AddressDetails addressData)
        {
            var data = _infoHandleManafer.insertAddressDetails(addressData);
            HttpResponseMessage response = Request.CreateResponse <object>(HttpStatusCode.OK, data);

            return(response);
        }
        public int UpdateClient(ClientDetails clientDetails, AddressDetails addressDetails, ContactDetails contactDetails)
        {
            string message;

            dbConn.openConnection();

            SqlCommand cmd = new SqlCommand("nsp_updateClient @clientId,@name,@gender" +
                                            ",@cellNumber,@workTel,@resAddress,@workAddress,@posAddress", dbConn.connection);


            cmd.Parameters.Add("@clientId", SqlDbType.Int, 100).Value = clientDetails.ClientId;
            //Insert Client Details
            cmd.Parameters.Add("@name", SqlDbType.VarChar, 100).Value   = clientDetails.Name;
            cmd.Parameters.Add("@gender", SqlDbType.VarChar, 100).Value = clientDetails.Gender;

            //Insert Client Contact
            cmd.Parameters.Add("@cellNumber", SqlDbType.VarChar, 100).Value = contactDetails.CellNumber;
            cmd.Parameters.Add("@workTel", SqlDbType.VarChar, 100).Value    = contactDetails.WorkTel;

            //Insert Client Address
            cmd.Parameters.Add("@resAddress", SqlDbType.VarChar, 100).Value  = addressDetails.ResAddress;
            cmd.Parameters.Add("@workAddress", SqlDbType.VarChar, 100).Value = addressDetails.WorkAddress;
            cmd.Parameters.Add("@posAddress", SqlDbType.VarChar, 100).Value  = addressDetails.PosAddress;

            int res = cmd.ExecuteNonQuery();

            message = clientDetails.Name + " Updated Succesfully";

            return(res);
        }
        public static void GetshippingAddressFromOrderItem(OrderItem orderItem, AddressDetails shippingAddress)
        {
            foreach (var field in orderItem.CustomFormFillFields)
            {
                if (field.Name == "Del_Company_Name")
                {
                    shippingAddress.CompanyName = field.Value;
                }

                if (field.Name == "Del_First_Name")
                {
                    shippingAddress.FirstName = field.Value;
                }

                if (field.Name == "Del_Last_Name")
                {
                    shippingAddress.LastName = field.Value;
                }

                if (field.Name == "Del_Address_1")
                {
                    shippingAddress.Line1 = field.Value;
                }

                if (field.Name == "Del_Address_2")
                {
                    shippingAddress.Line2 = field.Value;
                }

                if (field.Name == "Del_City")
                {
                    shippingAddress.City = field.Value;
                }

                if (field.Name == "Del_County")
                {
                    shippingAddress.County = field.Value;
                }

                if (field.Name == "Del_Postcode")
                {
                    shippingAddress.PostCode = field.Value;
                }

                if (field.Name == "TelNo")
                {
                    shippingAddress.Telephone = field.Value;
                }

                if (field.Name == "MobNo")
                {
                    shippingAddress.Mobile = field.Value;
                }

                if (field.Name == "Email")
                {
                    shippingAddress.Email = field.Value;
                }
            }
        }
Пример #22
0
        public int PlaceOrder(int cartID, int userID)
        {
            Console.WriteLine("Start Place Order Details");
            int      orderID  = -1;
            IWallet  wallet   = new Wallet();
            ITax     tax      = new Tax();
            ICart    userCart = new ShoppingCartDetails();
            IAddress address  = new AddressDetails();
            IOrder   order    = new Order();
            //Step 1: Get Tax Percentage by State
            double stateTax = tax.GetTaxByState("ABC");

            //Step 2: Apply Tax on Cart Items
            tax.ApplyTax(cartID, stateTax);
            //Step 3: Get User Wallet Balance
            double userWalletBalance = wallet.GetUserBalance(userID);
            //Step 4: Get Cart Items Price
            double cartPrice = userCart.GetCartPrice(cartID);

            //Step 5: Compare the balance and price
            if (userWalletBalance > cartPrice)
            {
                //Step 6: Get User Address and set to Cart
                Address userAddress = address.GetAddressDetails(userID);
                //Step 7: Place the order
                orderID = order.PlaceOrderDetails(cartID, userAddress.AddressID);
            }
            Console.WriteLine("End Place Order Details");
            return(orderID);
        }
        public void ValidateAddressTest()
        {
            var    something             = typeof(Billing.Tests.ScenarioTests.OperationsTests);
            string executingAssemblyPath = something.GetTypeInfo().Assembly.Location;

            HttpMockServer.RecordsDirectory = Path.Combine(Path.GetDirectoryName(executingAssemblyPath), "SessionRecords");

            using (MockContext context = MockContext.Start(this.GetType()))
            {
                // Address entity to validate
                var addressEntity = new AddressDetails
                {
                    AddressLine1 = "1 Microsoft Way",
                    City         = "Redmond",
                    Region       = "WA",
                    Country      = "US",
                    PostalCode   = "98052"
                };

                // Create client
                var billingMgmtClient = BillingTestUtilities.GetBillingManagementClient(context, new RecordedDelegatingHandler {
                    StatusCodeToReturn = HttpStatusCode.OK
                });

                // Validate Address
                var validateAddressResponse = billingMgmtClient.Address.Validate(addressEntity);

                // Verify that address is valid
                Assert.NotNull(validateAddressResponse);
                Assert.True(validateAddressResponse.Status == AddressValidationStatus.Valid);
            }
        }
Пример #24
0
        public Result <List <AddressDetails> > ListIDAddress(int customerID)
        {
            Result <List <AddressDetails> > rLa = new Result <List <AddressDetails> >();
            SqlProvider provider = new SqlProvider("Select * from AddressDetails where CustomerID=@CustomerID", false);

            provider.AddParameter("@CustomerID", customerID);
            List <AddressDetails> ListIDAddress = new List <AddressDetails>();
            SqlDataReader         reader        = provider.ExecuteReader();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    AddressDetails d = new AddressDetails();
                    d.Id         = int.Parse(reader["Id"].ToString());
                    d.Address    = reader["Address"].ToString();
                    d.City       = reader["City"].ToString();
                    d.Country    = reader["Country"].ToString();
                    d.CreateDate = DateTime.Parse(reader["CreateDate"].ToString());
                    d.CustomerID = int.Parse(reader["CustomerID"].ToString());
                    ListIDAddress.Add(d);
                }
            }
            reader.Close();
            rLa.TransactionResult = ListIDAddress;
            rLa.IsSucceeded       = rLa.TransactionResult != null;
            return(rLa);
        }
Пример #25
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ClientDetails clientModel = new ClientDetails();

            //Client Details
            clientModel.Name   = txtName.Text;
            clientModel.Gender = comboBox1.SelectedItem.ToString();


            ContactDetails contactDetails = new ContactDetails();

            //Client Contact
            contactDetails.CellNumber = txtCell.Text;
            contactDetails.WorkTel    = txtWorkTel.Text;

            //Client Address
            AddressDetails clientAddress = new AddressDetails();

            clientAddress.WorkAddress = txtWorkAddress.Text;
            clientAddress.ResAddress  = txtResAddress.Text;
            clientAddress.PosAddress  = txtPosAddress.Text;

            clientService.InsertClientDetails(clientModel, clientAddress, contactDetails);

            MessageBox.Show("Client Added Succesfully", "Create Status", MessageBoxButtons.OK);

            HomeForm home = new HomeForm();

            Hide();
            home.Show();
        }
Пример #26
0
        private static Address PopulateFromDBDetailsObject(AddressDetails obj)
        {
            Address objNew = new Address();

            objNew.AddressId        = obj.AddressId;
            objNew.AddressName      = obj.AddressName;
            objNew.Line1            = obj.Line1;
            objNew.Line2            = obj.Line2;
            objNew.Line3            = obj.Line3;
            objNew.County           = obj.County;
            objNew.City             = obj.City;
            objNew.State            = obj.State;
            objNew.CountryNo        = obj.CountryNo;
            objNew.ZIP              = obj.ZIP;
            objNew.Inactive         = obj.Inactive;
            objNew.UpdatedBy        = obj.UpdatedBy;
            objNew.DLUP             = obj.DLUP;
            objNew.CountryName      = obj.CountryName;
            objNew.CompanyAddressId = obj.CompanyAddressId;
            objNew.DefaultBilling   = obj.DefaultBilling;
            objNew.DefaultShipping  = obj.DefaultShipping;
            objNew.CeaseDate        = obj.CeaseDate;
            objNew.ShipViaNo        = obj.ShipViaNo;
            objNew.ShipViaAccount   = obj.ShipViaAccount;
            objNew.Notes            = obj.Notes;
            objNew.ShippingNotes    = obj.ShippingNotes;
            objNew.CompanyNo        = obj.CompanyNo;
            objNew.ShipViaName      = obj.ShipViaName;
            /// /// ESMS #14
            objNew.TaxbyAddress = obj.TaxbyAddress;
            // End
            return(objNew);
        }
Пример #27
0
    public bool create(PersonDetails personDetails, AddressDetails addressDetails)
    {
        int personID = DaycareAccess.CreatePerson(personDetails.FName, personDetails.LName, personDetails.UserName, "", "", "", 1);

        int addressID=DaycareAccess.CreateAddress(addressDetails.Country, addressDetails.State, addressDetails.City, addressDetails.AddressL1, addressDetails.AddressL2, addressDetails.PostalCode, addressDetails.Longitude, addressDetails.Latitude, personID );

        return true;
    }
Пример #28
0
        private AddressDetails CreateAddress()
        {
            var ad = new AddressDetails {
                Address = "11 aa", City = "Macondo", Country = "America", PostalCode = "21456", Region = "America"
            };

            return(ad);
        }
Пример #29
0
        private AddressDetails CreateAddress()
        {
            var ad = new AddressDetails {
                Address = "11 aa", City = "Macondo", Country = "World", PostalCode = "", Region = "Earth"
            };

            return(ad);
        }
Пример #30
0
 public Patron(DateTime bday, char sex, bool verified, string firstname, string lastname) : base(bday, sex, firstname, lastname)
 {
     this.Birthday = bday;
     this.Sex      = sex;
     this.Verified = verified;
     SetFirstname(firstname);
     SetLastname(lastname);
     _address = new AddressDetails();
 }
Пример #31
0
        /// <summary>
        /// GetListForCompany
        /// Calls [usp_selectAll_Address_for_Company]
        /// </summary>
        public override List <AddressDetails> GetListForCompany(System.Int32?companyId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Address_for_Company", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@CompanyId", SqlDbType.Int).Value = companyId;
                cn.Open();
                DbDataReader          reader = ExecuteReader(cmd);
                List <AddressDetails> lst    = new List <AddressDetails>();
                while (reader.Read())
                {
                    AddressDetails obj = new AddressDetails();
                    obj.AddressId        = GetReaderValue_Int32(reader, "AddressId", 0);
                    obj.AddressName      = GetReaderValue_String(reader, "AddressName", "");
                    obj.Line1            = GetReaderValue_String(reader, "Line1", "");
                    obj.Line2            = GetReaderValue_String(reader, "Line2", "");
                    obj.Line3            = GetReaderValue_String(reader, "Line3", "");
                    obj.County           = GetReaderValue_String(reader, "County", "");
                    obj.City             = GetReaderValue_String(reader, "City", "");
                    obj.State            = GetReaderValue_String(reader, "State", "");
                    obj.CountryNo        = GetReaderValue_NullableInt32(reader, "CountryNo", null);
                    obj.ZIP              = GetReaderValue_String(reader, "ZIP", "");
                    obj.Inactive         = GetReaderValue_Boolean(reader, "Inactive", false);
                    obj.UpdatedBy        = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP             = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.CountryName      = GetReaderValue_String(reader, "CountryName", "");
                    obj.CompanyAddressId = GetReaderValue_Int32(reader, "CompanyAddressId", 0);
                    obj.DefaultBilling   = GetReaderValue_Boolean(reader, "DefaultBilling", false);
                    obj.DefaultShipping  = GetReaderValue_Boolean(reader, "DefaultShipping", false);
                    obj.CeaseDate        = GetReaderValue_NullableDateTime(reader, "CeaseDate", null);
                    obj.ShipViaNo        = GetReaderValue_NullableInt32(reader, "ShipViaNo", null);
                    obj.ShipViaAccount   = GetReaderValue_String(reader, "ShipViaAccount", "");
                    obj.Notes            = GetReaderValue_String(reader, "Notes", "");
                    obj.ShippingNotes    = GetReaderValue_String(reader, "ShippingNotes", "");
                    obj.CompanyNo        = GetReaderValue_Int32(reader, "CompanyNo", 0);
                    obj.ShipViaName      = GetReaderValue_String(reader, "ShipViaName", "");
                    /// /// ESMS #14
                    obj.TaxbyAddress = GetReaderValue_Int32(reader, "TaxbyAddress", 0);
                    // End
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Addresss", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Пример #32
0
        static public void Serialize(AddressDetails details)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(AddressDetails));

            using (TextWriter writer = new StreamWriter(@"C:\Xml.xml"))
            {
                serializer.Serialize(writer, details);
            }
        }
Пример #33
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AddressDetails a = new AddressDetails();
     a.Longitude = 45.419126;
     a.Latitude = -70.677287;
     sampleList.DataSource = DaycareAccess.GetInstancesOfTypeWithinDistance(a, 5,2);
     //sampleList.DataSource = DaycareAccess.GetAPersonWID(1);
     sampleList.DataBind();
 }
Пример #34
0
        private DisplayDetailsViewModel GetUserDetails(string Id)
        {
            var user = (from u in UserManager.Users
                        where u.Id == Id
                        select u)
                       .FirstOrDefault();

            var info = _IUserInformationRepository.UserInformations.FirstOrDefault(x => x.id == user.user_info_id);

            var user_address = _IAddressesRepository.Addresses.FirstOrDefault(x => x.id == info.address_id);

            AccountDetails acc = new AccountDetails
            {
                ID          = user.Id,
                Email       = user.Email,
                PhoneNumber = user.PhoneNumber
            };
            AddressDetails address = new AddressDetails
            {
                AddressID       = user_address.id,
                City            = user_address.city,
                Street          = user_address.street,
                HouseNumber     = user_address.house_number,
                ApartmentNumber = user_address.apartment_number,
                PostalCode      = user_address.postal_code,
                PostalCity      = user_address.postal_city
            };
            PersonalDetails personal = new PersonalDetails
            {
                PersonalID   = user.UserInfo.id,
                FirstName    = user.UserInfo.first_name,
                LastName     = user.UserInfo.last_name,
                Gender       = user.UserInfo.gender,
                RegisterDate = user.UserInfo.register_date
            };

            string photo = Url.Content("/Images/Photos/profile-photo.jpg");

            if (user.UserInfo.photo_id.HasValue)
            {
                photo = user.UserInfo.Photo.url;
            }
            else if (user.UserInfo.gender == "Kobieta")
            {
                photo = Url.Content("/Images/Photos/profile-photo-female.jpg");
            }

            var details = new DisplayDetailsViewModel
            {
                AccountDetails  = acc,
                AddressDetails  = address,
                PersonalDetails = personal,
                Photo           = photo
            };

            return(details);
        }
Пример #35
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //int personID = DaycareAccess.CreatePerson("Someone2", "SomeLastName2","SomeUserName", "Description of Someone", "C:/thumbnail/pic1.jpg", "C:/image/pic1.jpg", 2);
        //PersonDetails p = DaycareAccess.GetAPersonWID(1)[0];
        //PersonLabel.Text = p.FName;
        //AddressLabel.Text = DaycareAccess.CreateAddress("Canada", "Ontario", "Ottawa", "800 King Edward st","", "K1N 6N5",45.419126,-75.677278,personID).ToString();

        //TypeLabel.Text = DaycareAccess.CreatePerson("Man", "Khodam", "Description of the person", "C:/thumbnail/pic1.jpg", "C:/image/pic1.jpg", 2).ToString();

        AddressDetails a = new AddressDetails();
        a.Longitude = -75.677287;
        a.Latitude = 45.419126;
        PersonAddressDetails pa = DaycareAccess.GetInstancesOfTypeWithinDistance(a, 5, 2)[0];
        PersonLabel.Text = pa.FName;
    }
        /// <remarks>
        /// Serialization is performed by creating an <see cref="AddressDetails"/> instance
        /// equivalent to the given <see cref="IPAddress"/> instance and serializing that as
        /// a JSON object.
        /// </remarks>
        /// <inheritdoc/>
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (value == null)
            {
                writer.WriteNull();
                return;
            }

            IPAddress address = value as IPAddress;
            if (address == null)
                throw new JsonSerializationException(string.Format(CultureInfo.InvariantCulture, "Unexpected value when converting IP address. Expected {0}, got {1}.", typeof(IPAddress), value.GetType()));

            AddressDetails details = new AddressDetails(address);
            serializer.Serialize(writer, details);
        }
Пример #37
0
        public static AddressDetails[] showAdress()
        {
            List<AddressDetails> adrdetails = new List<AddressDetails>();
            //budhashop.USER.OrderPage pge = new budhashop.USER.OrderPage();
            if (HttpContext.Current.Session["currentuser"] != null)
            {
                DataTable dtt = (DataTable)HttpContext.Current.Session["currentuser"];
                string emailid = dtt.Rows[0]["Email"].ToString();

                try
                {

                    IUser retrieveuser = new UserItems();

                    //returns the table if given emailid exists
                    DataTable dt2 = retrieveuser.checkavailability(emailid);
                    if (dt2 != null)
                    {
                        AddressDetails adr = new AddressDetails();
                        //pge.txt_emailid.Text
                        adr.EmailId = dt2.Rows[0]["Email"].ToString();

                        //txt_uname.Text
                        adr.UserName = dt2.Rows[0]["UserName"].ToString();
                        //pge.txt_phno.Text
                        adr.Phone = dt2.Rows[0]["Phone"].ToString();
                        //pge.txt_address.Text
                        adr.Address = dt2.Rows[0]["Address"].ToString();

                        adrdetails.Add(adr);
                    }

                }
                catch (Exception ex)
                {
                    //pge.lbl_status.Text = "Error Occured : " + ex.Message;
                    throw ex;
                }
            }

            //ClientScript.RegisterHiddenField("isPostBack", "1");
            return adrdetails.ToArray();

            //pge.CartDiv.Visible = false;
            //pge.adressDiv.Visible = true;
            //return true;
        }
Пример #38
0
    protected void CreatePersonButton_Click(object sender, EventArgs e)
    {
        //MyGoogleMapControl1.addAddress(AddressBox.Text);
        //DaycareAccess.CreatePerson(FNameBox.Text, LNameBox.Text, "", "", "", 2);
        /*HtmlInputText finalAddress = (HtmlInputText)MyGoogleMapControl1.FindControl("where");
        String test = finalAddress.Value;
        AddressBox.Text = test;*/

        AddressDetails addressDetails=new AddressDetails();

        HtmlInputText line1 = (HtmlInputText)MyGoogleMapControl1.FindControl("line1");
        addressDetails.AddressL1=line1.Value;

        HtmlInputText line2 = (HtmlInputText)MyGoogleMapControl1.FindControl("line2");
        addressDetails.AddressL2 = line2.Value;

        HtmlInputText country = (HtmlInputText)MyGoogleMapControl1.FindControl("country");
        addressDetails.Country = country.Value;

        HtmlInputText state = (HtmlInputText)MyGoogleMapControl1.FindControl("state");
        addressDetails.State = state.Value;

        HtmlInputText city = (HtmlInputText)MyGoogleMapControl1.FindControl("city");
        addressDetails.City = city.Value;

        HtmlInputText code = (HtmlInputText)MyGoogleMapControl1.FindControl("code");
        addressDetails.PostalCode = code.Value;

        HtmlInputText longitude = (HtmlInputText)MyGoogleMapControl1.FindControl("longitude");
        addressDetails.Longitude = Double.Parse(longitude.Value);

        HtmlInputText latitude = (HtmlInputText)MyGoogleMapControl1.FindControl("latitude");
        addressDetails.Latitude = Double.Parse(latitude.Value);

        PersonDetails personDetails = new PersonDetailsBuilder().fName(FNameBox.Text).lName(LNameBox.Text).userName(username).build();
        /*    new PersonDetails();
        personDetails.FName = FNameBox.Text;
        personDetails.LName = LNameBox.Text;
        personDetails.UserName = username;*/

        RegisterationController.Instance.create(personDetails, addressDetails);
    }
Пример #39
0
    protected void Confirm_Click(object sender, EventArgs e)
    {
        AddressDetails addressDetails = new AddressDetails();

        /*HtmlInputText line1 = (HtmlInputText)MyGoogleMapControl1.FindControl("line1");
        addressDetails.AddressL1 = line1.Value;

        HtmlInputText line2 = (HtmlInputText)MyGoogleMapControl1.FindControl("line2");
        addressDetails.AddressL2 = line2.Value;

        HtmlInputText country = (HtmlInputText)MyGoogleMapControl1.FindControl("country");
        addressDetails.Country = country.Value;

        HtmlInputText state = (HtmlInputText)MyGoogleMapControl1.FindControl("state");
        addressDetails.State = state.Value;

        HtmlInputText city = (HtmlInputText)MyGoogleMapControl1.FindControl("city");
        addressDetails.City = city.Value;

        HtmlInputText code = (HtmlInputText)MyGoogleMapControl1.FindControl("code");
        addressDetails.PostalCode = code.Value;*/

        HtmlInputText longitude = (HtmlInputText)MyGoogleMapControl1.FindControl("longitude");
        addressDetails.Longitude = Double.Parse(longitude.Value);

        HtmlInputText latitude = (HtmlInputText)MyGoogleMapControl1.FindControl("latitude");
        addressDetails.Latitude = Double.Parse(latitude.Value);

        //RegisterationController.Instance.create(personDetails, addressDetails);
        PersonAddressDetails[] addresses=LookupController.Instance.filter(addressDetails);

        if (addresses != null)
        {
            if (addresses.Length > 0)
            {
                MyGoogleMapControl1.PersonAddressArray = addresses;
            }
        }
    }
Пример #40
0
		public async Task ImportWatchAddressAsync(AddressDetails addressDetails) {
			if(IsLocked) throw new LockedException();
			WatchAddresses.Add(addressDetails);
			await SaveAsync();
		}
Пример #41
0
    public static PersonAddressDetails[] GetInstancesOfTypeWithinDistance(AddressDetails addr, int dist, int typeID)
    {
        DbCommand comm = GenericDataAccess.CreateCommand();
        comm.CommandText = "GetInstancesOfTypeWithinDistance";

        DbParameter param = comm.CreateParameter();
        param.ParameterName = "@Long";
        param.DbType = DbType.Double;
        param.Value = addr.Longitude;
        comm.Parameters.Add(param);

        param = comm.CreateParameter();
        param.ParameterName = "@Lat";
        param.DbType = DbType.Double;
        param.Value = addr.Latitude;
        comm.Parameters.Add(param);

        param = comm.CreateParameter();
        param.ParameterName = "@Dist";
        param.DbType = DbType.Int32;
        param.Value = dist;
        comm.Parameters.Add(param);

        param = comm.CreateParameter();
        param.ParameterName = "@TypeID";
        param.DbType = DbType.Int32;
        param.Value = typeID;
        comm.Parameters.Add(param);

        DataTable perAddTable = GenericDataAccess.ExecuteSelectCommand(comm);
        PersonAddressDetails[] personaddressStructs=new PersonAddressDetails[perAddTable.Rows.Count];

        for (int row=0;row<perAddTable.Rows.Count;row++) {
            DataRow dataRow = perAddTable.Rows[row];

            personaddressStructs[row].PersonID= Int32.Parse(dataRow["PersonID"].ToString());
            personaddressStructs[row].FName = dataRow["FName"].ToString();
            personaddressStructs[row].LName = dataRow["LName"].ToString();
            personaddressStructs[row].UserName = dataRow["UserName"].ToString();
            personaddressStructs[row].Thumbnail = dataRow["Thumbnail"].ToString();
            personaddressStructs[row].Image = dataRow["Image"].ToString();
            personaddressStructs[row].Description = dataRow["Description"].ToString();

            personaddressStructs[row].Country = dataRow["Country"].ToString();
            personaddressStructs[row].City = dataRow["City"].ToString();
            personaddressStructs[row].State = dataRow["State"].ToString();
            personaddressStructs[row].AddressL1 = dataRow["AddressLine1"].ToString();
            personaddressStructs[row].AddressL2 = dataRow["AddressLine2"].ToString();
            personaddressStructs[row].State = dataRow["State"].ToString();
            personaddressStructs[row].PostalCode = dataRow["PostalCode"].ToString();
            personaddressStructs[row].Latitude = Double.Parse(dataRow["Latitude"].ToString());
            personaddressStructs[row].Longitude = Double.Parse(dataRow["Longitude"].ToString());
        }

        return personaddressStructs;
    }
Пример #42
0
    public static AddressDetails[] GetAllAddresses()
    {
        DbCommand comm = GenericDataAccess.CreateCommand();
        comm.CommandText = "GetAllAddresses";

        DataTable addressTables=GenericDataAccess.ExecuteSelectCommand(comm);
        AddressDetails[] addressStructs=new AddressDetails[addressTables.Rows.Count];

        for (int row=0;row<addressTables.Rows.Count;row++) {
            DataRow dataRow = addressTables.Rows[row];
            addressStructs[row].Country = dataRow["Country"].ToString();
            addressStructs[row].City = dataRow["City"].ToString();
            addressStructs[row].State = dataRow["State"].ToString();
            addressStructs[row].AddressL1 = dataRow["AddressLine1"].ToString();
            addressStructs[row].AddressL2 = dataRow["AddressLine2"].ToString();
            addressStructs[row].State = dataRow["State"].ToString();
            addressStructs[row].PostalCode = dataRow["PostalCode"].ToString();
            addressStructs[row].Latitude = Double.Parse(dataRow["Latitude"].ToString());
            addressStructs[row].Longitude = Double.Parse(dataRow["Longitude"].ToString());
        }

        return addressStructs;
    }
		public void StoreAddresses() {
			var collection = new AddressCollection();

			var publicAddress = new Address("1ky1eHUrRR1kxKTbfiCptao9V25W97gDm");
			var publicDetails = new AddressDetails(publicAddress, "public");

			var miningAddress = new Address("1digVweRyrR9NbPaQJ2dfudXcZWQd81au");
			var miningDetails = new AddressDetails(miningAddress, "mining");

			var miscAddress = new Address("12pa32rAF8dejmKnU6XfXZ3aNCmroVNSQj");
			var miscDetails = new AddressDetails(miscAddress);



			collection.Add(publicDetails);
			collection.Add(miningDetails);
			collection.Add(miscAddress);

			Assert.AreEqual(collection.Count, 3);

			Assert.AreEqual(collection[0], publicDetails);
			Assert.AreEqual(collection[publicAddress], publicDetails);

			Assert.AreEqual(collection[1], miningDetails);
			Assert.AreEqual(collection[miningAddress], miningDetails);

			Assert.AreEqual(collection[2], miscDetails);
			Assert.AreEqual(collection[miscAddress], miscDetails);



			collection.Remove(publicAddress);

			Assert.AreEqual(collection.Count, 2);

			Assert.AreEqual(collection[0], miningDetails);
			Assert.AreEqual(collection[miningAddress], miningDetails);

			Assert.AreEqual(collection[1], miscDetails);
			Assert.AreEqual(collection[miscAddress], miscDetails);



			collection.Insert(1, publicDetails);

			Assert.AreEqual(collection.Count, 3);

			Assert.AreEqual(collection[0], miningDetails);
			Assert.AreEqual(collection[miningAddress], miningDetails);

			Assert.AreEqual(collection[1], publicDetails);
			Assert.AreEqual(collection[publicAddress], publicDetails);

			Assert.AreEqual(collection[2], miscDetails);
			Assert.AreEqual(collection[miscAddress], miscDetails);


			collection.RemoveAt(2);

			Assert.AreEqual(collection.Count, 2);

			Assert.AreEqual(collection[0], miningDetails);
			Assert.AreEqual(collection[miningAddress], miningDetails);

			Assert.AreEqual(collection[1], publicDetails);
			Assert.AreEqual(collection[publicAddress], publicDetails);
		}
Пример #44
0
partial         void OnAddressDetailsChanging(AddressDetails value);
Пример #45
0
 public static Customers CreateCustomers(string customerID, string companyName, AddressDetails addressDetails)
 {
     Customers customers = new Customers();
     customers.CustomerID = customerID;
     customers.CompanyName = companyName;
     if ((addressDetails == null))
     {
         throw new global::System.ArgumentNullException("addressDetails");
     }
     customers.AddressDetails = addressDetails;
     return customers;
 }
Пример #46
0
 public static Suppliers CreateSuppliers(int supplierID, string companyName, AddressDetails addressDetails)
 {
     Suppliers suppliers = new Suppliers();
     suppliers.SupplierID = supplierID;
     suppliers.CompanyName = companyName;
     if ((addressDetails == null))
     {
         throw new global::System.ArgumentNullException("addressDetails");
     }
     suppliers.AddressDetails = addressDetails;
     return suppliers;
 }
Пример #47
0
 public static Employees CreateEmployees(int employeeID, string lastName, string firstName, AddressDetails addressDetails)
 {
     Employees employees = new Employees();
     employees.EmployeeID = employeeID;
     employees.LastName = lastName;
     employees.FirstName = firstName;
     if ((addressDetails == null))
     {
         throw new global::System.ArgumentNullException("addressDetails");
     }
     employees.AddressDetails = addressDetails;
     return employees;
 }
Пример #48
0
    public static string addressToString(AddressDetails addressDetails)
    {
        string s = addressDetails.AddressL1 + " " + addressDetails.City + " " + addressDetails.State + " " + addressDetails.PostalCode + " " + addressDetails.Country;

        return s;
    }