private void PageLoad() { #region "Data Repeater" if (_templD.Trim() != "") // if we don;t have a template, don't do anything { var l = _addressData.GetAddressList(); rpData.DataSource = l; rpData.DataBind(); } #endregion base.DoDetail(rpDataH); base.DoDetail(rpDataF); var addrid = Utils.RequestParam(Context, "addressid"); if (Utils.IsNumeric(addrid)) { var objAddr = _addressData.GetAddress(Convert.ToInt32(addrid)); if (objAddr == null) { objAddr = new NBrightInfo(true); //assume new address } base.DoDetail(rpAddr, objAddr); } else { base.DoDetail(rpAddr); } }
private static String GetAddress(HttpContext context) { var addressData = new AddressData(); var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context); var themeFolder = ajaxInfo.GetXmlProperty("genxml/hidden/themefolder"); var razortemplate = ajaxInfo.GetXmlProperty("genxml/hidden/razortemplate"); var selectedindex = ajaxInfo.GetXmlPropertyInt("genxml/hidden/selectedindex"); var passSettings = ajaxInfo.ToDictionary(); foreach (var s in StoreSettings.Current.Settings()) // copy store setting, otherwise we get a byRef assignement { if (passSettings.ContainsKey(s.Key)) { passSettings[s.Key] = s.Value; } else { passSettings.Add(s.Key, s.Value); } } var obj = addressData.GetAddress(selectedindex); obj.SetXmlProperty("genxml/selectedindex", selectedindex.ToString()); var strOut = NBrightBuyUtils.RazorTemplRender(razortemplate, 0, "", obj, "/DesktopModules/NBright/NBrightBuy", themeFolder, Utils.GetCurrentCulture(), passSettings); return(strOut); }
public Address GetAddresss(int addressID) { Address address = new Address(); AddressData data = new AddressData(); try { address = data.GetAddress(addressID); } catch (Exception ex) { log.Write(ex.Message, "GetAddresssCollection"); throw (ex); } finally { data = null; } return(address); }