Example #1
0
        /// <summary>
        /// 编辑桌面菜单
        /// </summary>
        public void SaveIndexMenu()
        {
            if (!Power("supplier_menu_edit", "编辑分组菜单"))
            {
                AjaxNoPower();
                return;
            }
            int id = RequestTool.RequestInt("gid", 0);
            Lebi_Supplier_UserGroup group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id);

            if (group == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (group.Supplier_id != CurrentSupplier.id)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            group.Menu_ids_index = RequestTool.RequestSafeString("id");
            B_Lebi_Supplier_UserGroup.Update(group);
            Log.Add("编辑分组桌面菜单", "Supplier_User", id.ToString(), CurrentSupplier, "用户:" + CurrentUser.UserName);
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #2
0
        /// <summary>
        /// 删除会员分组
        /// </summary>
        public void Group_Del()
        {
            string id = RequestTool.RequestSafeString("id");

            if (!Power("supplier_group_del", "删除用户分组"))
            {
                AjaxNoPower();
                return;
            }
            if (id != "")
            {
                List <Lebi_Supplier_UserGroup> models = B_Lebi_Supplier_UserGroup.GetList("Supplier_id=" + CurrentSupplier.id + " and id in (lbsql{" + id + "})", "");
                foreach (Lebi_Supplier_UserGroup model in models)
                {
                    int Level_id = 1;
                    Lebi_Supplier_UserGroup tmodel = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and Sort>" + model.Sort + " order by Sort asc");
                    if (tmodel == null)
                    {
                        Level_id = 0;
                    }
                    else
                    {
                        Level_id = tmodel.id;
                    }
                    Common.ExecuteSql("Update Lebi_Supplier_User set Supplier_UserGroup_id = " + Level_id + " where Supplier_UserGroup_id = " + model.id + "");
                    B_Lebi_Supplier_UserGroup.Delete(model.id);
                }
                Log.Add("删除用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, id.ToString());
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #3
0
        public string GetGroupName(int id)
        {
            Lebi_Supplier_UserGroup model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id = " + id);

            if (model == null)
            {
                return(Tag("未分组"));
            }
            return(model.Name);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (!Power("supplier_group_edit", "编辑用户分组"))
            {
                AjaxNoPower();
            }
            model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (model == null)
            {
                model = new Lebi_Supplier_UserGroup();
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_menu_edit", "编辑分组菜单"))
            {
                AjaxNoPower();
                return;
            }
            models = GetMenu(0);
            int id = RequestTool.RequestInt("id", 0);

            group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (group == null)
            {
                PageError();
            }
            ids = "," + group.Menu_ids + ",";
        }
Example #6
0
        /// <summary>
        /// 编辑分组权限
        /// </summary>
        public void SavePower()
        {
            if (!Power("supplier_power_edit", "编辑分组权限"))
            {
                AjaxNoPower();
                return;
            }
            int id = RequestTool.RequestInt("gid", 0);
            Lebi_Supplier_UserGroup group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id);

            if (group == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (group.Supplier_id != CurrentSupplier.id)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            group.Limit_ids = RequestTool.RequestSafeString("id");
            string codes = "";

            if (group.Limit_ids != "")
            {
                List <Lebi_Supplier_Limit> models = B_Lebi_Supplier_Limit.GetList("id in (" + group.Limit_ids + ")", "");
                foreach (Lebi_Supplier_Limit model in models)
                {
                    if (codes == "")
                    {
                        codes = "'" + model.Code + "'";
                    }
                    else
                    {
                        codes += "," + "'" + model.Code + "'";
                    }
                }
            }
            group.Limit_Codes = codes;
            B_Lebi_Supplier_UserGroup.Update(group);
            Log.Add("编辑分组桌面菜单", "Supplier_User", id.ToString(), CurrentSupplier, "用户:" + CurrentUser.UserName);
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #7
0
        /// <summary>
        /// 编辑等级分组
        /// </summary>
        public void Group_Edit()
        {
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Supplier_UserGroup model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id);

            if (model == null)
            {
                model = new Lebi_Supplier_UserGroup();
            }
            B_Lebi_Supplier_UserGroup.SafeBindForm(model);
            model.Supplier_id = CurrentSupplier.id;

            if (model.id == 0)
            {
                if (!Power("supplier_group_add", "添加用户分组"))
                {
                    AjaxNoPower();
                    return;
                }
                model.User_id_Add = CurrentUser.id;
                B_Lebi_Supplier_UserGroup.Add(model);
                id = B_Lebi_Supplier_UserGroup.GetMaxId();
                Log.Add("添加用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            else
            {
                if (!Power("supplier_group_edit", "编辑用户分组"))
                {
                    AjaxNoPower();
                    return;
                }
                model.User_id_Edit = CurrentUser.id;
                model.Time_Edit    = System.DateTime.Now;
                B_Lebi_Supplier_UserGroup.Update(model);
                Log.Add("编辑用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_power_edit", "编辑分组权限"))
            {
                AjaxNoPower();
                return;
            }
            models = GetLimit(0);
            int id = RequestTool.RequestInt("id", 0);

            group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (group == null)
            {
                PageError();
            }
            ps            = B_Lebi_Supplier_Power.GetList("Supplier_Group_id=" + group.id + " and Url=''", "");
            defaultparent = B_Lebi_Supplier_Limit.GetModel("Code='default'");
            if (defaultparent != null)
            {
                count = B_Lebi_Supplier_Limit.Counts("parentid = " + defaultparent.id + ""); //未分组
            }
        }
Example #9
0
        protected override void OnLoad(EventArgs e)
        {
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_gongyingshang"))
            {
                Response.Redirect(WebPath + "/");
                Response.End();
                return;
            }
            PageLoadCheck(); //页面载入检查
            #region 当前用户信息
            int selectsupplierid = RequestTool.RequestInt("selectsupplierid");
            if (selectsupplierid > 0)
            {
                //切换超级账号
                string msg = "";
                EX_Supplier.Login(CurrentUser, "", selectsupplierid, out msg);
                CurrentSupplierUser = B_Lebi_Supplier_User.GetModel("User_id = " + CurrentUser.id + " and Supplier_id=" + selectsupplierid + " and Type_id_SupplierUserStatus=9011");
            }
            if (CurrentSupplierUser == null)
            {
                CurrentSupplierUser = EX_Supplier.CurrentSupplierUser(CurrentUser);
            }

            if (CurrentSupplierUser.id == 0)
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }
            CurrentSupplier = B_Lebi_Supplier.GetModel(CurrentSupplierUser.Supplier_id);
            if (CurrentSupplier.Type_id_SupplierStatus != 442)
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }
            CurrentSupplierUserGroup = B_Lebi_Supplier_UserGroup.GetModel(CurrentSupplierUser.Supplier_UserGroup_id);
            if (CurrentSupplierUserGroup == null)
            {
                CurrentSupplierUserGroup = new Lebi_Supplier_UserGroup();
            }
            if (CurrentSupplier != null)
            {
                CurrentSupplierGroup = B_Lebi_Supplier_Group.GetModel(CurrentSupplier.Supplier_Group_id);

                if (CurrentSupplierGroup == null)
                {
                    CurrentSupplierGroup = new Lebi_Supplier_Group();
                }
            }
            else
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }
            DateTime LastDate      = CurrentSupplier.Time_This;
            TimeSpan ts            = System.DateTime.Now - LastDate;
            int      NewEventTimes = 0;
            int.TryParse(SYS.NewEventTimes, out NewEventTimes);
            LeftNewEventTimes = Convert.ToInt32(ts.TotalSeconds % (NewEventTimes / 1000));
            LeftNewEventTimes = NewEventTimes - (LeftNewEventTimes * 1000);
            #endregion

            #region 配合前台主题
            string themecode = "";
            int    siteid    = 0;
            var    nv        = CookieTool.GetCookie("ThemeStatus");
            if (!string.IsNullOrEmpty(nv.Get("theme")))
            {
                themecode = nv.Get("theme");
            }
            if (!string.IsNullOrEmpty(nv.Get("site")))
            {
                int.TryParse(nv.Get("site"), out siteid);
            }
            if (siteid == 0)
            {
                siteid = ShopCache.GetMainSite().id;
            }
            LoadTheme(themecode, siteid, CurrentLanguage.Code, "", true);
            #endregion

            #region 处理菜单
            MenuType = Shop.Tools.CookieTool.GetCookieString("Menu");
            if (MenuType == "")
            {
                MenuType = "Index";
            }

            string menu_ids = "";
            if (CurrentSupplierUserGroup != null && CurrentSupplierUser.User_id != CurrentSupplier.User_id)
            {
                menu_ids = CurrentSupplierUserGroup.Menu_ids;
            }
            else
            {
                CurrentSupplierGroup = B_Lebi_Supplier_Group.GetModel(CurrentSupplier.Supplier_Group_id);
                if (CurrentSupplierGroup != null)
                {
                    menu_ids = CurrentSupplierGroup.Menu_ids;
                }
            }
            //lebi菜单
            if (!Shop.LebiAPI.Service.Instanse.Check("managelicenese"))
            {
                lbmenu = "<ul class=\"tool\"><li><span><a href=\"" + site.AdminPath + "/?desk=1\">" + Tag("桌面") + "</a></span></li></ul>";
                string license = "Copyright 2003-" + DateTime.Now.Year + " <a href=\"http://www.lebi.cn/\" target=\"_blank\" class=\"footcopy\">Lebi.cn</a> , All Rights Reserved. Powered by <a href=\"http://www.lebi.cn/support/license/?url=" + Request.ServerVariables["SERVER_NAME"] + "\" target=\"_blank\" title=\"LebiShop\" class=\"footcopy\">LebiShop</a> V<a href=\"" + site.AdminPath + "/config/version.aspx\">" + SYS.Version + "." + SYS.Version_Son + "</a>";
                try
                {
                    Label LBLicense = (Label)this.Page.FindControl("LBLicense");
                    LBLicense.Text = license;
                }
                catch
                {
                    string strscript = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><script language='javascript'>";
                    strscript += "document.onreadystatechange = loadlicense;";
                    strscript += "function loadlicense(){";
                    strscript += "if(document.readyState == \"complete\"){";
                    strscript += "if ($(\"#lebicopy\")[0] == undefined) {alert('页面布局异常')}";
                    strscript += "$('#lebicopy').html('" + license + "')";
                    strscript += "}}</script>";
                    Response.Write(strscript);
                }
            }
            else
            {
                lbmenu = "<ul class=\"tool\"><li><span><a href=\"" + site.AdminPath + "/?desk=1\">" + Tag("桌面") + "</a></ul>";
            }
            //处理菜单
            desk     = RequestTool.RequestInt("desk", 0);
            AllMenus = new List <Lebi_Supplier_Menu>();
            List <Lebi_Supplier_Menu> All = B_Lebi_Supplier_Menu.GetList("Isshow=1", "Sort desc");
            string currentgroupmenu       = "," + menu_ids + ",";
            foreach (Lebi_Supplier_Menu m in All)
            {
                if (currentgroupmenu.Contains("," + m.id + ","))
                {
                    AllMenus.Add(m);
                }
            }
            TopMenus = (from m in AllMenus
                        where m.parentid == 0
                        select m).ToList();
            if (desk != 1)
            {
                try
                {
                    var temp = from m in AllMenus
                               where reqPage.Contains(m.URL.ToLower()) && m.parentid > 0 && m.URL != ""
                               select m;
                    //if (temp == null)
                    //    CurrentLeftMenu = new Lebi_Menu();
                    //else
                    //{
                    CurrentLeftMenu = temp.ToList().FirstOrDefault();
                    CurrentTopMenu  = (from m in AllMenus
                                       where m.id == CurrentLeftMenu.parentid
                                       select m).ToList().FirstOrDefault();
                    CurrentTopMenu = (from m in TopMenus
                                      where m.id == CurrentTopMenu.parentid
                                      select m).ToList().FirstOrDefault();
                    ////写入cookie
                    NameValueCollection nvs = new NameValueCollection();
                    nvs.Add("top", CurrentTopMenu.id.ToString());
                    nvs.Add("left", CurrentLeftMenu.id.ToString());
                    CookieTool.WriteCookie("sMenu", nvs, 365);
                    //}
                }
                catch (NullReferenceException)
                {
                    var menu = CookieTool.GetCookie("sMenu");
                    int tid  = 0;
                    int lid  = 0;
                    int.TryParse(menu.Get("top"), out tid);
                    int.TryParse(menu.Get("left"), out lid);
                    CurrentTopMenu = (from m in TopMenus
                                      where m.id == tid
                                      select m).ToList().FirstOrDefault();
                    CurrentLeftMenu = (from m in AllMenus
                                       where m.id == lid
                                       select m).ToList().FirstOrDefault();
                }
            }
            else
            {
                //写入cookie
                NameValueCollection nvs = new NameValueCollection();
                nvs.Add("top", "0");
                nvs.Add("left", "0");
                CookieTool.WriteCookie("sMenu", nvs, 365);
            }
            if (CurrentTopMenu == null)
            {
                CurrentTopMenu = new Lebi_Supplier_Menu();
                desk           = 1;
            }
            #endregion
            Suppliers = GetSuppliers();


            base.OnLoad(e);
        }
Example #10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_Supplier_UserGroup model)
 {
     D_Lebi_Supplier_UserGroup.Instance.Update(model);
 }
Example #11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_Supplier_UserGroup model)
 {
     return(D_Lebi_Supplier_UserGroup.Instance.Add(model));
 }
Example #12
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_Supplier_UserGroup SafeBindForm(Lebi_Supplier_UserGroup model)
 {
     return(D_Lebi_Supplier_UserGroup.Instance.SafeBindForm(model));
 }
Example #13
0
        protected override void OnLoad(EventArgs e)
        {
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_gongyingshang"))
            {
                Response.Write("");
                Response.End();
                return;
            }
            PageLoadCheck(); //页面载入检查

            #region 当前用户信息
            int selectsupplierid = RequestTool.RequestInt("selectsupplierid");
            if (selectsupplierid > 0)
            {
                //切换超级账号
                string msg = "";
                EX_Supplier.Login(CurrentUser, "", selectsupplierid, out msg);
                CurrentSupplierUser = B_Lebi_Supplier_User.GetModel("User_id = " + CurrentUser.id + " and Supplier_id=" + selectsupplierid + " and Type_id_SupplierUserStatus=9011");
            }
            if (CurrentSupplierUser == null)
            {
                CurrentSupplierUser = EX_Supplier.CurrentSupplierUser(CurrentUser);
            }

            if (CurrentSupplierUser.id == 0)
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }


            CurrentSupplier = B_Lebi_Supplier.GetModel(CurrentSupplierUser.Supplier_id);
            if (CurrentSupplier.Type_id_SupplierStatus != 442)
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }
            CurrentSupplierUserGroup = B_Lebi_Supplier_UserGroup.GetModel(CurrentSupplierUser.Supplier_UserGroup_id);
            if (CurrentSupplierUserGroup == null)
            {
                CurrentSupplierUserGroup = new Lebi_Supplier_UserGroup();
            }
            if (CurrentSupplier != null)
            {
                CurrentSupplierGroup = B_Lebi_Supplier_Group.GetModel(CurrentSupplier.Supplier_Group_id);

                if (CurrentSupplierGroup == null)
                {
                    CurrentSupplierGroup = new Lebi_Supplier_Group();
                }
            }
            else
            {
                Response.Redirect(Shop.Bussiness.Site.Instance.SupplierPath + "/Login.aspx");
                return;
            }
            #endregion

            #region 配合前台主题
            string themecode = "";
            int    siteid    = 0;
            var    nv        = CookieTool.GetCookie("ThemeStatus");
            if (!string.IsNullOrEmpty(nv.Get("theme")))
            {
                themecode = nv.Get("theme");
            }
            if (!string.IsNullOrEmpty(nv.Get("theme")))
            {
                int.TryParse(nv.Get("site"), out siteid);
            }
            if (siteid == 0)
            {
                siteid = ShopCache.GetMainSite().id;
            }
            LoadTheme(themecode, siteid, CurrentLanguage.Code, "", true);
            #endregion

            Suppliers = GetSuppliers();
            base.OnLoad(e);
        }