Esempio n. 1
0
    public string GetSubCateLeft(int ParentID)
    {
        QueryInfo Query = new QueryInfo();

        Query.PageSize    = 0;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "CategoryInfo.Cate_ParentID", "=", ParentID.ToString()));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "CategoryInfo.Cate_IsActive", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "CategoryInfo.Cate_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("CategoryInfo.Cate_Sort", "ASC"));
        Query.OrderInfos.Add(new OrderInfo("CategoryInfo.Cate_ID", "ASC"));
        IList <CategoryInfo> Categorys = category.GetCategorys(Query, pub.CreateUserPrivilege("2883de94-8873-4c66-8f9a-75d80c004acb"));

        if (Categorys == null)
        {
            return(string.Empty);
        }

        StringBuilder strHTML = new StringBuilder();

        int icount = 0;

        foreach (CategoryInfo entity in Categorys)
        {
            icount++;

            strHTML.Append("<li" + (icount % 2 == 1 ? " class=\"bg\"" : "") + "><a href=\"" + pageurl.FormatURL(pageurl.categorylist, pageurl.categoryParam(entity.Cate_ID.ToString(), "", "", "", "")) + "\">" + entity.Cate_Name + "</a></li>");
        }

        return(strHTML.ToString());
    }
Esempio n. 2
0
    /// <summary>
    /// 搜索店铺下商品
    /// </summary>
    /// <param name="supplier_id"></param>
    /// <returns></returns>
    public string ShopProducts(int supplier_id)
    {
        StringBuilder strHTML = new StringBuilder();

        QueryInfo Query = new QueryInfo();

        Query.PageSize    = 3;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "ProductInfo.Product_Site", "=", pub.GetCurrentSite()));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_IsInsale", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_IsAudit", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_SupplierID", "=", supplier_id.ToString()));
        Query.OrderInfos.Add(new OrderInfo("ProductInfo.Product_Sort", "ASC"));
        Query.OrderInfos.Add(new OrderInfo("ProductInfo.Product_ID", "DESC"));
        IList <ProductInfo> entitys = Myproduct.GetProductList(Query, pub.CreateUserPrivilege("ae7f5215-a21a-4af2-8d47-3cda2e1e2de8"));

        if (entitys != null)
        {
            string targetURL = string.Empty;
            foreach (ProductInfo entity in entitys)
            {
                targetURL = pageurl.FormatURL(pageurl.product_detail, entity.Product_ID.ToString());

                strHTML.Append("<li><div class=\"img_box\"><a href=\"" + targetURL + "\" target=\"_blank\"><img src=\"" + pub.FormatImgURL(entity.Product_Img, "thumbnail") + "\" alt=\"" + entity.Product_Name + "\" /></a><i><a href=\"" + targetURL + "\" target=\"_blank\">" + entity.Product_Name + "</a></i></div><p><span>成交 " + entity.Product_SaleAmount + "个</span><strong>" + (entity.Product_PriceType == 1 ? pub.FormatCurrency(entity.Product_Price) : pub.FormatCurrency(pub.GetProductPrice(entity.Product_ManualFee, entity.Product_Weight))) + "</strong></p></li>");
            }
        }
        entitys = null;

        return(strHTML.ToString());
    }
