/// <summary> /// The get entity from record. /// </summary> /// <param name="record"> /// The record. /// </param> /// <returns> /// The <see cref="Pickup"/>. /// </returns> protected Pickup GetEntityFromRecord(List<string> record) { if (record == null) return null; var order = new OrderLogic(new DeliveryOracleContext(), new PickupOracleContext(), new OrderOracleContext()).GetById (Convert.ToInt32(record[0])); return new Pickup(Convert.ToInt32(record[0]), Convert.ToInt32(record[1]), order.Customer, order.Date); }
/// <summary> /// The page_ load. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> protected void Page_Load(object sender, EventArgs e) { if (!this.Page.User.Identity.IsAuthenticated) { this.Response.Redirect("~/Login.aspx"); } // Loading articles this.workingman = new ShoppingCartActions(); this.transportman = new OrderLogic(new DeliveryOracleContext(), new PickupOracleContext(), new OrderOracleContext()); // Loading user var customerLogic = new CustomerLogic(new CustomerOracleContext()); this.currentCustomer = customerLogic.GetByEmail(HttpContext.Current.User.Identity.Name); // Put information in form this.HcustomerID.Value = this.currentCustomer.Id.ToString(); this.txtName.Text = this.currentCustomer.Name; this.txtAddress.Text = this.currentCustomer.Address; this.txtPostalCode.Text = this.currentCustomer.Postalcode; this.txtCity.Text = this.currentCustomer.City; this.txtTelePhoneNumber.Text = this.currentCustomer.Telephone; this.txtEmailAddress.Text = this.currentCustomer.Emailaddress; // Loading list of stores for picking up this.storeLogic = new StoreLogic(new StoreOracleContext()); foreach (var store in storeLogic.GetAllStores()) { this.drpStores.Items.Add("MyCom - " + store.Address); } // Loading fields for delivery this.txtAlterAddress.Text = this.currentCustomer.Address; this.txtAlterCity.Text = this.currentCustomer.City; this.txtAlterPostal.Text = this.currentCustomer.Postalcode; }