private IEnumerable <ShippingListItem> GetShippingByOrderPrice() { var shippingitem = new ShippingListItem { Id = ++_index, Type = ShippingType.ShippingByOrderPrice, MethodId = _method.ShippingMethodId, MethodName = _method.Name, MethodNameRate = _method.Name, MethodDescription = _method.Description, DeliveryTime = _method.Params.ElementOrDefault(ShippingByOrderPriceTemplate.DeliveryTime), IconName = _method.IconFileName.PhotoName, Rate = new ShippingByOrderPrice(_method.Params).GetRate(_totalPrice, _totalPrice - _totalDiscount) }; var list = new List <ShippingListItem>(); if (shippingitem.Rate != -1) { list.Add(shippingitem); } return(list); }
private Control GetTableRadioButton(ShippingListItem shippingListItem) { var tr = new HtmlTableRow(); var td = new HtmlTableCell(); if (divScripts.Visible == false) divScripts.Visible = shippingListItem.Ext != null && shippingListItem.Ext.Type == ExtendedType.Pickpoint; var radioButton = new RadioButton { GroupName = "ShippingRateGroup", ID = PefiksId + shippingListItem.Id //+ "|" + shippingListItem.Rate }; if (String.IsNullOrEmpty(_selectedID.Value.Replace(PefiksId, string.Empty))) { _selectedID.Value = radioButton.ID; } radioButton.Checked = radioButton.ID == _selectedID.Value; radioButton.Attributes.Add("onclick", "setValue(this)"); string strShippingPrice = CatalogService.GetStringPrice(shippingListItem.Rate, Currency.Value, Currency.Iso3); radioButton.Text = string.Format("{0} <span class='price'>{1}</span>", shippingListItem.MethodNameRate, strShippingPrice); if (shippingListItem.Ext != null && shippingListItem.Ext.Type == ExtendedType.Pickpoint) { string temp; if (shippingListItem.Ext.Pickpointmap.IsNotEmpty()) temp = string.Format(",{{city:'{0}', ids:null}}", shippingListItem.Ext.Pickpointmap); else temp = string.Empty; radioButton.Text += string.Format( "<br/><div id=\"address\">{0}</div><a href=\"#\" onclick=\"PickPoint.open(SetPickPointAnswerAdmin{1});return false\">" + "{2}</a><input type=\"hidden\" name=\"pickpoint_id\" id=\"pickpoint_id\" value=\"\" /><br />", pickAddress.Value, temp, Resources.Resource.Client_OrderConfirmation_Select); } using (var img = new Image { ImageUrl = SettingsGeneral.AbsoluteUrl + "/" + ShippingIcons.GetShippingIcon(shippingListItem.Type, shippingListItem.IconName, shippingListItem.MethodNameRate) }) { td.Controls.Add(img); } td.Controls.Add(radioButton); tr.Controls.Add(td); return tr; }
private IEnumerable<ShippingListItem> GetShippingByOrderPrice() { var shippingitem = new ShippingListItem { Id = ++_index, Type = ShippingType.ShippingByOrderPrice, MethodId = _method.ShippingMethodId, MethodName = _method.Name, MethodNameRate = _method.Name, MethodDescription = _method.Description, DeliveryTime = _method.Params.ElementOrDefault(ShippingByOrderPriceTemplate.DeliveryTime), IconName = _method.IconFileName.PhotoName, Rate = new ShippingByOrderPrice(_method.Params).GetRate(_totalPrice, _totalPrice - _totalDiscount) }; var list = new List<ShippingListItem>(); if (shippingitem.Rate != -1) list.Add(shippingitem); return list; }