protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            config = ShopCache.GetBaseConfig();
            pros   = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            comms  = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc");
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            string where = "id = " + torder.Order_id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            order = B_Lebi_Order.GetModel(where);
            if (order == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }

            pros            = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            transport_order = B_Lebi_Transport_Order.GetModel("Order_id = " + id);
            if (transport_order == null)
            {
                transport_order = new Lebi_Transport_Order();
            }
        }
Exemple #4
0
        protected string billstatus = "";//发票状态
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            if (domain3admin && CurrentAdmin.Site_ids != "")
            {
                if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ","))
                {
                    PageError();
                    return;
                }
            }
            oldmodel = B_Lebi_Order.GetModel(model.Order_id);
            if (oldmodel == null)
            {
                oldmodel = new Lebi_Order();
            }
            //if (model.Type_id_OrderType == 212)
            //    str = "- ";
            //if (model.Type_id_OrderType == 212)
            //    Response.Redirect("Torder_view.aspx?id=" + id);
            pros    = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            Logs    = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc");
            torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc");
            comms   = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc");
            langs   = Language.Languages();
            Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + "");

            if (bill == null)
            {
                billstatus = Tag("不开发票");
            }
            else
            {
                billstatus = EX_Type.TypeName(bill.Type_id_BillStatus);
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            string where = "Order_id = " + torder.Order_id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            tps = new List <TransportProduct>();
            JavaScriptSerializer jss = new JavaScriptSerializer();

            try
            {
                tps = jss.Deserialize <List <TransportProduct> >(torder.Product);
            }
            catch (Exception)
            {
                tps = new List <TransportProduct>();
            }
        }
