Beispiel #1
0
    protected void btnPublic_Click1(object sender, EventArgs e)
    {
        string phonename = txtphonename.Text.ToString();

        string uname = Session["name"].ToString();
        select_id_viewTableAdapter selid = new select_id_viewTableAdapter();
        DataTable dtid     = selid.selectidbyuname(uname);
        string    owner    = dtid.Rows[0][0].ToString();
        Guid      sellerid = new Guid();

        sellerid = Guid.Parse(owner);
        string shopname = dtid.Rows[0][1].ToString();
        string brand    = ddlbrand.SelectedItem.Text;
        string version  = ddlversion.SelectedItem.Text;
        string color    = ddlcolor.SelectedItem.Text;

        string priceint = ddlpriceinterval.SelectedItem.Text;

        string[] sArray = priceint.Split('-');
        string   str1   = sArray[0].ToString().Trim();
        string   str2   = sArray[1].ToString().Trim();
        int      low    = Convert.ToInt32(str1.ToString());
        int      high   = Convert.ToInt32(str2.ToString());


        string   os           = ddlos.SelectedItem.Text;
        string   cpu          = ddlcpu.SelectedItem.Text;
        string   type         = ddltype.SelectedItem.Text;
        string   piexl        = ddlpixel.SelectedItem.Text;
        string   screen       = ddlscreensize.SelectedItem.Text;
        int      quantity     = Convert.ToInt32(txtquantity.Text);
        int      price        = Convert.ToInt32(txtprice.Text);
        string   introduction = txtintroduce.Text;
        string   image        = img;
        DateTime starttime    = DateTime.Today;
        DateTime selltime     = DateTime.Today;
        string   state        = "1";

        if (price > high || price < low)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n您输入的商品价格与选择的价格区间不符!\\n请重新选择区间');", true);
            return;
        }

        QueriesTableAdapter insertinfo = new QueriesTableAdapter();
        int result = insertinfo.proc_insertphoneinfo(phonename, sellerid, shopname, brand, version, color, low, high, os, cpu, type, piexl, screen, quantity, price, introduction, image, starttime, selltime, state);

        if (result == -1)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品插入成功!');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品信息由于一些原因审核失败!');", true);
        }
    }
Beispiel #2
0
    protected void btnPublic_Click1(object sender, EventArgs e)
    {
        string phonename = txtphonename.Text.ToString();

           string uname = Session["name"].ToString();
           select_id_viewTableAdapter selid = new select_id_viewTableAdapter();
           DataTable dtid = selid.selectidbyuname(uname);
           string owner = dtid.Rows[0][0].ToString();
           Guid sellerid = new Guid();
           sellerid = Guid.Parse(owner);
           string shopname = dtid.Rows[0][1].ToString();
           string brand = ddlbrand.SelectedItem.Text;
           string version = ddlversion.SelectedItem.Text;
           string color = ddlcolor.SelectedItem.Text;

           string priceint = ddlpriceinterval.SelectedItem.Text;
           string[] sArray = priceint.Split('-');
           string str1 = sArray[0].ToString().Trim();
           string str2 = sArray[1].ToString().Trim();
           int low = Convert.ToInt32(str1.ToString());
           int high = Convert.ToInt32(str2.ToString());

           string os = ddlos.SelectedItem.Text;
           string cpu = ddlcpu.SelectedItem.Text;
           string type = ddltype.SelectedItem.Text;
           string piexl = ddlpixel.SelectedItem.Text;
           string screen = ddlscreensize.SelectedItem.Text;
           int quantity = Convert.ToInt32(txtquantity.Text);
           int price = Convert.ToInt32(txtprice.Text);
           string introduction = txtintroduce.Text;
           string image = img;
           DateTime starttime =  DateTime.Today;
           DateTime selltime = DateTime.Today;
           string state = "1";

           if (price > high || price < low)
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n您输入的商品价格与选择的价格区间不符!\\n请重新选择区间');", true);
           return;
           }

           QueriesTableAdapter insertinfo = new QueriesTableAdapter();
           int result = insertinfo.proc_insertphoneinfo(phonename,sellerid,shopname,brand,version,color,low,high,os,cpu,type,piexl,screen,quantity,price,introduction,image,starttime,selltime,state);

           if (result==-1)
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品插入成功!');", true);

           }
           else
           {
           ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('温馨提示:\\n\\n商品信息由于一些原因审核失败!');", true);

           }
    }