Exemple #1
0
    /// <summary>
    /// 获得购物车列表
    /// </summary>
    public static IList <cart_items> GetList()
    {
        IDictionary <string, int> dic = GetCart();

        if (dic != null)
        {
            IList <cart_items> iList = new List <cart_items>();

            foreach (var item in dic)
            {
                tbl_product model = new tbl_product();
                model.GetModel(Convert.ToInt32(item.Key.Split('|')[0]));

                cart_items modelt = new cart_items();
                modelt.id                  = model.pro_id;
                modelt.title               = model.pro_name;
                modelt.goprice             = Utils.StrToDecimal(model.go_price.ToString(), 0);
                modelt.img_url             = model.pro_imgs;
                modelt.product_category_id = Convert.ToInt32(model.pro_pid);
                modelt.dw                  = model.pro_danwei;
                modelt.price               = Utils.StrToDecimal(model.salse_price.ToString(), 0);
                modelt.quantity            = item.Value;
                modelt.shuxing             = item.Key.Split('|')[1];
                modelt.key_shuxing         = item.Key;
                iList.Add(modelt);
            }
            return(iList);
        }
        return(null);
    }
Exemple #2
0
    private void ShowInfo(int _id)
    {
        tbl_product model1 = new tbl_product();

        model1.GetModel(_id);


        this.ddlproduct_category_id.SelectedValue = model1.pro_pid.ToString();
        this.txtdw.Text           = model1.pro_danwei;
        this.txtImgUrl.Text       = model1.pro_imgs;
        this.txtImgUrl1.Text      = model1.pro_imgs1;
        this.txtImgUrl2.Text      = model1.pro_imgs2;
        this.txtproduct_name.Text = model1.pro_name;
        this.txtgo_price.Text     = MyConvert(model1.go_price.ToString());
        this.txtsalse_price.Text  = MyConvert(model1.salse_price.ToString());
        //this.pv.Text = MyConvert(model1.pro_PV.ToString());
        this.txtContent.Value        = model1.pro_memo.ToString();
        this.attribute.SelectedValue = model1.pro_level.ToString();//属性绑定
        this.txtproduct_num.Text     = model1.pro_num.ToString();
        //if (model1.pro_type == 0)
        //{
        //    this.cbIsLock.Checked = true;
        //}
        //if (model1.flag == 0)
        //{
        //    this.shengji.Checked = true;
        //}
        if (model1.pro_isok == 1)
        {
            this.pro_isok.Checked = true;
        }
        else
        {
            this.pro_isok.Checked = false;
        }

        if (model1.pro_home_show == 1)
        {
            this.pro_home_show.Checked = true;
        }
        else
        {
            this.pro_home_show.Checked = false;
        }

        if (model1.pro_Hot == 1)
        {
            this.pro_Hot.Checked = true;
        }
        else
        {
            this.pro_Hot.Checked = false;
        }
        this.ddlprov.SelectedValue = model1.province_id.ToString();
        this.ddlcity.SelectedValue = model1.city_id.ToString();
        this.ddlarea.SelectedValue = model1.dictrict_id.ToString();
        //this.shop.Text = MyConvert(model1.shop_fen.ToString());
        //this.yun.Text = MyConvert(model1.cloud_fen.ToString());
        //this.chongxiao.Text = MyConvert(model1.futou_fen.ToString());
    }
Exemple #3
0
    // 可以订购
    protected void lbtnRefuseCaDG_Click(object sender, EventArgs e)
    {
        this.page = AXRequest.GetQueryInt("page", 1);
        // 当前点击的按钮
        LinkButton  lb   = (LinkButton)sender;
        int         caId = int.Parse(lb.CommandArgument);
        tbl_product bll  = new tbl_product();

        bll.GetModel(caId);
        bll.pro_id   = caId;
        bll.pro_isok = 1;
        bll.UpdateXS(); //更新是否暂停订购

        mym.JscriptMsg(this.Page, " 设置成功!", Utils.CombUrlTxt("pro_list.aspx", "product_category_id={0}&note_no={1}", this.product_category_id.ToString(), txtNote_no.Text), "Success");
    }
