public override void EventAfterUpdate(System.Web.UI.WebControls.Repeater rpData, NBrightDNN.NBrightInfo objInfo)
 {
     // set page size so we pick it up in the product view.
     var navigationdata = new NavigationData(PortalId, objInfo.GetXmlProperty("genxml/textbox/modulekey"));
     navigationdata.PageSize = objInfo.GetXmlProperty("genxml/textbox/pagesize");
     navigationdata.Save();
 }
Example #2
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];
            var navigationData = new NavigationData(PortalId, "ClientsAdmin");

            switch (e.CommandName.ToLower())
            {
                case "entrydetail":
                    param[0] = "uid=" + cArg;
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "return":
                    param[0] = "";
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "search":
                    navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch,"","");
                    navigationData.Save();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "unlockuser":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        clientData.UnlockUser();
                    }
                    param[0] = "uid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "deleteuser":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        clientData.DeleteUser();
                    }
                    param[0] = "uid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "removeuser":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        var ok = clientData.RemoveUser();
                        if (!ok)
                        {
                            NBrightBuyUtils.SetNotfiyMessage(ModuleId,"removeuser", NotifyCode.fail);
                            param[0] = "uid=" + cArg;
                        }
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "validateuser":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        clientData.AuthoriseClient();
                        clientData.AddClientRole(ModSettings);
                        if (StoreSettings.Current.Get("resetpasswordonclientvalidate") == "True") clientData.ResetPassword();
                    }
                    param[0] = "uid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetpass":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        clientData.ResetPassword();
                    }
                    param[0] = "uid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "viewaddressbook":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        param[0] = "ctrl=addressbook";
                        param[1] = "uid=" + cArg;
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "vieworders":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        param[0] = "ctrl=orders";
                        param[1] = "uid=" + cArg;
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "createorder":
                    param[0] = "";
                    var tabId = TabId;
                    if (Utils.IsNumeric(cArg))
                    {
                        var cart = new CartData(PortalId);
                        cart.UserId = Convert.ToInt32(cArg);
                        cart.EditMode = "C";
                        cart.Save();
                        tabId = StoreSettings.Current.GetInt("productlisttab");
                        if (tabId==0) tabId = TabId;
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(tabId, param), true);
                    break;
                case "save":
                    if (Utils.IsNumeric(cArg))
                    {
                        var clientData = new ClientData(PortalId, Convert.ToInt32(cArg));
                        if (clientData.Exists)
                        {
                            clientData.Update(rpData);
                            clientData.Save();
                        }
                    }
                    param[0] = "uid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
            }
        }
Example #3
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var param = new string[2];
            var targlist = _targetModuleKey.Split(',');
                switch (e.CommandName.ToLower())
                {
                    case "search":
                        foreach (var targ in targlist)
                        {
                            var strXml = GenXmlFunctions.GetGenXml(rpData, "", "");
                            var navigationData = new NavigationData(PortalId, targ);
                            navigationData.Build(strXml, _templD);
                            navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                            navigationData.XmlData = GenXmlFunctions.GetGenXml(rpData);
                            navigationData.Mode = GenXmlFunctions.GetField(rpData, "navigationmode").ToLower();
                            navigationData.Save();

                            if (StoreSettings.Current.DebugModeFileOut)
                            {
                                strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                                var xmlDoc = new System.Xml.XmlDocument();
                                xmlDoc.LoadXml(strXml);
                                xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                            }

                        }

                        Response.Redirect(Globals.NavigateURL(_redirecttabid, "", param), true);
                        break;
                    case "resetsearch":
                        // clear cookie info
                        foreach (var targ in targlist)
                        {
                            var navigationData = new NavigationData(PortalId, targ);
                            navigationData.Delete();
                        }
                        Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                        break;
                    case "orderby":
                        foreach (var targ in targlist)
                        {
                            var navigationData = new NavigationData(PortalId, targ);
                            navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                            navigationData.Save();
                        }
                        break;
                }
        }