Esempio n. 3
0
    public void AddPackage()
    {
        int    Package_ID          = tools.CheckInt(Request.Form["Package_ID"]);
        string Package_Name        = tools.CheckStr(Request.Form["Package_Name"]);
        int    Package_IsInsale    = tools.CheckInt(Request.Form["Package_IsInsale"]);
        int    Package_StockAmount = tools.CheckInt(Request.Form["Package_StockAmount"]);
        int    Package_Weight      = tools.CheckInt(Request.Form["Package_Weight"]);
        double Package_Price       = tools.CheckFloat(Request.Form["Package_Price"]);
        int    Package_Sort        = tools.CheckInt(Request.Form["Package_Sort"]);

        PackageInfo entity = new PackageInfo();

        entity.Package_ID          = Package_ID;
        entity.Package_Name        = Package_Name;
        entity.Package_IsInsale    = Package_IsInsale;
        entity.Package_StockAmount = Package_StockAmount;
        entity.Package_Weight      = Package_Weight;
        entity.Package_Price       = Package_Price;
        entity.Package_Sort        = Package_Sort;
        entity.Package_Addtime     = DateTime.Now;
        entity.Package_Site        = pub.GetCurrentSite();
        entity.PackageProductInfos = ReadPackageProduct();
        entity.Package_SupplierID  = tools.NullInt(Session["supplier_id"]);

        if (MyBLL.AddPackage(entity, pub.CreateUserPrivilege("573393a4-573e-4872-ad7b-b77d75e0f611")))
        {
            pub.Msg("positive", "操作成功", "操作成功", true, "Package_add.aspx");
        }
        else
        {
            pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Esempio n. 4
0
    public void AddProductTag()
    {
        int    Product_Tag_ID         = tools.CheckInt(Request.Form["Product_Tag_ID"]);
        string Product_Tag_Name       = tools.CheckStr(Request.Form["Product_Tag_Name"]);
        int    Product_Tag_IsSupplier = tools.CheckInt(Request.Form["Product_Tag_IsSupplier"]);
        int    Product_Tag_IsActive   = tools.CheckInt(Request.Form["Product_Tag_IsActive"]);
        int    Product_Tag_Sort       = tools.CheckInt(Request.Form["Product_Tag_Sort"]);
        string Product_Tag_Site       = pub.GetCurrentSite();

        ProductTagInfo entity = new ProductTagInfo();

        entity.Product_Tag_ID         = Product_Tag_ID;
        entity.Product_Tag_Name       = Product_Tag_Name;
        entity.Product_Tag_IsSupplier = 1;
        entity.Product_Tag_IsActive   = Product_Tag_IsActive;
        entity.Product_Tag_Sort       = Product_Tag_Sort;
        entity.Product_Tag_Site       = Product_Tag_Site;
        entity.Product_Tag_SupplierID = tools.NullInt(Session["supplier_id"]);

        if (MyBLL.AddProductTag(entity, pub.CreateUserPrivilege("2f1d706e-3356-494d-821c-c4173a923328")))
        {
            pub.Msg("positive", "操作成功", "操作成功", true, "tag.aspx");
        }
        else
        {
            pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Esempio n. 5
0
 public ConfigInfo GetConfigByID(int id)
 {
     return(MyBLL.GetConfigByID(id, pub.CreateUserPrivilege("ef84a07f-6281-4f54-84f9-c345adf9d765")));
 }
Esempio n. 6
0
    //合同查看打印
    public void Contract_View_New(OrdersInfo ordersInfo, int contact_no)
    {
        string Template_Html = "";
        int    Contract_ID;
        string Time = string.Empty;

        string Contract_Product_Goods          = "";
        string ContractTemplate_TopFuJian      = "";
        string Sell_Contract_Template_OnlyRead = "";
        string Supplier_CompanyName            = "";
        string Member_NickName        = "";
        string ContractTemResponsible = string.Empty;

        SupplierInfo supplierInfo = null;
        SupplierInfo Supplierinfo = null;

        string Sell_Contract_Template_EndFuJianContent = "";

        Contract_ID            = tools.CheckInt(Request["Contract_ID"]);
        Contract_Product_Goods = new Contract().Contract_Orders_Goods_Print(Contract_ID);
        SupplierInfo MemberSupplierinfo        = null;
        string       MemberSupplierCompanyName = "";
        MemberInfo   memberInfo = null;

        if (ordersInfo != null)
        {
            memberInfo   = new Member().GetMemberByID(ordersInfo.Orders_BuyerID);
            Supplierinfo = new Supplier().GetSupplierByID(memberInfo.Member_SupplierID);

            if (memberInfo != null)
            {
                //Member_NickName = memberInfo.Member_NickName;
                MemberSupplierinfo = new Supplier().GetSupplierByID(memberInfo.Member_SupplierID);
                if (MemberSupplierinfo != null)
                {
                    MemberSupplierCompanyName = MemberSupplierinfo.Supplier_CompanyName;
                }
            }
        }
        List <OrdersLogInfo> logs = MyOrdersLog.GetOrdersLogsByOrdersID(ordersInfo.Orders_ID).Where(p => p.Orders_Log_Remark == "供应商确认订单").ToList();

        if (ordersInfo != null)
        {
            supplierInfo = MySupplier.GetSupplierByID(ordersInfo.Orders_SupplierID, pub.CreateUserPrivilege("1392d14a-6746-4167-804a-d04a2f81d226"));
            if (supplierInfo != null)
            {
                Supplier_CompanyName = supplierInfo.Supplier_CompanyName;
            }
        }
        //合同顶部附件
        ContractTemplateInfo ContractTemplateEntity = MyContractTemplate.GetContractTemplateBySign("Sell_Contract_Template_TopFuJian", pub.CreateUserPrivilege("d4d58107-0e58-485f-af9e-3b38c7ff9672"));

        if (logs.Count > 0)
        {
            Time = tools.NullStr(logs.FirstOrDefault().Orders_Log_Addtime.ToString("yyyy年MM月dd日"));
        }

        //合同模板运输责任
        ContractTemplateInfo ContractTemResponsibleEntity = MyContractTemplate.GetContractTemplateBySign("Sell_Contract_Template_Responsible", pub.CreateUserPrivilege("d4d58107-0e58-485f-af9e-3b38c7ff9672"));

        if (ContractTemResponsibleEntity != null)
        {
            ContractTemResponsible = ContractTemResponsibleEntity.Contract_Template_Content;
            if (ordersInfo != null)
            {
                ContractTemResponsible = ContractTemResponsible.Replace("{Responsible}", ordersInfo.Orders_Responsible == 1 ? "卖家责任" : "买家责任");
            }
        }


        if (ContractTemplateEntity != null)
        {
            ContractTemplate_TopFuJian = ContractTemplateEntity.Contract_Template_Content;
            ContractTemplate_TopFuJian = ContractTemplate_TopFuJian.Replace("{supplier_name}", Supplier_CompanyName);
            ContractTemplate_TopFuJian = ContractTemplate_TopFuJian.Replace("{member_name}", MemberSupplierCompanyName);
            ContractTemplate_TopFuJian = ContractTemplate_TopFuJian.Replace("{time}", string.IsNullOrEmpty(Time) ? "卖家尚未确认订单" : Time);

            //ContractTemplate_TopFuJian = ContractTemplate_TopFuJian.Replace("{orders_goodslist}", Contract_Product_Goods);
            ContractTemplate_TopFuJian = ContractTemplate_TopFuJian.Replace("{orders_goodslist}", new Member().GetOrdersGoods(ordersInfo));
        }


        //合同尾部附件
        ContractTemplateInfo Sell_Contract_Template_EndFuJianEntity = MyContractTemplate.GetContractTemplateBySign("Sell_Contract_Template_EndFuJian", pub.CreateUserPrivilege("d4d58107-0e58-485f-af9e-3b38c7ff9672"));

        if (Sell_Contract_Template_EndFuJianEntity != null)
        {
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianEntity.Contract_Template_Content;

            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{member_name}", supplierInfo.Supplier_CompanyName);
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{member_adress}", supplierInfo.Supplier_Address);
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{member_corproate}", supplierInfo.Supplier_Corporate);
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{supplier_name}", Supplierinfo.Supplier_CompanyName);
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{supplier_adress}", Supplierinfo.Supplier_Address);
            Sell_Contract_Template_EndFuJianContent = Sell_Contract_Template_EndFuJianContent.Replace("{supplier_corproate}", Supplierinfo.Supplier_Corporate);
        }



        //易耐网交易合同标准条款
        ContractTemplateInfo Sell_Contract_Template_OnlyReadEntity = MyContractTemplate.GetContractTemplateBySign("Sell_Contract_Template_OnlyRead", pub.CreateUserPrivilege("d4d58107-0e58-485f-af9e-3b38c7ff9672"));

        if (Sell_Contract_Template_OnlyReadEntity != null)
        {
            Sell_Contract_Template_OnlyRead = Sell_Contract_Template_OnlyReadEntity.Contract_Template_Content;
        }



        if (Contract_ID == 0)
        {
            Response.Write("<script>alert('合同无效!');windwo.close();</script>");
            Response.End();
        }
        ContractInfo entity = GetContractByID(Contract_ID);

        if (entity != null)
        {
            if (Request["action"] == "print")
            {
                Response.Write("<script>window.print();</script>");
            }

            string       address      = "";// /**/
            ContractInfo ContractInfo = null;



            if (ordersInfo != null)
            {
                if (MySupplier != null)
                {
                    ContractInfo = MyContract.GetContractByID(contact_no, pub.CreateUserPrivilege("a3465003-08b3-4a31-9103-28d16c57f2c8"));
                    if (ContractInfo != null)
                    {
                        Template_Html = ContractInfo.Contract_Note;

                        Template_Html = Template_Html.Replace("{supplier_name}", Supplier_CompanyName);
                        Template_Html = Template_Html.Replace("{member_name}", MemberSupplierCompanyName);
                        Template_Html = Template_Html.Replace("{orders_address}", addr.DisplayAddress(ordersInfo.Orders_Address_State, ordersInfo.Orders_Address_City, ordersInfo.Orders_Address_County) + ordersInfo.Orders_Address_StreetAddress);



                        Template_Html = Template_Html.Replace("{supplier_sealimg}", pub.FormatImgURL(supplierInfo.Supplier_SealImg, "fullpath"));


                        Template_Html = Template_Html.Replace("{orders_paywayname}", ordersInfo.Orders_Payway_Name);
                        Template_Html = Template_Html.Replace("{orders_deliveryname}", ordersInfo.Orders_Delivery_Name);



                        Template_Html = Template_Html.Replace("{orders_goodslist}", new Member().GetOrdersGoods(ordersInfo));


                        if (memberInfo != null)
                        {
                            Template_Html = Template_Html.Replace("{member_name}", memberInfo.MemberProfileInfo.Member_Company);
                            Template_Html = Template_Html.Replace("{member_sealimg}", pub.FormatImgURL(memberInfo.MemberProfileInfo.Member_SealImg, "fullpath"));
                        }
                    }
                }
                Template_Html = ContractTemplate_TopFuJian + Template_Html + ContractTemResponsible + ordersInfo.Orders_ContractAdd + Sell_Contract_Template_OnlyRead + Sell_Contract_Template_EndFuJianContent;;
            }

            Response.Write(Server.HtmlDecode(Template_Html));
        }
        else
        {
            Response.Write("<script>alert('合同无效!');windwo.close();</script>");
            Response.End();
        }
    }
Esempio n. 7
0
    /// <summary>
    /// 首页公告列表
    /// </summary>
    /// <param name="Show_Num"></param>
    /// <param name="Cate_ID"></param>
    /// <returns></returns>
    public string Home_Top_Notice(int Show_Num, int Cate_ID)
    {
        string    notice_list = "";
        QueryInfo Query       = new QueryInfo();

        Query.PageSize    = Show_Num;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_Cate", "=", Cate_ID.ToString()));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_IsAudit", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "NoticeInfo.Notice_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("NoticeInfo.Notice_ID", "Desc"));
        IList <NoticeInfo> Notices = Webnotice.GetNoticeList(Query, pub.CreateUserPrivilege("9d4d1366-35ab-4eb6-b88e-e49e6bfae9d7"));

        if (Notices != null)
        {
            foreach (NoticeInfo entity in Notices)
            {
                notice_list = notice_list + " <li><a href=\"/notice/detail.aspx?notice_id=" + entity.Notice_ID + "&cate_id=" + entity.Notice_Cate + "\" target=\"_blank\">" + tools.CutStr(entity.Notice_Title, 36) + "</a></li>";
            }
        }

        return(notice_list);
    }
Esempio n. 8
0
    public void AddZhonghang()
    {
        Supplier_ID = tools.CheckInt(Session["supplier_id"].ToString());
        ZhongXinInfo zhongxininfo = GetZhongXinBySuppleir(Supplier_ID);

        if (zhongxininfo == null)
        {
            pub.Msg("info", "提示信息", "系统繁忙,若多次出现请联系管理员", false, "{back}");
        }

        SupplierInfo entitys = MySupplier.GetSupplierByID(Supplier_ID, pub.CreateUserPrivilege("1392d14a-6746-4167-804a-d04a2f81d226"));

        if (entitys != null)
        {
            string CompanyName     = tools.CheckStr(Request.Form["CompanyName"]);
            string ReceiptAccount  = tools.CheckStr(Request.Form["ReceiptAccount"]);
            string ReceiptBank     = tools.CheckStr(Request.Form["ReceiptBank"]);
            string BankCode        = tools.CheckStr(Request.Form["BankCode"]);
            string BankName        = tools.CheckStr(Request.Form["BankName"]);
            string OpenAccountName = tools.CheckStr(Request.Form["OpenAccountName"]);

            if (CompanyName == "")
            {
                pub.Msg("info", "提示信息", "填写公司名称", false, "{back}");
            }

            if (ReceiptAccount == "")
            {
                pub.Msg("info", "提示信息", "填写出金收款账号须真实有效", false, "{back}");
            }

            if (ReceiptBank == "")
            {
                pub.Msg("info", "提示信息", "填写出金收款银行", false, "{back}");
            }

            if (BankCode == "")
            {
                pub.Msg("info", "提示信息", "填写银行行号", false, "{back}");
            }

            if (BankName == "")
            {
                pub.Msg("info", "提示信息", "填写银行名称", false, "{back}");
            }

            if (OpenAccountName == "")
            {
                pub.Msg("info", "提示信息", "填写开户名称", false, "{back}");
            }

            ZhongXinInfo entity = MyBLL.GetZhongXinBySuppleir(Supplier_ID);

            entity.ReceiptAccount = ReceiptAccount;
            entity.ReceiptBank    = ReceiptBank;
            entity.BankCode       = BankCode;
            entity.BankName       = BankName;
            entity.Audit          = 0;
            entity.Register       = 0;

            if (MyBLL.EditZhongXin(entity))
            {
                pub.Msg("positive", "操作成功", "操作成功", true, "/supplier/ZhongXin.aspx?tip=success");
            }
            else
            {
                pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
            }
        }
        else
        {
            pub.Msg("error", "错误信息", "信息保存失败,请稍后再试!", false, "{back}");
        }
    }
Esempio n. 9
0
    //检查昵称是否使用
    public bool Check_Member_Nickname(string nick_name)
    {
        QueryInfo Query = new QueryInfo();

        Query.PageSize    = 1;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "MemberInfo.Member_NickName", "=", nick_name));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "MemberInfo.Member_Trash", "=", "0"));
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "MemberInfo.Member_Site", "=", "CN"));
        Query.OrderInfos.Add(new OrderInfo("MemberInfo.Member_ID", "Desc"));
        PageInfo page = MyMember.GetPageInfo(Query, pub.CreateUserPrivilege("833b9bdd-a344-407b-b23a-671348d57f76"));

        if (page != null)
        {
            if (page.RecordCount > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        else
        {
            return(false);
        }
    }
Esempio n. 10
0
    /// <summary>
    /// 销售量(额)排名
    /// </summary>
    /// <returns></returns>
    public string SalesAmountRanked()
    {
        string orders_status = tools.CheckStr(Request["orders_status"]);

        DateTime startDate;

        if (!DateTime.TryParse(tools.CheckStr(Request["startdate"]), out startDate))
        {
            startDate = DateTime.Today.AddDays(-15);
        }
        DateTime endDate;

        if (!DateTime.TryParse(tools.CheckStr(Request["endDate"]), out endDate))
        {
            endDate = DateTime.Today;
        }

        int PageSize    = tools.CheckInt(Request["rows"]);
        int CurrentPage = tools.CheckInt(Request["page"]);

        int RecordCount = 0;
        int PageCount   = 0;

        string SqlField = "G.Orders_Goods_Product_ID, SUM(Orders_Goods_Amount) AS saleCount, SUM(Orders_Goods_Product_Price * Orders_Goods_Amount) AS saleSum";
        string SqlTable = "Orders_Goods AS G INNER JOIN Orders AS O ON G.Orders_Goods_OrdersID = O.Orders_ID";
        string SqlOrder = "ORDER BY " + tools.CheckStr(Request["sidx"]) + " " + tools.CheckStr(Request["sord"]);

        string SqlParam = " WHERE O.Orders_Site = 'CN' AND Orders_SupplierID = " + tools.NullInt(Session["supplier_id"]);

        SqlParam += " AND DATEDIFF(d, O.Orders_Addtime, '" + startDate + "') <= 0 AND DATEDIFF(d, O.Orders_Addtime, '" + endDate + "') >= 0";

        if (orders_status == "confirm")
        {
            SqlParam += " AND (Orders_Status > 0 AND Orders_Status < 3)";
        }
        if (orders_status == "success")
        {
            SqlParam += " AND Orders_Status = 2";
        }

        string SqlCount = "SELECT COUNT(DISTINCT Orders_Goods_Product_ID) FROM " + SqlTable + " " + SqlParam;

        DataTable DtList = null;

        try
        {
            RecordCount = (int)DBHelper.ExecuteScalar(SqlCount);
            PageCount   = tools.CalculatePages(RecordCount, PageSize);
            CurrentPage = tools.DeterminePage(CurrentPage, PageCount);

            string SqlList = "SELECT * FROM (SELECT " + SqlField + " , ROW_NUMBER() OVER (" + SqlOrder + ") AS RowNumber FROM " + SqlTable + " " + SqlParam + " GROUP BY (G.Orders_Goods_Product_ID) ) AS T WHERE RowNumber >  " + (CurrentPage - 1) * PageSize + " AND RowNumber < " + ((CurrentPage * PageSize) + 1);

            int    Product_ID, saleCount, Supplier_ID;
            string Product_Name, Product_Code, Product_Spec, Supplier_Name, Cate_Name;
            double saleSum;

            DtList = DBHelper.Query(SqlList);

            if (DtList.Rows.Count > 0)
            {
                ProductInfo  pEntity;
                SupplierInfo sEntity;
                CategoryInfo cEntity;

                StringBuilder jsonBuilder = new StringBuilder();
                jsonBuilder.Append("{\"page\":" + CurrentPage + ",\"total\":" + PageCount + ",\"records\":" + RecordCount + ",\"rows\"");
                jsonBuilder.Append(":[");

                foreach (DataRow DrList in DtList.Rows)
                {
                    Product_ID = tools.NullInt(DrList["Orders_Goods_Product_ID"]);
                    saleCount  = tools.NullInt(DrList["saleCount"]);
                    saleSum    = tools.NullDbl(DrList["saleSum"]);

                    pEntity = product.GetProductByID(Product_ID);
                    if (pEntity != null)
                    {
                        Product_Name = pEntity.Product_Name;
                        //Product_Code = pEntity.Product_Code;
                        Product_Spec = pEntity.Product_Spec;
                        Supplier_ID  = pEntity.Product_SupplierID;
                        sEntity      = supplier.GetSupplierByID(Supplier_ID);
                        if (sEntity != null)
                        {
                            Supplier_Name = sEntity.Supplier_CompanyName;
                        }
                        else
                        {
                            Supplier_Name = Supplier_ID.ToString();
                        }
                        sEntity = null;

                        cEntity = category.GetCategoryByID(pEntity.Product_CateID, pub.CreateUserPrivilege("2883de94-8873-4c66-8f9a-75d80c004acb"));
                        if (cEntity != null)
                        {
                            Cate_Name = cEntity.Cate_Name;
                        }
                        else
                        {
                            Cate_Name = pEntity.Product_CateID.ToString();
                        }
                    }
                    else
                    {
                        Product_Name = "";
                        //Product_Code = "";
                        Product_Spec  = "";
                        Supplier_Name = string.Empty;
                        Cate_Name     = string.Empty;
                    }
                    pEntity = null;

                    jsonBuilder.Append("{\"id\":" + Product_ID + ",\"cell\":[");

                    //各字段
                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(Product_ID);
                    jsonBuilder.Append("\",");

                    //jsonBuilder.Append("\"");
                    //jsonBuilder.Append(JsonStr(Product_Code));
                    //jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(JsonStr(Product_Name));
                    jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(JsonStr(Supplier_Name));
                    jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(JsonStr(Cate_Name));
                    jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(JsonStr(Product_Spec));
                    jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(saleCount);
                    jsonBuilder.Append("\",");

                    jsonBuilder.Append("\"");
                    jsonBuilder.Append(pub.FormatCurrency(saleSum));
                    jsonBuilder.Append("\",");

                    jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                    jsonBuilder.Append("]},");
                }
                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("]");
                jsonBuilder.Append("}");
                return(jsonBuilder.ToString());
            }
            else
            {
                return("");
            }
        }
        catch (Exception ex)
        {
            throw ex;
            return("");
        }
        finally
        {
            if (DtList != null)
            {
                DtList.Dispose();
                DtList = null;
            }
        }
    }
Esempio n. 11
0
 //根据编号获取促销专题
 public PromotionInfo GetPromotionByID(int ID)
 {
     return(MyBLL.GetPromotionByID(ID, pub.CreateUserPrivilege("0b16441f-dc42-4fd0-b8f1-0f8a80146771")));
 }