/// <summary> Updates one existing provider in the database /// <param name="provider"> Inner_Provider Object - represents the fields of a Provider in the database </param> /// <returns> no return </returns> /// </summary> public async Task UpdateProviderAsync(Inner_Provider provider) { Data_Provider currentEntity = await _context.Providers.FindAsync(provider.ProviderId); Data_Provider newEntity = Mapper.UnMapProvider(provider); _context.Entry(currentEntity).CurrentValues.SetValues(newEntity); await Save(); }
// ! *********************************** // ! *********** Provider ************** // ! *********************************** public static Inner_Provider MapProvider(Data_Provider provider) { return(new Inner_Provider { ProviderId = provider.ProviderId, ProviderFirstName = provider.ProviderFirstName, ProviderLastName = provider.ProviderLastName, ProviderPhoneNumber = provider.ProviderPhoneNumber, Facility = MapFacility(provider.Facility), Specialty = MapSpecialty(provider.Specialty) }); }
protected void rptItems_ItemDataBound(object sender, RepeaterItemEventArgs e) { Repeater rpt = ((Repeater)e.Item.FindControl("rptDetails")); ((Label)e.Item.FindControl("lblfrontprice")).Text = Data_Provider.correctPrices(((Order_Element)e.Item.DataItem).CalculateCost().ToString()); rpt.DataSource = ((Order_Element)e.Item.DataItem).Details; rpt.DataBind(); if (((Order_Element)e.Item.DataItem).ID == 130) { foreach (RepeaterItem item in rpt.Items) { ((CheckBox)item.FindControl("chbAdded")).Enabled = false; if (!((CheckBox)item.FindControl("chbAdded")).Checked) { ((Panel)item.FindControl("pnlDetail")).Visible = false; } } } }
protected void Page_PreRender(object sender, EventArgs e) { if (MyOrder != null) { string type = MyOrder.Type; string location = MyOrder.Location; this.litSummaryNumber.Text = Session["orderItemNumber"].ToString(); if (string.IsNullOrEmpty(this.txtFirstName.Text)) // do not want the txtboxes clearing on post back { this.txtFirstName.Text = MyOrder.CustomerFirstName; } if (string.IsNullOrEmpty(this.txtLastName.Text)) // do not want the txtboxes clearing on post back { this.txtLastName.Text = MyOrder.CustomerLastName; } this.ddlDeliveryType.SelectedValue = type; this.ddlDeliveryType.Items[0].Enabled = string.IsNullOrEmpty(type); this.deliveryLocationContainer.Visible = !string.IsNullOrEmpty(type); this.ddlLocations.Items[0].Enabled = string.IsNullOrEmpty(location); this.ddlLocations.Items[1].Enabled = false; this.locationPlaceContainer.Style.Add("display", "none"); this.ddlLocations.Enabled = true; this.txtLocationPlace.Text = ""; this.ddlTimes.Enabled = true; this.ddlTimes.DataSource = Data_Provider.Transact_Interface.Get_Times("", Request); this.ddlTimes.DataBind(); if (this.ddlTimes.Items.FindByValue(MyOrder.TimeSlot) != null) { this.ddlTimes.SelectedValue = MyOrder.TimeSlot; } if (location != null) { if (location == "Palm's Grille") { this.ddlLocations.SelectedValue = location; this.ddlLocations.SelectedItem.Enabled = true; this.ddlLocations.Enabled = false; //this.ddlTimes.Enabled = false; } else if (location == "Sports Center" || location == "Campus House Lobby") { this.ddlLocations.SelectedValue = location; } else if (location.Length > 2 && (location.Substring(0, 2) == "WA" || location.Substring(0, 2) == "DR")) { this.ddlLocations.SelectedValue = location.Substring(0, 2); this.txtLocationPlace.Text = location.Substring(3); this.locationPlaceContainer.Style.Add("display", ""); if (location.Substring(0, 2) == "DR") { this.lbllocationPlace.InnerHtml = "Room Number"; } else { this.lbllocationPlace.InnerHtml = "Apartment Number"; } } } else { this.ddlLocations.SelectedValue = ""; } if (MyOrder.Order_Elements != null) { string cost = Math.Round(MyOrder.CalculateCost(), 2).ToString(); this.litPrice.Text = Data_Provider.correctPrices(cost); this.rptItems.DataSource = MyOrder.Order_Elements; this.rptItems.DataBind(); } } }
protected void Page_PreRender(object sender, EventArgs e) { int numItems = 0; if (Session["orderItemNumber"] != null) { numItems = Convert.ToInt32(Session["orderItemNumber"].ToString()); } this.plhItemsAreInOrder.Visible = numItems != 0; this.plhNoItemsInOrder.Visible = numItems == 0; if (MyOrder != null) { string type = MyOrder.Type; string location = MyOrder.Location; this.ddlDeliveryType.SelectedValue = type; this.ddlDeliveryType.Items[0].Enabled = string.IsNullOrEmpty(type); this.deliveryLocationContainer.Visible = !string.IsNullOrEmpty(type); this.ddlLocations.Items[0].Enabled = string.IsNullOrEmpty(location); this.ddlLocations.Items[1].Enabled = false; this.locationPlaceContainer.Style.Add("display", "none"); this.ddlLocations.Enabled = true; this.txtLocationPlace.Text = ""; if (location != null) { if (location == "Palm's Grille") { this.ddlLocations.SelectedValue = location; this.ddlLocations.SelectedItem.Enabled = true; this.ddlLocations.Enabled = false; } else if (location == "Sports Center" || location == "Campus House Lobby") { this.ddlLocations.SelectedValue = location; } else if (location.Length > 2 && (location.Substring(0, 2) == "WA" || location.Substring(0, 2) == "DR")) { this.ddlLocations.SelectedValue = location.Substring(0, 2); this.txtLocationPlace.Text = location.Substring(3); this.locationPlaceContainer.Style.Add("display", ""); if (location.Substring(0, 2) == "DR") { this.lbllocationPlace.InnerHtml = "Room Number"; } else { this.lbllocationPlace.InnerHtml = "Apartment Number"; } } } else { this.ddlLocations.SelectedValue = ""; } if (MyOrder.Order_Elements != null) { string cost = Math.Round(MyOrder.CalculateCost(), 2).ToString(); this.litPrice.Text = Data_Provider.correctPrices(cost); } } this.lblError.Text = ""; this.lnkGoPay.Enabled = checkFoodDeliverability(); }