Example #4
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];

            var navigationData = new NavigationData(PortalId, "CategoryAdmin");
            switch (e.CommandName.ToLower())
            {
                case "entrydetail":
                    SaveAll();
                    param[1] = "eid=" + cArg;
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "return":
                    param[1] = "";
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.XmlData = strXml;
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    navigationData.Save();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    param[2] = "catid=0";
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "addnew":
                    var strXml2 = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.XmlData = strXml2;
                    navigationData.Save();
                    var categoryData = CategoryUtils.GetCategoryData(-1, EditLanguage);
                    if (!String.IsNullOrEmpty(Edittype) && Edittype.ToLower() == "group")
                    {
                        categoryData.GroupType = GenXmlFunctions.GetGenXmlValue(navigationData.XmlData, "genxml/dropdownlist/groupsel");
                        if (categoryData.GroupType == "") categoryData.GroupType = "cat";
                        var grpCtrl = new GrpCatController(Utils.GetCurrentCulture());
                        var grp = grpCtrl.GetGrpCategoryByRef(categoryData.GroupType);
                        if (grp != null) categoryData.DataRecord.SetXmlProperty("genxml/dropdownlist/ddlparentcatid", grp.categoryid.ToString(""));
                        categoryData.DataRecord.SetXmlProperty("genxml/checkbox/chkishidden", "False"); // don't hide property groups by default
                    }
                    categoryData.ParentItemId = _openid;
                    categoryData.Save();
                    NBrightBuyUtils.RemoveModCachePortalWide(PortalId);

                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "delete":
                    if (Utils.IsNumeric(cArg))
                    {
                        ModCtrl.Delete(Convert.ToInt32(cArg));
                    }
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "saveall":
                    SaveAll();
                    NBrightBuyUtils.RemoveModCachePortalWide(PortalId); //clear any cache
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "move":
                    SaveAll();
                    if (Utils.IsNumeric(cArg))
                    {
                        MoveRecord(Convert.ToInt32(cArg));
                    }
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "open":
                    param[1] = "catid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "close":
                    var catData = CategoryUtils.GetCategoryData(_openid, EditLanguage);
                    if (catData.DataRecord == null)
                        param[1] = "catid=0";
                    else
                        param[1] = "catid=" + catData.DataRecord.ParentItemId.ToString("");
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "save":
                    UpdateRecord();
                    param[1] = "eid=" + cArg;
                   param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "saveexit":
                    UpdateRecord();
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;

            }
        }
Example #5
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var tabId = TabId;
            var param = new string[4];
            if (_uid != "") param[0] = "uid=" + _uid;
            var navigationData = new NavigationData(PortalId, "AdminOrders");
            var cmd = e.CommandName.ToLower();
            var resxpath = StoreSettings.NBrightBuyPath() + "/App_LocalResources/Notification.ascx.resx";
            var emailoption = "";

            switch (cmd)
            {
                case "entrydetail":
                    param[0] = "eid=" + cArg;
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "reorder":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.CopyToCart(DebugMode);
                        tabId = StoreSettings.Current.GetInt("carttab");
                        if (tabId == 0) tabId = TabId;
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(tabId, param), true);
                    break;
                case "editorder":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.ConvertToCart(DebugMode);
                        tabId = StoreSettings.Current.GetInt("carttab");
                        if (tabId == 0) tabId = TabId;
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(tabId, param), true);
                    break;
                case "return":
                    param[0] = "";
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.Build(strXml, _templSearch);
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpSearch);
                    navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch);
                    navigationData.Save();
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "orderby":
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                    navigationData.Save();
                    break;
                case "viewclient":
                    param[1] = "ctrl=clients";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        param[0] = "uid=" + orderData.UserId.ToString("");
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "save":
                    param[0] = "eid=" + _entryid;
                    var result = Update();
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, result);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printorder":
                        param[0] = "eid=" + _entryid;
                        param[1] = "print=printorder";
                        param[2] = "template=printorder.html";
                        Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printreceipt":
                        param[0] = "eid=" + _entryid;
                        param[1] = "print=printorder";
                        param[2] = "template=printreceipt.html";
                        Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printdeliverylabel":
                    param[0] = "eid=" + _entryid;
                    param[1] = "print=printorder";
                    param[2] = "template=printdeliverylabel.html";
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailamended":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("orderamended_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "orderamendedemail.html", "orderamended_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailreceipt":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("orderreceipt_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "orderreceiptemail.html", "orderreceipt_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailshipped":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("ordershipped_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "ordershippedemail.html", "ordershipped_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailvalidated":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("ordervalidated_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "ordervalidatedemail.html", "ordervalidated_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "downloadinvoice":
                    DownloadInvoice(Convert.ToInt32(cArg));
                    break;
                case "deleteinvoice":
                    DeleteInvoice(Convert.ToInt32(cArg));
                    param[0] = "eid=" + _entryid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "export":
                    DoExport();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
            }
        }
