private void BtnSelect_Click(object sender, EventArgs e) { LblBusinessDescription.Show(); LblBusinessName.Show(); LblCategory.Show(); LblPrice.Show(); LblRating.Show(); LblTelephone.Show(); LblUser.Show(); LblWebsite.Show(); LblWorkHours.Show(); LblBusinessType.Show(); LblLocation.Show(); TbxBusinessName.Show(); TbxCategory.Show(); TbxDescription.Show(); TbxPrice.Show(); TbxRating.Show(); TbxTelephone.Show(); TbxWebsite.Show(); CmbLocation.Show(); CmbTypes.Show(); CmbUser.Show(); CmbWorkHours.Show(); ChbReservation.Show(); BtnEdit.Show(); LblSelect.Hide(); CmbBusinesses.Hide(); BtnSelect.Hide(); SelectedData = DCom.GetData(String.Format(SqlExec, CmbBusinesses.SelectedValue)); TbxBusinessName.Text = (string)SelectedData.Rows[0]["Business_Name"]; TbxCategory.Text = (string)SelectedData.Rows[0]["Category"]; TbxDescription.Text = (string)SelectedData.Rows[0]["Description"]; TbxPrice.Text = SelectedData.Rows[0]["Price_Range"].ToString(); TbxRating.Text = (string)SelectedData.Rows[0]["Rating"].ToString(); TbxTelephone.Text = (string)SelectedData.Rows[0]["Telephone"]; TbxWebsite.Text = (string)SelectedData.Rows[0]["Website"]; CmbLocation.DataSource = DCom.GetData("SELECT ID,CONCAT(Address_Name, ', ', Address_Number) AS NAME FROM location"); CmbLocation.DisplayMember = "NAME"; CmbLocation.ValueMember = "ID"; CmbTypes.DataSource = DCom.GetData("SELECT * FROM businesses_types"); CmbTypes.DisplayMember = "Type"; CmbTypes.ValueMember = "Type"; CmbUser.DataSource = DCom.GetData("SELECT * FROM users"); CmbUser.DisplayMember = "Username"; CmbUser.ValueMember = "Username"; CmbWorkHours.DataSource = DCom.GetData("SELECT * FROM work_hours"); CmbWorkHours.DisplayMember = "ID"; CmbWorkHours.ValueMember = "ID"; }
private void CurrentLocationTapped(object sender, EventArgs e) { if (!_isNearByExpanded) { return; } var pageHeight = Height; var isLocationLabelVisible = LblLocation.IsVisible; var recentLocationStackSize = RecentLocationStack.Measure(double.PositiveInfinity, double.PositiveInfinity); var currentAndRecentLocationSize = CurrentAndRecentLocationStack.Measure(double.PositiveInfinity, double.PositiveInfinity); var suggestionHeight = LocationSuggestionStack.Measure(double.PositiveInfinity, double.PositiveInfinity); var suggestionMinHeight = Height * 0.28; var heighToBeSet = Math.Max(suggestionMinHeight, suggestionHeight.Request.Height); LocationSuggestionStack.HeightRequest = heighToBeSet; var locationStackSize = LocationStack.Measure(double.PositiveInfinity, double.PositiveInfinity); var locationStackHeight = Math.Max(currentAndRecentLocationSize.Request.Height + heighToBeSet + 90, locationStackSize.Request.Height); FrNearBy.TranslateTo(0, pageHeight - ((pageHeight * _topPosition) + (isLocationLabelVisible ? 71 : 0)), AppThemeConstants.AnimationSpeed, Easing.SinInOut); Thickness bottomGridMargin = BottomContainerGrid.Margin; bottomGridMargin.Bottom += isLocationLabelVisible ? -71 : 71; BottomContainerGrid.Margin = bottomGridMargin; System.Diagnostics.Debug.WriteLine($"Location Stack Height : {locationStackHeight}, {isLocationLabelVisible}"); if (isLocationLabelVisible) { LblLocation.TranslateTo(-80, 30, AppThemeConstants.AnimationSpeed, Easing.SinInOut); LblLocationSymbol.TranslateTo(-80, 30, AppThemeConstants.AnimationSpeed, Easing.SinInOut); SvBottomContainer.TranslateTo(0, locationStackHeight, AppThemeConstants.AnimationSpeed, Easing.SinInOut); LblLocation.IsVisible = false; LocationStack.Animate("ShowLocationStack", (x) => { LocationStack.HeightRequest = locationStackHeight * x; }); LocationWithZipCodeStack.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut); } else { LocationWithZipCodeStack.TranslateTo(80, -30, AppThemeConstants.AnimationSpeed, Easing.SinInOut); SvBottomContainer.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut); LocationStack.Animate("HideLocationStack", (x) => { LocationStack.HeightRequest = locationStackHeight * (1 - x); }, finished: (x, y) => { System.Diagnostics.Debug.WriteLine($"Finished callback : {x}, {y}"); LblLocation.IsVisible = true; }); LblLocationSymbol.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut); LblLocation.TranslateTo(0, 0, AppThemeConstants.AnimationSpeed, Easing.SinInOut); } }
public EdiBusinessForm() { InitializeComponent(); LblBusinessDescription.Hide(); LblBusinessName.Hide(); LblCategory.Hide(); LblPrice.Hide(); LblRating.Hide(); LblTelephone.Hide(); LblUser.Hide(); LblWebsite.Hide(); LblWorkHours.Hide(); LblBusinessType.Hide(); LblLocation.Hide(); TbxBusinessName.Hide(); TbxCategory.Hide(); TbxDescription.Hide(); TbxPrice.Hide(); TbxRating.Hide(); TbxTelephone.Hide(); TbxWebsite.Hide(); CmbLocation.Hide(); CmbTypes.Hide(); CmbUser.Hide(); CmbWorkHours.Hide(); ChbReservation.Hide(); BtnEdit.Hide(); CmbBusinesses.DataSource = DCom.GetData("SELECT businesses.ID, CONCAT(businesses.Business_Name, ', ', location.Address_Name, ', ', location.Municipality) AS NAME FROM businesses, location WHERE businesses.Location_ID = location.ID"); CmbBusinesses.DisplayMember = "NAME"; CmbBusinesses.ValueMember = "ID"; }