Exemple #4
0
    private void procityareabind(int _id)
    {
        tbl_product model1 = new tbl_product();

        model1.GetModel(_id);

        T_Province bll = new T_Province();
        DataTable  dt  = bll.GetList("1=1 order by ProSort").Tables[0];

        this.ddlprov.Items.Clear();
        this.ddlprov.Items.Add(new ListItem("请选择...", ""));
        foreach (DataRow dr in dt.Rows)
        {
            string Id    = dr["ProID"].ToString();
            string Title = dr["ProName"].ToString().Trim();
            this.ddlprov.Items.Add(new ListItem(Title, Id));
        }

        string    proid = model1.province_id.ToString();
        T_City    bllc  = new T_City();
        DataTable dtc   = bllc.GetList("1=1 and ProID='" + proid + "' order by CitySort").Tables[0];

        this.ddlcity.Items.Clear();
        this.ddlcity.Items.Add(new ListItem("请选择...", ""));
        foreach (DataRow dr in dtc.Rows)
        {
            string Id    = dr["CityID"].ToString();
            string Title = dr["CityName"].ToString().Trim();
            this.ddlcity.Items.Add(new ListItem(Title, Id));
        }

        string     cityid = model1.city_id.ToString();
        T_District blld   = new T_District();
        DataTable  dtd    = blld.GetList("1=1 and CityID='" + cityid + "' order by DisSort").Tables[0];

        this.ddlarea.Items.Clear();
        this.ddlarea.Items.Add(new ListItem("请选择...", ""));
        foreach (DataRow dr in dtd.Rows)
        {
            string Id    = dr["Id"].ToString();
            string Title = dr["DisName"].ToString().Trim();
            this.ddlarea.Items.Add(new ListItem(Title, Id));
        }
    }
Exemple #5
0
    // 单个删除
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        // 当前点击的按钮
        LinkButton  lb   = (LinkButton)sender;
        int         caId = int.Parse(lb.CommandArgument);
        tbl_product bll  = new tbl_product();

        bll.GetModel(caId);
        string title = bll.pro_name;

        string sql = "select aa=count(*) from tbl_order_goods where goods_id=" + caId + "";

        if (int.Parse(DbHelperSQL.GetDataRow(sql)["aa"].ToString()) > 0)
        {
            mym.JscriptMsg(this.Page, "很抱歉, 会员的订单中有该产品", "", "Error");
            return;
        }
        bll.Delete(caId);
        // mym.AddAdminLog("删除", "删除公告:" + title + ""); //记录日志
        mym.JscriptMsg(this.Page, " 成功删除产品:" + title + "", Utils.CombUrlTxt("pro_list.aspx", "product_category_id={0}&note_no={1}", this.product_category_id.ToString(), txtNote_no.Text), "Success");
    }
Exemple #6
0
    private bool DoEdit(int _id)
    {
        bool        result = false;
        tbl_product model  = new tbl_product();

        model.GetModel(_id);

        model.pro_imgs    = this.txtImgUrl.Text;
        model.pro_imgs1   = txtImgUrl1.Text;
        model.pro_imgs2   = txtImgUrl2.Text;
        model.pro_pid     = int.Parse(ddlproduct_category_id.SelectedValue);
        model.pro_name    = txtproduct_name.Text;
        model.pro_danwei  = txtdw.Text;
        model.go_price    = Convert.ToDecimal(this.txtgo_price.Text);
        model.salse_price = Convert.ToDecimal(this.txtsalse_price.Text);
        //model.pro_PV = Convert.ToDecimal(this.pv.Text);
        model.province_id = int.Parse(this.ddlprov.SelectedValue);
        model.city_id     = int.Parse(this.ddlcity.SelectedValue);
        model.dictrict_id = int.Parse(this.ddlarea.SelectedValue);
        model.pro_memo    = txtContent.Value;
        //model.futou_fen = Convert.ToDecimal(chongxiao.Text.Trim());
        //model.shop_fen = Convert.ToDecimal(shop.Text.Trim());
        //model.cloud_fen = Convert.ToDecimal(yun.Text.Trim());
        model.pro_num = int.Parse(txtproduct_num.Text.Trim());
        //if (this.cbIsLock.Checked == true)
        //{
        //    model.pro_type = 0;
        //}
        //else
        //{
        model.pro_type = 1;

        //}
        //if (this.shengji.Checked == true)
        //{
        //    model.flag = 0;
        //}
        //else
        //{
        model.flag = 1;

        //}
        if (this.pro_isok.Checked == true)
        {
            model.pro_isok = 1;
        }
        else
        {
            model.pro_isok = 0;
        }

        if (pro_home_show.Checked == true)//首页是否显示
        {
            model.pro_home_show = 1;
        }
        else
        {
            model.pro_home_show = 0;
        }

        if (pro_Hot.Checked == true)//首页是否热销产品
        {
            model.pro_Hot = 1;
        }
        else
        {
            model.pro_Hot = 0;
        }
        model.pro_level = int.Parse(attribute.SelectedValue);//商品属性添加
        if (model.Update())
        {
            result = true;
        }

        return(result);
    }