Example #6
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];

            var navigationData = new NavigationData(PortalId, "CategoryAdmin");
            switch (e.CommandName.ToLower())
            {
                case "entrydetail":
                    SaveAll();
                    param[1] = "eid=" + cArg;
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "return":
                    param[1] = "";
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.XmlData = strXml;
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    navigationData.Save();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    param[2] = "catid=0";
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "addnew":
                    var strXml2 = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.XmlData = strXml2;
                    navigationData.Save();
                    var categoryData = CategoryUtils.GetCategoryData(-1, EditLanguage);
                    if (!String.IsNullOrEmpty(Edittype) && Edittype.ToLower() == "group")
                    {
                        categoryData.GroupType = GenXmlFunctions.GetGenXmlValue(navigationData.XmlData, "genxml/dropdownlist/groupsel");
                        if (categoryData.GroupType == "") categoryData.GroupType = "cat";
                        var grpCtrl = new GrpCatController(Utils.GetCurrentCulture());
                        var grp = grpCtrl.GetGrpCategoryByRef(categoryData.GroupType);
                        if (grp != null) categoryData.DataRecord.SetXmlProperty("genxml/dropdownlist/ddlparentcatid", grp.categoryid.ToString(""));
                        categoryData.DataRecord.SetXmlProperty("genxml/checkbox/chkishidden", "False"); // don't hide property groups by default
                    }
                    categoryData.ParentItemId = _openid;
                    categoryData.Save();
                    NBrightBuyUtils.RemoveModCachePortalWide(PortalId);

                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "delete":
                    if (Utils.IsNumeric(cArg))
                    {
                        var catid = Convert.ToInt32(cArg);
                        if (catid > 0)
                        {
                            var delCatData = CategoryUtils.GetCategoryData(catid, EditLanguage);
                            if (delCatData.Exists && delCatData.GetDirectChildren().Count == 0) // only delete end leaf
                            {
                                var productidlist = new ArrayList();
                                foreach (var dc in delCatData.GetDirectArticles())
                                {
                                    productidlist.Add(dc.ParentItemId);
                                }

                                var parentCatList = new List<CategoryData>();
                                var loopCat = CategoryUtils.GetCategoryData(catid, EditLanguage);
                                while (loopCat.Exists && loopCat.ParentItemId > 0)
                                {
                                    loopCat = CategoryUtils.GetCategoryData(loopCat.ParentItemId, EditLanguage);
                                    parentCatList.Add(loopCat);
                                }

                                foreach (var pCat in parentCatList)
                                {
                                    foreach (var prodxref in pCat.GetCascadeArticles())
                                    {
                                        if (productidlist.Contains(prodxref.ParentItemId))
                                        {
                                            // delete CATCASCADE record
                                           ModCtrl.Delete(prodxref.ItemID);
                                        }
                                    }

                                }

                                foreach (var dc in delCatData.GetDirectArticles())
                                {
                                    // delete CATXREF record
                                    ModCtrl.Delete(dc.ParentItemId);
                                }
                                // delete CATEGORY record (constrants remove LANG records.)
                                ModCtrl.Delete(catid);
                            }
                            else
                            {
                                NBrightBuyUtils.SetNotfiyMessage(ModuleId, "onlyleafcat", NotifyCode.fail);
                            }
                        }
                    }
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "saveall":
                    SaveAll();
                    NBrightBuyUtils.RemoveModCachePortalWide(PortalId); //clear any cache
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "move":
                    SaveAll();
                    if (Utils.IsNumeric(cArg))
                    {
                        MoveRecord(Convert.ToInt32(cArg));
                    }
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "open":
                    param[1] = "catid=" + cArg;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "close":
                    var catData = CategoryUtils.GetCategoryData(_openid, EditLanguage);
                    if (catData.DataRecord == null)
                        param[1] = "catid=0";
                    else
                        param[1] = "catid=" + catData.DataRecord.ParentItemId.ToString("");
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "save":
                    UpdateRecord();
                    param[1] = "eid=" + cArg;
                   param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "saveexit":
                    UpdateRecord();
                    param[2] = "catid=" + _openid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;

            }
        }
        private string DoSearch(HttpContext context)
        {
            // take all input and created a SQL select with data and save for processing on search list.
                var ajaxInfo = GetAjaxInfo(context, true);
                var tagList = new List<string>();
                var nodList = ajaxInfo.XMLDoc.SelectNodes("genxml/hidden/*");
                foreach (XmlNode nod in nodList)
                {
                    tagList.Add(nod.InnerText);
                }
                var navData = new NavigationData(ajaxInfo.PortalId, ajaxInfo.GetXmlProperty("genxml/hidden/modulekey"));
                navData.Build(ajaxInfo.XMLData,tagList);
                navData.Mode = ajaxInfo.GetXmlProperty("genxml/hidden/navigationmode").ToLower();
                navData.CategoryId = ajaxInfo.GetXmlPropertyInt("genxml/hidden/categoryid");
                if (ajaxInfo.GetXmlProperty("genxml/hidden/pagenumber") != "") navData.PageNumber = ajaxInfo.GetXmlProperty("genxml/hidden/pagenumber");
                if (ajaxInfo.GetXmlProperty("genxml/hidden/pagesize") != "") navData.PageSize = ajaxInfo.GetXmlProperty("genxml/hidden/pagesize");
                if (ajaxInfo.GetXmlProperty("genxml/hidden/pagename") != "") navData.PageName = ajaxInfo.GetXmlProperty("genxml/hidden/pagename");
                if (ajaxInfo.GetXmlProperty("genxml/hidden/pagemoduleid") != "") navData.PageModuleId  = ajaxInfo.GetXmlProperty("genxml/hidden/pagemoduleid");
                navData.SearchFormData = ajaxInfo.XMLData;
                navData.Save();

                return "OK";
        }
        private string DoOrderBy(HttpContext context)
        {
            // take all input and created a SQL select with data and save for processing on search list.
                var ajaxInfo = GetAjaxInfo(context, true);
                var navData = new NavigationData(ajaxInfo.PortalId, ajaxInfo.GetXmlProperty("genxml/hidden/modulekey"));
                navData.OrderByIdx = ajaxInfo.GetXmlProperty("genxml/hidden/orderbyidx");
                navData.OrderBy = " order by " + ajaxInfo.GetXmlProperty("genxml/hidden/orderby" + navData.OrderByIdx);
                navData.Save();

                return "OK";
        }
Example #9
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];
            var navigationData = new NavigationData(PortalId, "OrderAdmin");

            switch (e.CommandName.ToLower())
            {
                case "entrydetail":
                    param[0] = "eid=" + cArg;
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "reorder":
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.CopyToCart(DebugMode);
                    }
                    Response.Redirect(Globals.NavigateURL(StoreSettings.Current.CartTabId, "", param), true);
                    break;
                case "return":
                    param[0] = "";
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.Build(strXml, _templSearch);
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpSearch);
                    navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch);
                    navigationData.Save();
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "downloadinvoice":
                    DownloadInvoice(Convert.ToInt32(cArg));
                    break;
                case "orderby":
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                    navigationData.Save();
                    break;
            }
        }