Exemple #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!EX_Admin.Power("order_status_ispaid", "订单支付"))
     {
         WindowNoPower();
     }
     id           = RequestTool.RequestInt("id", 0);
     string where = "id = " + id + "";
     if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
     {
         where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
     }
     if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
     {
         where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
     }
     model = B_Lebi_Order.GetModel(where);
     if (model == null)
     {
         model = new Lebi_Order();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_batch_edit", "批量编辑"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize    = RequestTool.getpageSize(25);
            key         = RequestTool.RequestString("key");
            Pro_Type_id = RequestTool.RequestString("Pro_Type_id");
            status      = RequestTool.RequestInt("status", 0);
            brand       = RequestTool.RequestInt("brand", 0);
            tag         = RequestTool.RequestInt("tag", 0);
            dateFrom    = RequestTool.RequestString("dateFrom");
            dateTo      = RequestTool.RequestString("dateTo");
            OrderBy     = RequestTool.RequestString("OrderBy");
            lang        = RequestTool.RequestString("lang");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            Type_id_ProductType = RequestTool.RequestInt("Type_id_ProductType", 320);
            if (lang == "")
            {
                lang = "CN";
            }
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            if (Pro_Type_id != "")
            {
                where += " and Pro_Type_id in (" + Shop.Bussiness.EX_Product.Categoryid(Pro_Type_id) + ")";
            }
            if (status > 0)
            {
                where += " and Type_id_ProductStatus=" + status + "";
            }
            if (Type_id_ProductType > 0)
            {
                where += " and Type_id_ProductType=" + Type_id_ProductType + "";
            }
            if (tag > 0)
            {
                if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "sqlserver")
                {
                    where += " and Charindex('" + tag + "',Pro_Tag_id)>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "access")
                {
                    where += " and Instr(Pro_Tag_id,'" + tag + "')>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "mysql")
                {
                    where += " and Instr(Pro_Tag_id,'" + tag + "')>0";
                }
            }
            if (brand > 0)
            {
                where += " and Brand_id=" + brand + "";
            }
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }

            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                string[] arr      = EX_Admin.Project().Site_ids.Split(',');
                string   sonwhere = "";
                foreach (string sid in arr)
                {
                    if (sonwhere == "")
                    {
                        sonwhere = "','+Site_ids+',' like '%," + sid + ",%'";
                    }
                    else
                    {
                        sonwhere += " or ','+Site_ids+',' like '%," + sid + ",%'";
                    }
                }
                where += " and (" + sonwhere + " or Site_ids='')";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Pro_Type_ids))
            {
                string[] ids      = EX_Admin.Project().Pro_Type_ids.Split(',');
                string   sonwhere = "";
                foreach (string id in ids)
                {
                    sonwhere += " or Path like '%," + id + ",%'";
                }
                sonwhere = "select id from Lebi_Pro_Type where id in (" + EX_Admin.Project().Pro_Type_ids + ")" + sonwhere;
                where   += " and (Pro_Type_id in (" + sonwhere + ") or Pro_Type_id=0)";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            //if (!string.IsNullOrEmpty(OrderBy))
            //{
            //    if (OrderBy.Contains("Desc"))
            //    {
            //        orderstr = " " + OrderBy.Substring(0, OrderBy.Length - 4) + " desc";
            //    }
            //    else
            //    {
            //        orderstr = " " + OrderBy.Substring(0, OrderBy.Length - 3) + " asc";
            //    }
            //}
            //else
            //{
            //    orderstr = " id desc";
            //}
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " Count_Stock desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " Count_Stock asc";
            }
            else if (OrderBy == "Price_MarketDesc")
            {
                orderstr = " Price_Market desc";
            }
            else if (OrderBy == "Price_MarketAsc")
            {
                orderstr = " Price_Market asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            LB.DataAccess.SQLPara sp = new LB.DataAccess.SQLPara(where, orderstr, "*");
            models = B_Lebi_Product.GetList(sp, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(sp);

            PageString = Pager.GetPaginationString("?page={0}&brand=" + brand + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&key=" + key + "&lang=" + lang + "&OrderBy=" + OrderBy + "&Pro_Type_id=" + Pro_Type_id + "&status=" + status + "&Type_id_ProductType=" + Type_id_ProductType + "&tag=" + tag, page, PageSize, recordCount);
            userlevels = B_Lebi_UserLevel.GetList("", "Grade asc");
        }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_list", "商品列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            sp           = new SearchProduct(CurrentAdmin, CurrentLanguage.Code);
            PageSize     = RequestTool.getpageSize(25);
            key          = RequestTool.RequestSafeString("key");
            OrderBy      = RequestTool.RequestString("OrderBy");
            mode         = RequestTool.RequestString("mode");
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            if (mode == "recycle")
            {
                where = "IsDel=1";
            }
            if (key != "")
            {
                where += " and (";
                where += " Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}";
                List <Lebi_Product> parents = B_Lebi_Product.GetList("Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}", "");
                if (parents.Count > 0)
                {
                    foreach (Lebi_Product parent in parents)
                    {
                        where += " or id =" + parent.Product_id + "";
                    }
                }
                where += " )";
            }
            where += sp.SQL;
            if (mode != "recycle")
            {
                if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
                {
                    string[] arr      = EX_Admin.Project().Site_ids.Split(',');
                    string   sonwhere = "";
                    foreach (string sid in arr)
                    {
                        if (sonwhere == "")
                        {
                            sonwhere = "','+Site_ids+',' like '%," + sid + ",%'";
                        }
                        else
                        {
                            sonwhere += " or ','+Site_ids+',' like '%," + sid + ",%'";
                        }
                    }
                    where += " and (" + sonwhere + " or Site_ids='')";
                }
                if (!string.IsNullOrEmpty(EX_Admin.Project().Pro_Type_ids))
                {
                    string[] ids      = EX_Admin.Project().Pro_Type_ids.Split(',');
                    string   sonwhere = "";
                    foreach (string id in ids)
                    {
                        sonwhere += " or Path like '%," + id + ",%'";
                    }
                    sonwhere = "select id from Lebi_Pro_Type where id in (" + EX_Admin.Project().Pro_Type_ids + ")" + sonwhere;
                    where   += " and (Pro_Type_id in (" + sonwhere + "))";
                }
                if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
                {
                    where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
                }
            }
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " (Count_Stock+Count_Freeze) desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " (Count_Stock+Count_Freeze) asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            models = B_Lebi_Product.GetList(where, orderstr, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&OrderBy=" + OrderBy + "&key=" + key + "&mode=" + mode + "&" + sp.URL, page, PageSize, recordCount);
            //Response.Write(where);
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            type     = RequestTool.RequestString("type");
            key      = RequestTool.RequestString("key");
            dateFrom = RequestTool.RequestString("dateFrom");
            dateTo   = RequestTool.RequestString("dateTo");
            t        = RequestTool.RequestInt("t", 211);
            mark     = RequestTool.RequestString("mark");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            su = new SearchOrder(CurrentAdmin, CurrentLanguage.Code);
            if (t == 212)
            {
                if (!EX_Admin.Power("order_return_list", "退货订单列表"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }
            }
            else
            {
                if (!EX_Admin.Power("order_list", "订单列表"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }
            }

            string where = "(IsDel!=1 or IsDel is null) and Type_id_OrderType=" + t + su.SQL;
            if (key != "")
            {
                where += " and (Code like lbsql{'%" + key + "%'} or User_UserName like lbsql{'%" + key + "%'} or T_Name like lbsql{'%" + key + "%'} or Transport_Name like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }

            switch (type.ToLower())
            {
            case "1":
                where += " and IsVerified = 0 and IsInvalid = 0";
                break;

            case "2":
                where += " and IsVerified = 1 and IsInvalid = 0";
                break;

            case "3":
                where += " and IsVerified = 1 and IsPaid = 0 and IsInvalid = 0";
                break;

            case "4":
                where += " and IsPaid = 1 and IsShipped = 0 and IsInvalid = 0";
                break;

            case "5":
                where += " and IsVerified = 1 and IsShipped = 0 and IsInvalid = 0";
                break;

            case "6":
                where += " and IsVerified = 1 and IsShipped_All= 1 and IsInvalid = 0";
                break;

            case "7":
                where += " and IsVerified = 1 and IsShipped = 1 and IsShipped_All= 0 and IsInvalid = 0";
                break;

            case "8":
                where += " and IsVerified = 1 and IsReceived = 0 and IsInvalid = 0";
                break;

            case "9":
                where += " and IsVerified = 1 and IsReceived = 1 and IsInvalid = 0";
                break;

            case "10":
                where += " and IsVerified = 1 and IsCompleted = 1 and IsInvalid = 0";
                break;

            case "11":
                where += " and IsInvalid = 1";
                break;

            case "12":
                where += " and IsRefund = 2";
                break;

            case "13":
                where += " and IsRefund = 1";
                break;
            }
            if (mark != "")
            {
                where += " and Mark = " + int.Parse(mark);
            }
            //if (Supplier_id > 0)
            //    where += " and Supplier_id = " + Supplier_id;
            //if (user_id > 0)
            //    where += " and User_id = " + user_id;
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            PageSize = RequestTool.getpageSize(25);
            //if (product_id > 0)
            //{
            //    Lebi_Product pro = B_Lebi_Product.GetModel(product_id);
            //    if (pro != null)
            //    {
            //        if (pro.Product_id == 0)
            //        {
            //            string pids = "";
            //            List<Lebi_Product> ps = B_Lebi_Product.GetList("Product_id=" + product_id + "", "");
            //            if (ps.Count > 0)
            //            {
            //                foreach (Lebi_Product p in ps)
            //                {
            //                    pids += p.id + ",";
            //                }
            //                pids = pids.TrimEnd(',');
            //                where += " and id in (select Order_id from Lebi_Order_Product where Product_id in (" + pids + "))";
            //            }
            //            else
            //            {
            //                where += " and id in (select Order_id from Lebi_Order_Product where Product_id=" + product_id + ")";
            //            }
            //        }
            //        else
            //        {
            //            where += " and id in (select Order_id from Lebi_Order_Product where Product_id=" + product_id + ")";
            //        }
            //    }
            //}
            models = B_Lebi_Order.GetList(where, "id desc", PageSize, page);
            int recordCount = B_Lebi_Order.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&t=" + t + "&type=" + type + "&mark=" + mark + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&key=" + key + "&" + su.URL, page, PageSize, recordCount);
        }
Exemple #11
0
        public string CreateTree(int pid, int deep)
        {
            string str = "";
            List <Lebi_Pro_Type> types = new List <Lebi_Pro_Type>();

            if (pid == 0)
            {
                if (!string.IsNullOrEmpty(EX_Admin.Project().Pro_Type_ids))
                {
                    types = B_Lebi_Pro_Type.GetList("Parentid = 0 and id in(" + EX_Admin.Project().Pro_Type_ids + ")", "Sort desc");
                }
                else
                {
                    types = EX_Product.Types(pid);
                }
            }
            else
            {
                types = EX_Product.Types(pid);
            }
            //将根节点进行遍历
            string style = "";

            if (deep > 0)
            {
                style = "style=\"display:none;\"";
            }
            string showids = LB.Tools.CookieTool.GetCookieString("showTypeids").Replace("%2C", ",");
            string image   = "";

            foreach (Lebi_Pro_Type t in types)
            {
                image = AdminImage("plus.gif");
                bool showson = false;
                if (showids.Contains("," + t.id + ",") || showids.Contains("," + t.Parentid + ","))
                {
                    style = "";
                }
                if (showids.Contains("," + t.id + ","))
                {
                    image   = AdminImage("minus.gif");
                    showson = true;
                }
                int count = B_Lebi_Pro_Type.Counts("Parentid=" + t.id + "");
                //隐藏规则
                //name = "<input type=\"hidden\" value=\"" + 1 + "\" /><input type=\"hidden\" value=\"" + ds.Tables[0].Rows[i]["pid"] + "\" /> <input type=\"hidden\" value=\"" + ds.Tables[0].Rows[i]["id"] + "\" /><input type=\"hidden\" value=\"," + ds.Tables[0].Rows[i]["pid"] + ",\" />";
                //操作
                string caozuo = "<a href=\"javascript:Edit(" + t.id + ",0)\">" + Tag("添加子类") + "</a> |  <a href=\"javascript:Edit(0," + t.id + ")\">" + Tag("编辑") + "</a>";

                //str += "<tr onclick='javascript:selectrow(\"check" + t.id + "\");' name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    caozuo += " | <a href=\"javascript:DeleteConfirm(" + t.id + ")\">" + Tag("删除") + "</a>";
                    str    += "<tr ondblclick=\"Edit(0," + t.id + ")\" name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                    str    += "<td><label class=\"custom-control custom-checkbox\"><input type=\"checkbox\" id=\"check" + t.id + "\" name=\"id\" value=\"" + t.id + "\" class=\"custom-control-input\" del=\"del\"><span class=\"custom-control-label\"></span></label></td>";
                    str    += "<td>" + t.id + "</td>";
                    str    += "<td>" + deepstr(deep);
                    if (count > 0)
                    {
                        str += "<i class=\"ti-plus\" name=\"img" + t.Parentid + "\" id=\"img" + t.id + "\" style=\"cursor: pointer;\" onclick=\"ShowProductTypeChild('" + findpath(t.id) + "'," + t.id + "," + (deep + 1) + ")\" title=\"" + Tag("展开") + "\"></i>&nbsp;&nbsp;";
                    }
                    else
                    {
                        str += "<i class=\"ti-minus\" style=\"cursor: pointer;\"></i>&nbsp;&nbsp;";
                    }
                    if (t.ImageSmall != "")
                    {
                        str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                    }
                    str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><i class=\"ti-new-window\"></i></a></td>";
                    str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                    str += "<td>" + (t.IsShow == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>") + "</td>";
                    str += "<td>" + (t.IsIndexShow == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>") + "</td>";
                    str += "<td>" + t.Sort + "</td>";
                    str += "<td>" + caozuo + "</td></tr>";
                }
                else
                {
                    caozuo += " | <a href=\"javascript:Del(" + t.id + ")\">" + Tag("删除") + "</a>";
                    str    += "<tr class=\"list\" ondblclick=\"Edit(0," + t.id + ")\" name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                    str    += "<td style=\"text-align:center\"><input type='checkbox' id=\"check" + t.id + "\" value='" + t.id + "' name='id' del=\"del\" /></td>";
                    str    += "<td>" + t.id + "</td>";
                    str    += "<td>" + deepstr(deep);
                    if (count > 0)
                    {
                        str += "<img src=\"" + image + "\" name=\"img" + t.Parentid + "\" id=\"img" + t.id + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" onclick=\"ShowProductTypeChild('" + findpath(t.id) + "'," + t.id + "," + (deep + 1) + ")\" title=\"" + Tag("展开") + "\" />&nbsp;&nbsp;";
                    }
                    else
                    {
                        str += "<img src=\"" + AdminImage("minus.gif") + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" />&nbsp;&nbsp;";
                    }
                    if (t.ImageSmall != "")
                    {
                        str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                    }
                    str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><img src=\"" + PageImage("icon/newWindow.png") + "\" style=\"vertical-align:absmiddle\" /></a></td>";

                    str += "<td>" + LB.Tools.Utils.GetUnicodeSubString(shuxinglianjie(ProPertystring(t.ProPerty132), ProPertystring(t.ProPerty133)), 100, "...") + "</td>";
                    str += "<td>" + LB.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty131), 100, "...") + "</td>";

                    str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                    str += "<td>" + t.Sort + "</td>";
                    str += "<td>" + (t.IsShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                    str += "<td>" + (t.IsIndexShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                    str += "<td>" + caozuo + "</td></tr>";
                }
                if (showson)
                {
                    str += CreateTree(t.id, deep + 1);
                }
                //CreateSunNode(int.Parse(ds.Tables[0].Rows[i]["id"].ToString()), ",0", ss);
            }
            return(str);
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Random Random = new Random();

            t     = RequestTool.RequestString("t");
            id    = RequestTool.RequestInt("id", 0);
            model = B_Lebi_Product.GetModel(id);
            int Type_id_ProductType = RequestTool.RequestInt("Type_id_ProductType", 320);

            if (id == 0 || (id > 0 && t == "copy"))
            {
                if (!EX_Admin.Power("product_add", "添加商品"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }
                ////如果添加商品时随机数小于9位数 重定向生成随机数 防止破坏已有数据
                //if (randnum.ToString().Length < 9)
                //{
                //    Response.Redirect(site.AdminPath + "/product/product_edit.aspx?id=" + id + "&t=" + t + "&randnum=" + Random.Next(100000000, 999999999));
                //    Response.End();
                //    return;
                //}
            }
            else
            {
                if (!EX_Admin.Power("product_edit", "编辑商品"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }
                if (site.SiteCount > 1 && EX_Admin.Project().Site_ids != "" && model.Site_ids != "")
                {
                    string[] psids = model.Site_ids.Split(',');
                    bool     flag  = false;
                    foreach (string pdis in psids)
                    {
                        if (("," + EX_Admin.Project().Site_ids + ",").Contains("," + pdis + ","))
                        {
                            flag = true;
                        }
                    }
                    if (!flag)
                    {
                        PageReturnMsg = PageErrorMsg();
                    }
                }
                if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
                {
                    bool flag = false;
                    if (("," + EX_Admin.Project().Supplier_ids + ",").Contains("," + model.Supplier_id + ","))
                    {
                        flag = true;
                    }
                    if (!flag)
                    {
                        PageReturnMsg = PageErrorMsg();
                    }
                }
            }
            action = RequestTool.RequestInt("action", 1);
            if (model == null)
            {
                model                     = new Lebi_Product();
                model.Site_ids            = site.Sitesid();
                model.Type_id_ProductType = Type_id_ProductType;
                Lebi_Product modellast = B_Lebi_Product.GetModel("(IsDel!=1 or IsDel is null) and Type_id_ProductType = " + Type_id_ProductType + " and Supplier_id = 0 order by Time_Edit desc,id desc");
                if (modellast != null)
                {
                    model.Pro_Type_id = modellast.Pro_Type_id;
                }
            }
            else
            {
                if (t == "copy")
                {
                    model.id = 0;
                }
            }
            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;
                }
            }
            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");
            wap        = Ishavewap();

            if (model.IsCombo == 1)
            {
                comboProducts = B_Lebi_Product_Combo.GetList("Product_id=" + model.id + "", "");
            }
            else
            {
                comboProducts = new List <Lebi_Product_Combo>();
            }
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
                shop  = new Lebi_Supplier();
            }
            else
            {
                if (model.Supplier_id > 0)
                {
                    shop = B_Lebi_Supplier.GetModel(model.Supplier_id);
                }
                if (shop == null)
                {
                    shop = new Lebi_Supplier();
                }
                if (domain3admin && CurrentAdmin.Site_ids != "")
                {
                    if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ","))
                    {
                        PageError();
                        return;
                    }
                }
            }
            if (model.Type_id_OrderType == 212)
            {
                str = "- ";
            }
            oldmodel = B_Lebi_Order.GetModel(model.Order_id);
            if (oldmodel == null)
            {
                oldmodel = new Lebi_Order();
            }
            //if (model.Type_id_OrderType == 212)
            //    Response.Redirect("Torder_view.aspx?id=" + id);
            pros    = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            Logs    = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc");
            torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc");
            comms   = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc");
            langs   = Language.Languages();
            Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + "");

            if (bill == null)
            {
                billstatus = Tag("不开发票");
            }
            else
            {
                billstatus = EX_Type.TypeName(bill.Type_id_BillStatus);
            }
            TransportCount = B_Lebi_Transport_Order.Counts("Order_id=" + model.id + "");
            CommentCount   = B_Lebi_Comment.Counts("TableName='Order' and Keyid=" + model.id + "");
            LogCount       = B_Lebi_Log.Counts("TableName='Order' and Keyid='" + model.id + "'");
            deliveries     = B_Lebi_Supplier_Delivery.GetList("Supplier_id = " + model.Supplier_id + "", "Sort desc");
            DeliveryCount  = B_Lebi_Supplier_Delivery.Counts("Supplier_id = " + model.Supplier_id + "");
            if (model.Promotion_Type_ids != "")
            {
                //List<Lebi_Promotion_Type> Promotions = B_Lebi_Promotion_Type.GetList("id in (" + model.Promotion_Type_ids + ")", "");
                //foreach (Lebi_Promotion_Type p in Promotions)
                //{
                //    if (Promotion == "")
                //        Promotion = Lang(p.Name);
                //    else
                //        Promotion += "<br/>" + Lang(p.Name);
                //}
                Promotion = Lang(model.Promotion_Type_Name);
            }
        }