protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e) { var cArg = e.CommandArgument.ToString(); var param = new string[3]; switch (e.CommandName.ToLower()) { case "updateaddress": _addressData.AddAddress(rpAddr); param[0] = "addressid=" + Utils.RequestParam(Context, "addressid"); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "saveaddress": _addressData.AddAddress(rpAddr); var addrid = Utils.RequestParam(Context, "addressid"); if (Utils.IsNumeric(addrid) && ModSettings.Get("emailmanager") == "True") { var ad = _addressData.GetAddress(Convert.ToInt32(addrid)); if (ad != null) { var emailtemplate = ModSettings.Get("emailtemplate"); if (ModSettings.Get("emailmanageropt") == "2") { NBrightBuyUtils.SendEmailToManager(emailtemplate, ad, "profileupdated_emailsubject.Text"); } else { if (ad.GetXmlPropertyBool("genxml/hidden/default")) { NBrightBuyUtils.SendEmailToManager(emailtemplate, ad, "profileupdated_emailsubject.Text"); } } } } NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef, NotifyCode.ok); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "deleteaddress": _addressData.RemoveAddress(e.Item.ItemIndex); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "editaddress": param[0] = "addressid=" + e.Item.ItemIndex.ToString(""); Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "newaddress": param[0] = "addressid=-1"; Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "cancel": Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; } }
private static String DeleteAddress(HttpContext context) { var addressData = new AddressData(); var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context); var selectedindex = ajaxInfo.GetXmlPropertyInt("genxml/hidden/selectedindex"); addressData.RemoveAddress(selectedindex); return(""); }
protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e) { var cArg = e.CommandArgument.ToString(); var param = new string[3]; if (_uid != "") { param[0] = "uid=" + _uid; } switch (e.CommandName.ToLower()) { case "saveaddress": _addressData.AddAddress(rpAddr); Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "deleteaddress": _addressData.RemoveAddress(e.Item.ItemIndex); Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "editaddress": param[1] = "addressid=" + e.Item.ItemIndex.ToString(""); Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "newaddress": param[1] = "addressid=-1"; Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; case "viewclient": param[1] = "ctrl=clients"; Response.Redirect(Globals.NavigateURL(TabId, "", param), true); break; case "cancel": Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true); break; } }