示例#1
0
    /// <summary>
    /// 绑定国家
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddlCombineProduct.Items.Clear();
        DataTable dt = ProductCombine.GetCombineProduct(ddlCountry.SelectedValue);

        foreach (DataRow dr in dt.Rows)
        {
            ddlCombineProduct.Items.Add(new ListItem(dr["productname"].ToString(), dr["productid"].ToString()));
        }
        ddlCombineProduct.Items.Insert(0, new ListItem(GetTran("000303", "请选择"), "0"));
        treeid.InnerHtml = new ProductTree().getMenuZhuHe(ddlCountry.SelectedValue);
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Permissions.ComRedirect(Page, Permissions.redirUrl);
     if (!IsPostBack)
     {
         Response.Cache.SetExpires(DateTime.Now);
         Permissions.CheckManagePermission(EnumCompanyPermission.StorageAdminCombineProduct);
         DataTable dt = ProductCombine.GetCountry();
         foreach (DataRow dr in dt.Rows)
         {
             ddlCountry.Items.Add(new ListItem(dr["name"].ToString(), dr["countrycode"].ToString()));
         }
         ddlCountry_SelectedIndexChanged(null, null);
     }
 }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        string pid = Request.Form["pid"];

        if (Request.Form["tp"] == "1")
        {
            string isyw = "";//是否发生业务

            if (CombineProductBLL.CheckWheatherChangeCombineProduct(Convert.ToInt32(pid)))
            {
                isyw = "<isyw>y</isyw>";//可以修改组合产品
            }
            else
            {
                isyw = "<isyw>n</isyw>";
            }

            string dataxml = "<root>";

            DataTable dt = ProductCombine.GetCombine(pid);

            foreach (DataRow dr in dt.Rows)
            {
                dataxml = dataxml + "<hang><productid>" + dr["productid"] + "</productid><productcode>" + dr["productcode"] + "</productcode><productname>" + dr["productname"] + "</productname><preferentialprice>" + dr["preferentialprice"] + "</preferentialprice><preferentialpv>" + dr["preferentialpv"] + "</preferentialpv><quantity>" + dr["quantity"] + "</quantity><zje>" + dr["zje"] + "</zje><zjf>" + dr["zjf"] + "</zjf></hang>";
            }

            dataxml = dataxml + "</root>";

            dataxml = "<?xml version='1.0' encoding='utf-8' ?>" + dataxml.Replace("</root>", isyw + "</root>");

            Response.ContentType = "text/xml";
            Response.Write(dataxml);
        }
        else if (Request.Form["tp"] == "2")
        {
            if (ProductCombine.DelProductById(Request.Form["zhpid"].ToString(), pid))
            {
                Response.Write("c");
            }
            else
            {
                Response.Write("s");
            }
        }
        else if (Request.Form["tp"] == "3")
        {
            int aa = Convert.ToInt32(Request.Form["zhpid"]);

            if (CombineProductBLL.CheckWheatherChangeCombineProduct(aa))
            {
                if (ProductCombine.IsExistProductById(aa, pid))
                {
                    if (ProductCombine.UpdateProductById(aa, pid))
                    {
                        Response.Write("e");
                    }
                }
                else
                {
                    int hs = ProductCombine.InsertProductById(aa, pid);

                    if (hs == 1)
                    {
                        Response.Write("c");
                    }
                    else
                    {
                        Response.Write("s");
                    }
                }
            }
            else
            {
                Response.Write("i");
            }
        }

        else if (Request.Form["tp"] == "7")
        {
            if (ProductCombine.UpdateProductCountById(Request.Form["zhpid"].Split('*')[0].ToString(), Request.Form["zhpid"].Split('*')[1].ToString(), pid))
            {
                Response.Write("c");
            }
            else
            {
                Response.Write("s");
            }
        }
        Response.End();
    }