private void BindData() { Warehouse warehouse = WarehouseManager.GetWarehouseByID(this.WarehouseID); if (warehouse != null) { this.txtName.Text = warehouse.Name; this.txtPhoneNumber.Text = warehouse.PhoneNumber; this.txtEmail.Text = warehouse.Email; this.txtFaxNumber.Text = warehouse.FaxNumber; this.txtAddress1.Text = warehouse.Address1; this.txtAddress2.Text = warehouse.Address2; this.txtCity.Text = warehouse.City; this.txtStateProvince.Text = warehouse.StateProvince; this.txtZipPostalCode.Text = warehouse.ZipPostalCode; CommonHelper.SelectListItem(this.ddlCountry, warehouse.CountryID); this.pnlCreatedOn.Visible = true; this.pnlUpdatedOn.Visible = true; this.lblCreatedOn.Text = DateTimeHelper.ConvertToUserTime(warehouse.CreatedOn).ToString(); this.lblUpdatedOn.Text = DateTimeHelper.ConvertToUserTime(warehouse.UpdatedOn).ToString(); } else { this.pnlCreatedOn.Visible = false; this.pnlUpdatedOn.Visible = false; } }
public Warehouse SaveInfo() { Warehouse warehouse = WarehouseManager.GetWarehouseByID(this.WarehouseID); if (warehouse != null) { warehouse = WarehouseManager.UpdateWarehouse(warehouse.WarehouseID, txtName.Text, txtPhoneNumber.Text, txtEmail.Text, txtFaxNumber.Text, txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtStateProvince.Text, txtZipPostalCode.Text, int.Parse(this.ddlCountry.SelectedItem.Value), warehouse.Deleted, warehouse.CreatedOn, DateTime.Now); } else { DateTime now = DateTime.Now; warehouse = WarehouseManager.InsertWarehouse(txtName.Text, txtPhoneNumber.Text, txtEmail.Text, txtFaxNumber.Text, txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtStateProvince.Text, txtZipPostalCode.Text, int.Parse(this.ddlCountry.SelectedItem.Value), false, now, now); } return(warehouse); }