Esempio n. 1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            product = GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            PageSize = 20;
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("商品咨询") + "</span></a>";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_product_list", "商品列表"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            int          SonCount = B_Lebi_Product.Counts("Supplier_id = " + CurrentSupplier.id + " and Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_id = " + pro.id;
            }
            else
            {
                sql = "Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where b.Supplier_id = " + CurrentSupplier.id + " and " + sql + " and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }

            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel(id);
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "a.Product_id = " + pro.id;
            }
            else
            {
                sql = "a.Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where " + sql + " and (a.Count - a.Count_Shipped)!=0 and b.IsInvalid = 0 and b.IsCompleted = 0 and b.Type_id_OrderType = 211";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }
            //where += " and IsShipped=0";
            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 4
0
        /// <summary>
        /// 侧边栏-浏览历史
        /// </summary>
        public void sidebar_viewhistory()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<div class=\\\"ibar_plugin_content\\\">");
            sb.Append(" <div class=\\\"ibar-history-head\\\"><a href=\\\"javascript:void(0);\\\" onclick=\\\"UserProduct_Del('all',143);\\\">" + Tag("清空") + "</a></div>");
            sb.Append(" <div class=\\\"ibar-moudle-product\\\">");
            foreach (Lebi_User_Product pro in History_Product(10))
            {
                Lebi_Product productmodel = GetProduct(pro.Product_id);
                if (productmodel.id == 0)
                {
                    continue;
                }
                sb.Append("     <div class=\\\"imp_item\\\">");
                sb.Append("         <a href=\\\"" + URL("P_Product", pro.Product_id) + "\\\" class=\\\"pic\\\"><img src=\\\"" + Image(productmodel.ImageOriginal) + "\\\" width=\\\"100\\\" height=\\\"100\\\" /></a>");
                sb.Append("         <p class=\\\"tit\\\"><a href=\\\"" + URL("P_Product", pro.Product_id) + "\\\">" + Lang(productmodel.Name) + "</a></p>");
                sb.Append("         <p class=\\\"price\\\">" + FormatMoney(ProductPrice(productmodel)) + "</p>");
                sb.Append("         <a href=\\\"javascript:void(0);\\\" onclick=\\\"UserProduct_Edit(" + productmodel.id + ",142,1,'','');\\\" class=\\\"imp-addCart\\\">" + Tag("加入购物车") + "</a>");
                sb.Append("     </div>");
            }

            sb.Append(" </div>");
            sb.Append("</div>");


            Response.Write("{\"title\":\"" + Tag("我的足迹") + "\",\"content\":\"" + sb.ToString() + "\"}");
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageSize    = RequestTool.getpageSize(25);
            proid       = RequestTool.RequestInt("proid");
            userlevelid = RequestTool.RequestInt("userlevelid");

            string where = "User_id=0";
            if (proid > 0)
            {
                where += " and Product_id=" + proid;
            }
            if (userlevelid > 0)
            {
                where += " and UserLevel_id=" + userlevelid;
            }
            models = B_Lebi_Product_Limit.GetList(where, "", PageSize, page);

            int recordCount = B_Lebi_Product_Limit.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&userlevelid=" + userlevelid + "&proid=" + proid, page, PageSize, recordCount);
            cuser      = GetUserLevel(userlevelid);
            cproduct   = GetPro(proid);
            if (cuser.id > 0)
            {
                ename = Lang(cuser.Name);
            }
            if (cproduct.id > 0)
            {
                ename = Lang(cproduct.Name);
            }
        }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id         = RequestTool.RequestInt("id", 0);
     pid        = RequestTool.RequestInt("pid", 0);
     randnum    = RequestTool.RequestInt("randnum", 0);
     removelang = RequestTool.RequestString("removelang");
     if (id == 0)
     {
         if (!EX_Admin.Power("product_add", "添加商品"))
         {
             WindowNoPower();
         }
     }
     else
     {
         if (!EX_Admin.Power("product_edit", "编辑商品"))
         {
             WindowNoPower();
         }
     }
     model = B_Lebi_Product.GetModel(id);
     if (model == null)
     {
         Response.Write("参数错误");
         Response.End();
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 下载商品
        /// </summary>
        public void Taobao_Product()
        {
            List <Lebi_Product> ps = Shop.LebiAPI.Service.Instanse.Taobao_Product();

            if (ps == null)
            {
                Response.Write("{\"msg\":\"系统异常\"}");
            }
            else
            {
                List <Lebi_Product> parents = (from m in ps
                                               where m.Product_id == 0
                                               select m).ToList();
                foreach (Lebi_Product p in parents)
                {
                    if (B_Lebi_Product.Counts("taobaoid='" + p.taobaoid + "'") == 0)
                    {
                        int                 pid   = p.id;
                        Lebi_Product        model = DoOneProduct(p);
                        List <Lebi_Product> sons  = (from m in ps
                                                     where m.Product_id == pid
                                                     select m).ToList();
                        foreach (Lebi_Product son in sons)
                        {
                            son.Product_id = model.id;
                            DoOneProduct(son);
                        }
                    }
                }
                Response.Write("{\"msg\":\"OK\"}");
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageSize     = RequestTool.getpageSize(25);
            id           = RequestTool.RequestInt("id");
            userid       = RequestTool.RequestInt("userid");
            string where = "1=1";
            if (id > 0)
            {
                where += " and Product_id=" + id;
            }
            if (userid > 0)
            {
                where += " and User_id=" + userid;
            }
            models = B_Lebi_Product_Price.GetList(where, "", PageSize, page);
            int recordCount = B_Lebi_Product_Price.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&userid=" + userid + "&id=" + id, page, PageSize, recordCount);
            cuser      = GetUser(userid);
            cproduct   = GetPro(id);
            if (cuser.id > 0)
            {
                ename = cuser.UserName;
            }
            if (cproduct.id > 0)
            {
                ename = Lang(cproduct.Name);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 库存变动事件
        /// ProductStockChangeEventHandler
        /// </summary>
        public static void StockChange(Lebi_Product product, int count, int Freeze, string log)
        {
            List <PluginConfig> ps = GetPluginConfig();

            foreach (PluginConfig model in ps)
            {
                foreach (PluginConfig.eventconfig cof in model.EventConfigs)
                {
                    //SystemLog.Add(cof.eventname);
                    if (cof.eventname != "ProductStockChangeEvent")
                    {
                        continue;
                    }
                    try
                    {
                        Type       type       = Type.GetType("" + cof.classname + "," + cof.spacename + "", false, true);
                        MethodInfo methodInfo = type.GetMethod(cof.methodname);
                        methodInfo.Invoke(type, new object[] { product, count, Freeze, log });
                    }
                    catch (Exception ex)
                    {
                        SystemLog.Add(model.Assembly + "对事件" + cof.eventname + "注册失败");
                        SystemLog.Add(ex.ToString());
                        continue;
                    }
                }
            }
        }
Esempio n. 10
0
        public void LoadPage()
        {
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'");
            int id = Rint("id");

            product = GetProduct(id);
            Lebi_Site site = B_Lebi_Site.GetModel("IsMobile=1 order by Sort desc");

            Shop.Bussiness.Site website = new Shop.Bussiness.Site();
            if (site != null)
            {
                if (site.Domain != "")
                {
                    tourl = "http://" + site.Domain + "/product.aspx?id=" + product.id;
                }
                else
                {
                    tourl = "http://" + ShopCache.GetMainSite().Domain + website.WebPath;
                    tourl = tourl.TrimEnd('/') + site.Path;
                    tourl = tourl.TrimEnd('/') + "/product.aspx?id=" + product.id;
                }
            }
            Response.Write(tourl);
            tourl = QRfromGoogle(tourl);
        }
Esempio n. 11
0
 /// <summary>
 /// 检查购物车是否满足代金券使用条件
 /// </summary>
 /// <param name="basket"></param>
 /// <param name="card"></param>
 /// <returns></returns>
 public static bool CheckCard(Basket basket, Lebi_Card card)
 {
     if (card.Time_Begin > System.DateTime.Now)
     {
         return(false);
     }
     if (card.Time_End <= System.DateTime.Now)
     {
         card.Type_id_CardStatus = 204;
         B_Lebi_Card.Update(card);
         return(false);
     }
     if ((basket.Money_Product - basket.Money_Cut) < card.Money_Buy)
     {
         return(false);
     }
     if (card.Pro_Type_ids == "")
     {
         return(true);
     }
     foreach (Lebi_User_Product p in basket.Products)
     {
         Lebi_Product  pro  = B_Lebi_Product.GetModel(p.Product_id);
         Lebi_Pro_Type type = EX_Product.TopProductType(pro);
         if (("," + card.Pro_Type_ids + ",").Contains("," + type.id + ","))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id      = RequestTool.RequestInt("id", 0);
            randnum = RequestTool.RequestInt("randnum", 0);
            if (id == 0)
            {
                if (!EX_Admin.Power("product_add", "添加商品"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("product_edit", "编辑商品"))
                {
                    WindowNoPower();
                }
            }
            ids   = RequestTool.RequestString("ids");
            model = B_Lebi_Product.GetModel(id);
            if (ids != "")
            {
                List <Lebi_Product> models = B_Lebi_Product.GetList("id in (lbsql{" + ids + "})", "");
                //if (models.Count == 1)
                model = models.FirstOrDefault();
            }

            if (model == null)
            {
                model = new Lebi_Product();
                //Response.Write("参数错误");
                //Response.End();
            }
        }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    orderid = RequestTool.RequestInt("orderid", 0);
            int    id      = RequestTool.RequestInt("id", 0);
            string pnumber = RequestTool.RequestString("pnumber").Trim();

            order        = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + orderid);
            orderproduct = B_Lebi_Order_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (orderproduct == null)
            {
                product      = B_Lebi_Product.GetModel("Number=lbsql{'" + pnumber + "'} order by id desc");
                orderproduct = new Lebi_Order_Product();
            }
            else
            {
                product = B_Lebi_Product.GetModel(orderproduct.Product_id);
            }
            if (order == null || product == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            //int pid = product.Product_id == 0 ? product.id : product.Product_id;
            if (product.Product_id > 0)
            {
                models = B_Lebi_Product.GetList("Product_id=" + product.Product_id + "", "");
            }
            else
            {
                models = new List <Lebi_Product>();
                models.Add(product);
            }
        }
Esempio n. 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tid = RequestTool.RequestInt("tid", 0);
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Product.GetModel(pid);
            if (model == null)
            {
                model = new Lebi_Product();
            }
            //Lebi_ProPerty_Type ptype = B_Lebi_ProPerty_Type.GetModel(tid);
            string property = EX_Product.ProductType_ProPertystr(tid, model.Supplier_id);

            if (property != "")
            {
                pros = B_Lebi_ProPerty.GetList("Type_id_ProPertyType in (132,133) and id in (" + property + ")", "Sort desc");
            }
            if (pros == null)
            {
                pros = new List <Lebi_ProPerty>();
            }
            ProPerty133 = Common.KeyValueToList(model.ProPerty133);
            if (tid == 0)
            {
                tid = model.Pro_Type_id;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 邮件分享朋友
        /// </summary>
        public void SendFriend()
        {
            int          id           = RequestTool.RequestInt("id", 0);
            string       FromUserName = RequestTool.RequestSafeString("UserName");
            string       FromEmail    = RequestTool.RequestSafeString("Email");
            string       Content      = RequestTool.RequestSafeString("Content");
            string       ToUserName   = RequestTool.RequestSafeString("ToUserName");
            string       ToEmail      = RequestTool.RequestSafeString("ToEmail");
            Lebi_Product product      = B_Lebi_Product.GetModel(id);

            if (product == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            //发送邮件
            try
            {
                if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("sendfriend"))
                {
                    Email.SendEmail_sendfriend(FromUserName + "|" + FromEmail, ToUserName + "|" + ToEmail, Content, product, CurrentLanguage.Code);
                }
            }
            catch (Exception ex)
            {
                Response.Write("{\"msg\":\"" + ex.Message + "\"}");
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 16
0
        /// <summary>
        /// 侧边栏-收藏夹
        /// </summary>
        public void sidebar_userlike()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<div class=\\\"ibar_plugin_content\\\">");
            //sb.Append(" <div class=\\\"ibar-history-head\\\">共3件产品<a href=\\\"#\\\">清空</a></div>");
            sb.Append(" <div class=\\\"ibar-moudle-product\\\">");
            List <Lebi_User_Product> pros = B_Lebi_User_Product.GetList("User_id=" + CurrentUser.id + " and Type_id_UserProductType=141", "id desc", 10, 1);

            foreach (Lebi_User_Product pro in pros)
            {
                Lebi_Product productmodel = GetProduct(pro.Product_id);
                if (productmodel.id == 0)
                {
                    continue;
                }
                sb.Append("     <div class=\\\"imp_item\\\">");
                sb.Append("         <a href=\\\"" + URL("P_Proudct", pro.Product_id) + "\\\" class=\\\"pic\\\"><img src=\\\"" + Image(productmodel.ImageOriginal) + "\\\" width=\\\"100\\\" height=\\\"100\\\" /></a>");
                sb.Append("         <p class=\\\"tit\\\"><a href=\\\"" + URL("P_Proudct", pro.Product_id) + "\\\">" + Lang(productmodel.Name) + "</a></p>");
                sb.Append("         <p class=\\\"price\\\">" + FormatMoney(ProductPrice(productmodel)) + "</p>");
                sb.Append("         <a href=\\\"javascript:void(0);\\\" onclick=\\\"UserProduct_Edit(" + productmodel.id + ",142,1,'','');\\\" class=\\\"imp-addCart\\\">" + Tag("加入购物车") + "</a>");
                sb.Append("     </div>");
            }

            sb.Append(" </div>");
            sb.Append("</div>");


            Response.Write("{\"title\":\"" + Tag("我的收藏") + "\",\"content\":\"" + sb.ToString() + "\"}");
        }
Esempio n. 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = RequestTool.RequestInt("id", 0);
     if (id == 0)
     {
         if (!Power("supplier_product_add", "添加商品"))
         {
             PageReturnMsg = PageNoPowerMsg();
         }
         addflag = true;
     }
     else
     {
         if (!Power("supplier_product_edit", "编辑商品"))
         {
             PageReturnMsg = PageNoPowerMsg();
         }
     }
     action = RequestTool.RequestInt("action", 1);
     model  = B_Lebi_Product.GetModel("(IsDel!=1 or IsDel is null) and Supplier_id = " + CurrentSupplier.id + " and id = " + id + "");
     if (model == null)
     {
         model = new Lebi_Product();
         Lebi_Product modellast = B_Lebi_Product.GetModel("(IsDel!=1 or IsDel is null) and Supplier_id = " + CurrentSupplier.id + " order by Time_Edit desc,id desc");
         if (modellast != null)
         {
             model.Pro_Type_id = modellast.Pro_Type_id;
         }
     }
     if (model.Images != "")
     {
         if (model.Images.Substring(model.Images.Length - 1, 1) == "@")
         {
             model.Images = model.Images.Substring(0, model.Images.Length - 1);
         }
         if (model.Images.Substring(0, 1) != "@")
         {
             model.Images = "@" + model.Images;
         }
     }
     wap        = Ishavewap();
     StepPrices = EX_Product.StepPrice(model.StepPrice);
     if (StepPrices == null)
     {
         StepPrices = new List <ProductStepPrice>();
     }
     UserLevelPrices = EX_Product.UserLevelPrice(model.UserLevelPrice);
     if (UserLevelPrices == null)
     {
         UserLevelPrices = new List <ProductUserLevelPrice>();
     }
     UserLevelCounts = EX_Product.UserLevelCount(model.UserLevelCount);
     if (UserLevelCounts == null)
     {
         UserLevelCounts = new List <ProductUserLevelCount>();
     }
     userlevels = B_Lebi_UserLevel.GetList("", "Grade asc");
 }
Esempio n. 18
0
        /// <summary>
        /// 商品价格
        /// </summary>
        public void ProducePrice()
        {
            int          id      = RequestTool.RequestInt("id");
            int          count   = RequestTool.RequestInt("count", 1);
            Lebi_Product product = GetProduct(id);
            decimal      price   = EX_Product.ProductPrice(product, CurrentUserLevel, CurrentUser, count);

            Response.Write(FormatMoney(price));
        }
Esempio n. 19
0
        public Lebi_Product GetProduct(string id)
        {
            Lebi_Product model = B_Lebi_Product.GetModel(int.Parse(id));

            if (model == null)
            {
                model = new Lebi_Product();
            }
            return(model);
        }
Esempio n. 20
0
        public Lebi_Product GetPro(int id)
        {
            Lebi_Product pro = B_Lebi_Product.GetModel(id);

            if (pro == null)
            {
                return(new Lebi_Product());
            }
            return(pro);
        }
Esempio n. 21
0
        public Lebi_Product GetProduct(int id)
        {
            Lebi_Product model = B_Lebi_Product.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Product();
            }
            return(model);
        }
Esempio n. 22
0
        /// <summary>
        /// 晒单评论
        /// </summary>
        public void Comment_reply()
        {
            int          id         = RequestTool.RequestInt("id", 0);
            int          Product_id = 0;
            Lebi_Product product    = B_Lebi_Product.GetModel(id);

            if (product != null)
            {
                Product_id = product.Product_id;
            }
            Lebi_Comment pmodel = B_Lebi_Comment.GetModel(id);

            if (pmodel == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            string Content = RequestTool.RequestSafeString("comment");

            if (Content == "")
            {
                Response.Write("{\"msg\":\"" + Tag("内容不能为空") + "\"}");
                return;
            }
            Lebi_Comment model = new Lebi_Comment();

            model.TableName = "Product";
            model.Keyid     = id;
            //model.Admin_UserName = CurrentUser.NickName;
            model.Admin_id      = 0;
            model.User_id       = CurrentUser.id;
            model.User_UserName = CurrentUser.NickName;
            model.Content       = Content;
            model.Parentid      = id;
            model.Status        = 280;
            model.Time_Add      = System.DateTime.Now;
            model.Language_Code = CurrentLanguage.Code;
            model.Product_id    = Product_id;
            model.IsRead        = 0;
            model.Supplier_id   = product.Supplier_id;
            if (!Comment.CheckSafeWord(model.Content))
            {
                Response.Write("{\"msg\":\"" + Tag("内容中包含敏感词") + "\"}");
                return;
            }
            B_Lebi_Comment.Add(model);
            //发送邮件
            if (ShopCache.GetBaseConfig().AdminMailSign.ToLower().Contains("comment"))
            {
                Lebi_User user = B_Lebi_User.GetModel(CurrentUser.id);
                Email.SendEmail_comment(user, model);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Random Random = new Random();

            randnum = RequestTool.RequestInt("randnum", 0);
            id      = RequestTool.RequestInt("id", 0);
            if (id == 0 || (id > 0 && randnum > 0))
            {
                if (!EX_Admin.Power("product_add", "添加商品"))
                {
                    PageNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("product_edit", "编辑商品"))
                {
                    PageNoPower();
                }
            }
            action = RequestTool.RequestInt("action", 1);
            model  = B_Lebi_Product.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Product();
                model.Type_id_ProductType = 320;
            }
            wap = Ishavewap();

            StepPrices = EX_Product.StepPrice(model.StepPrice);
            if (StepPrices == null)
            {
                StepPrices = new List <ProductStepPrice>();
            }
            UserLevelPrices = EX_Product.UserLevelPrice(model.UserLevelPrice);
            if (UserLevelPrices == null)
            {
                UserLevelPrices = new List <ProductUserLevelPrice>();
            }
            UserLevelCounts = EX_Product.UserLevelCount(model.UserLevelCount);
            if (UserLevelCounts == null)
            {
                UserLevelCounts = new List <ProductUserLevelCount>();
            }
            userlevels = B_Lebi_UserLevel.GetList("", "Grade asc");
            if (model.IsCombo == 1)
            {
                comboProducts = B_Lebi_Product_Combo.GetList("Product_id=" + model.id + "", "");
            }
            else
            {
                comboProducts = new List <Lebi_Product_Combo>();
            }
        }
Esempio n. 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     userlevelid = RequestTool.RequestInt("userlevelid");
     key         = RequestTool.RequestString("key");
     productid   = RequestTool.RequestInt("productid");
     product     = B_Lebi_Product.GetModel(productid);
     if (product == null)
     {
         product = new Lebi_Product();
     }
 }
Esempio n. 25
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     LoadTheme(themecode, siteid, languagecode, pcode);
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_SendFriend'");
     id          = Rint_Para("0");
     product     = GetProduct(id);
     if (product.id == 0)
     {
         Response.Redirect(URL("P_404", ""));
         Response.End();
     }
     path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag("邮件分享") + "</span></a>";
 }
Esempio n. 26
0
        /// <summary>
        /// 商品咨询
        /// </summary>
        /// <param name="user"></param>
        /// <param name="model"></param>
        public static void SendSMS_ask(Lebi_User user, Lebi_Comment model)
        {
            BaseConfig conf          = ShopCache.GetBaseConfig();
            int        IsAdminSms    = 0;
            int        IsSupplierSms = 0;

            if (conf.SMS_sendmode.Contains("SMSTPL_ask"))
            {
                IsAdminSms = 1;
            }
            Lebi_Product product = B_Lebi_Product.GetModel(model.Product_id);

            if (product == null)
            {
                product = new Lebi_Product();
            }
            if (product.Supplier_id > 0)
            {
                Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(product.Supplier_id);
                if (supplier.IsSupplierTransport == 0)  //商家发货
                {
                    if (ShopCache.GetBaseConfig_Supplier(product.Supplier_id).SMS_sendmode.Contains("SMSTPL_ask"))
                    {
                        IsSupplierSms = 1;
                    }
                }
            }
            if (IsAdminSms == 0 && IsSupplierSms == 0)
            {
                return;
            }
            if (user.Language == "")
            {
                user.Language = Language.Languages().FirstOrDefault().Code;
            }
            string list          = "" + Language.Tag("商品名称", user.Language) + ":" + Language.Content(product.Name, user.Language) + ";" + Language.Tag("内容", user.Language) + ":" + model.Content + ";";
            string Admin_content = Language.Content(conf.SMSTPL_Admin_ask, user.Language);

            Admin_content = ReplaceSMSTag(Admin_content, user, conf);
            Admin_content = Admin_content.Replace("{$Content}", list);
            if (IsAdminSms == 1)
            {
                Send(conf.SMS_reciveno, Admin_content);
            }
            if (IsSupplierSms == 1)
            {
                BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(product.Supplier_id);
                Send(config_supplier.SMS_reciveno, Admin_content);
            }
        }
Esempio n. 27
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            comment = B_Lebi_Comment.GetModel(id);
            if (comment.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            product      = GetProduct(comment.Keyid);
            string where = "Parentid =" + id;
            comments     = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString  = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id, pageindex, PageSize, recordCount, CurrentLanguage);
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("晒单") + "</span></a>";
            //path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";

            smalls = comment.ImagesSmall.Split('@');
            bigs   = comment.Images.Split('@');
            if (bigs.Count() > 1)
            {
                DefaultImage = bigs[1];
            }

            productcomments = B_Lebi_Comment.GetList("TableName='Product' and Keyid=" + comment.Keyid + " and id!=" + comment.id + "", "id desc", 5, 1);
        }
Esempio n. 28
0
        /// <summary>
        /// 收藏夹批量添加购物车
        /// </summary>
        public void LikeToBasket()
        {
            string ids = RequestTool.RequestSafeString("id");
            string mes = "";

            if (ids == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请先选择商品") + "\"}");
                return;
            }
            else
            {
                List <Lebi_User_Product> models = B_Lebi_User_Product.GetList("(Type_id_UserProductType=141 or Type_id_UserProductType=144) and User_id=" + CurrentUser.id + " and id in (lbsql{" + ids + "})", "");
                foreach (Lebi_User_Product model in models)
                {
                    //<-{ 判断收藏夹商品是否为上架状态 by lebi.kingdge 2015-02-10
                    Lebi_Product Product = B_Lebi_Product.GetModel("id = " + model.Product_id + " and Type_id_ProductStatus = 101");
                    if (Product == null)
                    {
                        Response.Write("{\"msg\":\"" + Lang(Product.Name) + " " + Tag("该商品已经下架") + "\"}");
                        return;
                    }
                    //}->
                    int num        = model.count;
                    int levelcount = ProductLevelCount(Product);
                    if (num < levelcount)
                    {
                        num = levelcount;
                    }
                    Lebi_User_Product updatemodel = B_Lebi_User_Product.GetModel("User_id=" + CurrentUser.id + " and product_id=" + model.Product_id + " and type_id_UserProductType=142");
                    if (updatemodel != null)
                    {
                        if (updatemodel.count < num)
                        {
                            updatemodel.count = model.count;
                            B_Lebi_User_Product.Update(updatemodel);
                        }
                    }
                    else
                    {
                        model.Type_id_UserProductType = 142;
                        model.count = num;
                        B_Lebi_User_Product.Add(model);
                    }
                }
                mes = Tag("商品已加入购物车") + "<div>" + Tag("数量") + " <span>" + Basket_Product_Count() + "</span> " + Tag("件") + " <span>" + FormatMoney(Basket_Product_Price()) + "</span></div><div><a href='" + URL("P_Basket", "") + "' class='btn btn-7'><s></s>" + Tag("查看购物车") + "</a>&nbsp;&nbsp;<a href='javascript:void(0)' onclick='cloesedialog();' class='btn btn-11'><s></s>" + Tag("关闭") + "</a></div>";
            }
            Response.Write("{\"msg\":\"OK\",\"count\":\"" + Basket_Product_Count() + "\",\"amount\":\"" + FormatMoney(Basket_Product_Price()) + "\",\"mes\":\"" + mes + "\",\"url\":\"" + URL("P_AddToBasket", "") + "\"}");
        }
Esempio n. 29
0
        /// <summary>
        /// 购物车商品总价格
        /// </summary>
        /// <returns></returns>
        public decimal Basket_Product_Price()
        {
            decimal price = 0;
            List <Lebi_User_Product> models = Basket_Product();

            foreach (Lebi_User_Product model in models)
            {
                Lebi_Product pro = B_Lebi_Product.GetModel(model.Product_id);
                if (pro != null)
                {
                    price = price + pro.Price;
                }
            }
            return(price);
        }
Esempio n. 30
0
        public void LoadPage()
        {
            int PageSize = RequestTool.RequestInt("pagesize", 10);

            pageindex    = RequestTool.RequestInt("page", 1);
            id           = RequestTool.RequestInt("id", 0);
            product_id   = RequestTool.RequestInt("product_id", 0);
            string where = "Parentid = 0 and TableName = 'Product' and (Keyid = " + id + "";
            if (product_id != 0)
            {
                where += " or Product_id = " + product_id + "";
            }
            where += ") and (Status = 281 or User_id = " + CurrentUser.id + ")";
            models = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id + "#tab", pageindex, PageSize, recordCount, CurrentLanguage);
            model      = GetProduct(id);
            //获取星级评分人数
            string Starwhere = "Parentid = 0 and TableName = 'Product' and (Keyid = " + id + "";

            if (product_id != 0)
            {
                Starwhere += " or Product_id = " + product_id + "";
            }
            Starwhere += ")";
            Star5Count = B_Lebi_Comment.Counts(Starwhere + " and Star = 5");
            Star4Count = B_Lebi_Comment.Counts(Starwhere + " and Star = 4");
            Star3Count = B_Lebi_Comment.Counts(Starwhere + " and Star = 3");
            Star2Count = B_Lebi_Comment.Counts(Starwhere + " and Star = 2");
            Star1Count = B_Lebi_Comment.Counts(Starwhere + " and Star = 1");
            if (model.Count_Comment == 0)
            {
                Star5Percent = 0;
                Star4Percent = 0;
                Star3Percent = 0;
                Star2Percent = 0;
                Star1Percent = 0;
            }
            else
            {
                Star5Percent = Star5Count / model.Count_Comment * 100;
                Star4Percent = Star4Count / model.Count_Comment * 100;
                Star3Percent = Star3Count / model.Count_Comment * 100;
                Star2Percent = Star2Count / model.Count_Comment * 100;
                Star1Percent = Star1Count / model.Count_Comment * 100;
            }
        }