Example #1
0
 public void dataload()
 {
     //商品信息
     molgoodsinfo = bllgoodsinfo.GetModel(int.Parse(Request["id"]));
     Label1.Text = molgoodsinfo.Goods_name;
     lblgoods_name.Text = molgoodsinfo.Goods_name;
     lblgoods_info.Text = molgoodsinfo.Goods_info;
     lblgoods_Marketprice.Text = molgoodsinfo.Market_price.ToString();
     lblgoods_Stock.Text = molgoodsinfo.Stock.ToString();
     lblgoods_GBprice.Text = molgoodsinfo.In_store_price.ToString();
     lblgoods_salesnum.Text = molgoodsinfo.Sales_volume.ToString();
     lblgoods_id.Text = molshopcar.Goods_ID.ToString();
     Goods_img.ImageUrl = molgoodsinfo.Goods_pic;
     Goods_img_small.ImageUrl = molgoodsinfo.Goods_pic;
     lblgoods_status.Text = molgoodsinfo.GB_Status;
     lblgoods_status2.Text = molgoodsinfo.GB_Status;
     lblgoods_status3.Text = molgoodsinfo.GB_Status;
     if (lblgoods_status2.Text == "火热进行中")
     {
         string data1 = molgoodsinfo.FinishTime.ToString();
         data1 = data1.Replace(" 0:00:00", "");
         lblGBSoptime.Text = data1;
         lblGBPerNum.Text = molgoodsinfo.GroupPerNum.ToString();
         lblNowNum.Text = molgoodsinfo.NowPerNum.ToString();
         GBinfoboxcon.Visible = true;
         constatusbox2.Visible = true;
         Button1.Text = "参与团购";
     }
     else if (lblgoods_status.Text == "正在热卖中")
     {
         GBinfoboxcon.Visible = false;
         constatusbox.Visible = true;
         constatusbox2.Visible = false;
         Button1.Text = "加入购物车";
     }
     else if (lblgoods_status3.Text == "团购已完成")
     {
         funboxcon.Visible = false;
         Button1.Visible = false;
         constatusbox.Visible = false;
         constatusbox2.Visible = false;
         constatusbox3.Visible = true;
     }
     //商品详细图片
     moldetailimg = blldetailimg.GetModel(int.Parse(Request["id"]));
     Image1.ImageUrl = moldetailimg.Img_1.ToString();
     Image2.ImageUrl = moldetailimg.Img_2.ToString();
     lblgoods_noticename.Text = molgoodsinfo.Goods_name;
     lblgoods_brand.Text = molgoodsinfo.Good_Brand;
     //lblgoods_color.Text = molgoodsinfo.Color;
     lblgoods_qqp.Text = molgoodsinfo.Qqp;
     lblgoods_size.Text = molgoodsinfo.Size;
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TtNum1.BLL.GoodsInfo bllgoodsinfo = new TtNum1.BLL.GoodsInfo();
            TtNum1.Model.GoodsInfo modgoodsinfo = new TtNum1.Model.GoodsInfo();
            if (!IsPostBack)
            {
                if (Session["ht_username"] == null)
                {
                    Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>");
                    Response.Redirect("../Shopping.aspx");
                    ViewState["retu"] = Request.UrlReferrer.ToString();
                }

                else
                {
                    string a = Request.QueryString["Goods_ID"].ToString();
                    DataSet ds = bllgoodsinfo.GetList_gs(a);
                    if ( ds.Tables[0].Rows[0][0].ToString() != "0")
                    {

                        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该商品有订单信息无法删除!');location.href='index.aspx'</script>");

                    }

                    else
                    {
                        DataSet dt = bllgoodsinfo.GetList_gs3(a);

                        if (dt.Tables[0].Rows[0][0].ToString().Trim() != "0")
                        {
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该商品为团购商品,无法删除!');location.href='index.aspx'</script>");
                            return;
                        }

                        bllgoodsinfo.Delete(Convert.ToInt32(a));
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='index.aspx'</script>");

                    }
                }
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["ht_username"] == null)
                {
                    Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>");
                    Response.Redirect("../Shopping.aspx");
                    ViewState["retu"] = Request.UrlReferrer.ToString();
                }
                string a = Request.QueryString["GB_ID"].ToString();
                DataSet ds = bllGroupBuying.GetList_cyrs(a);
                if (ds.Tables[0].Rows[0][0].ToString() != "0")
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该订单有团购人数无法删除!');location.href='index.aspx'</script>");

                }

                else
                {
                    TtNum1.BLL.GoodsInfo bllGoodsInfo = new TtNum1.BLL.GoodsInfo();
                    TtNum1.Model.GoodsInfo modGoodsInfo = new TtNum1.Model.GoodsInfo();
                    modGoodsInfo.IN_group_buying = 0;
                    modGoodsInfo.Goods_ID =Convert.ToInt32(a);
                    bllGoodsInfo.Update(modGoodsInfo);
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='index.aspx'</script>");
                    //bllgoodsinfo.Delete(Convert.ToInt32(a));

                }
                //int a = Convert.ToInt32(Request.QueryString["GB_ID"].ToString());
                //bllGroupBuying.Delete(a);
                //Response.Write("<script language=javascript>alert('删除成功!')</script>");
                //Response.Redirect("index.aspx");

            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TtNum1.BLL.GoodSort2 bllGoodSort2 = new TtNum1.BLL.GoodSort2();
            TtNum1.Model.GoodSort2 modGoodSort2 = new TtNum1.Model.GoodSort2();

            TtNum1.BLL.GoodsInfo bllgoodsinfo = new TtNum1.BLL.GoodsInfo();
            TtNum1.Model.GoodsInfo modgoodsinfo = new TtNum1.Model.GoodsInfo();
            if (!IsPostBack)
            {
                //if (Session["ht_username"] == null)
                //{
                //    Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>");
                //    Response.Redirect("../Shopping.aspx");
                //    ViewState["retu"] = Request.UrlReferrer.ToString();
                //}

                //else
                //{
                    string a = Request.QueryString["S_ID"].ToString();
                    DataSet ds = bllgoodsinfo.GetList_gs2(a);
                    if (Convert.ToInt32( ds.Tables[0].Rows[0][0].ToString().Trim()) !=0)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该类有商品信息无法删除!');location.href='type_0.aspx'</script>");

                    }

                    else
                    {
                        bllgoodsinfo.Delete_2(a);
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='type_0.aspx'</script>");

                    }

                //}
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["Goods_ID"] == null)
                {
                    Response.Write("<script>window.alert('您没有选择商品,无法传值');window.location.href='index.aspx';</script>");

                }
                else
                {

                    //aa();
                    ViewState["BackUrl"] = Request.UrlReferrer.ToString();
                    string a = Request.QueryString["Goods_ID"].ToString();
                    modgoodsinfo = bllgoodsinfo.GetModel(Convert.ToInt32(a));
                    Goods_ID.Text = modgoodsinfo.Goods_ID.ToString();
                    DataTable dt = bllgoodsinfo.GetList1(a).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        Goods_ID.Text = dt.Rows[0]["Goods_ID"].ToString();
                        Goods_name.Text = dt.Rows[0]["Goods_name"].ToString();

                        Market_price.Text = dt.Rows[0]["Market_price"].ToString();

                        In_store_price.Text = dt.Rows[0]["In_store_price"].ToString();

                        Stock.Text = dt.Rows[0]["Stock"].ToString();

                        Image1.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();

                        Image2.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Goods_info.Text = dt.Rows[0]["Goods_info"].ToString();

                        Good_Brand.Text = dt.Rows[0]["Good_Brand"].ToString();

                        Qqp.Text = dt.Rows[0]["Qqp"].ToString();

                        //if (dt.Rows[0]["IN_group_buying"].ToString() == "1")
                        //{
                        //    IN_group_buying.Text = "是";
                        //    TextBox4.Text = "是";
                        //}
                        //else {
                        //    IN_group_buying.Text = "否";
                        //    TextBox4.Text = "否";
                        //}
                        Sales_volume.Text = dt.Rows[0]["Sales_volume"].ToString();
                        if (dt.Rows[0]["Group_Buying_Price"].ToString() == null || dt.Rows[0]["Group_Buying_Price"].ToString() == "")
                        {

                        }
                        //  Group_Buying_Price.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        // TextBox10.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        GS1.Text = dt.Rows[0]["Sort_name"].ToString();

                        GS2.Text = dt.Rows[0]["GS_name1"].ToString();
                        //DropDownList1.SelectedValue = dt.Rows[0]["Sort_name"].ToString();
                        //DropDownList2.SelectedValue = dt.Rows[0]["GS_name1"].ToString();

                        Image3.ImageUrl = dt.Rows[0]["Img_1"].ToString();

                        Image4.ImageUrl = dt.Rows[0]["Img_1"].ToString();
                        Image5.ImageUrl = dt.Rows[0]["Img_2"].ToString();
                        Image6.ImageUrl = dt.Rows[0]["Img_2"].ToString();

                        uptime.Text = dt.Rows[0]["uptime"].ToString();
                    }

                    string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["TtNum"].ConnectionString;
                    SqlConnection conn = new SqlConnection(connectionString);

                    SqlDataAdapter da = new SqlDataAdapter();
                    da.SelectCommand = new SqlCommand("select * from GoodSort", conn);
                    DataSet ds = new DataSet();
                    try
                    {
                        conn.Open();
                        da.Fill(ds, "GoodSort");
                        conn.Close();
                    }
                    catch (SqlException e2)
                    {
                        Response.Write(e2.ToString());
                    }
                    PagedDataSource obj = new PagedDataSource();
                    obj.DataSource = ds.Tables["GoodSort"].DefaultView;

                }

            }
        }
Example #6
0
        public TtNum1.Model.GoodsInfo GetModel_5(int Sort_ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(*) from goodsinfo,GoodSort2 where  goodsinfo.GS_id=GoodSort2.Sort2_ID and GoodsInfo.GS2=" + Sort_ID + " ");
            TtNum1.Model.GoodsInfo model = new TtNum1.Model.GoodsInfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0][0] != null && ds.Tables[0].Rows[0][0].ToString() != "")
                {
                    model.count = int.Parse(ds.Tables[0].Rows[0][0].ToString());
                }

                return model;
            }
            else
            {
                return null;
            }
        }
Example #7
0
        public TtNum1.Model.GoodsInfo GetModel_3(string Goods_ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(*) from [order],goodsinfo where goodsinfo.goods_id=[order].Goods_ID and  goodsinfo.goods_id=" + Goods_ID + " ");
            TtNum1.Model.GoodsInfo model = new TtNum1.Model.GoodsInfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0][0] != null && ds.Tables[0].Rows[0][0].ToString() != "")
                {
                    model.count = int.Parse(ds.Tables[0].Rows[0][0].ToString());
                }

                return model;
            }
            else
            {
                return null;
            }
        }
Example #8
0
        public TtNum1.Model.GoodsInfo GetModel_2(string swhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" select GoodSort.Sort_ID from GoodSort where GoodSort.Sort_name='" + swhere + "'");
            TtNum1.Model.GoodsInfo model = new TtNum1.Model.GoodsInfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                string a = ds.Tables[0].Rows[0]["Sort_ID"].ToString();
                return DataRowToModel_2(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
Example #9
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public TtNum1.Model.GoodsInfo GetModel(int Goods_ID)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select  top 1  ");
     strSql.Append(" Goods_ID,Goods_name,Market_price,Group_Buying_Price,In_store_price,Stock,Uptime,Goods_pic,Goods_info,Good_Brand,IN_group_buying,GroupPerNum,NowPerNum,StartTime,FinishTime,GB_Status,GS2,Sales_volume,GS_id,Message_ID,Color,Size,Qqp ");
     strSql.Append(" from GoodsInfo ");
     strSql.Append(" where Goods_ID=" + Goods_ID + "");
     TtNum1.Model.GoodsInfo model = new TtNum1.Model.GoodsInfo();
     DataSet ds = DbHelperSQL.Query(strSql.ToString());
     if (ds.Tables[0].Rows.Count > 0)
     {
         if (ds.Tables[0].Rows[0]["Goods_ID"] != null && ds.Tables[0].Rows[0]["Goods_ID"].ToString() != "")
         {
             model.Goods_ID = int.Parse(ds.Tables[0].Rows[0]["Goods_ID"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Goods_name"] != null && ds.Tables[0].Rows[0]["Goods_name"].ToString() != "")
         {
             model.Goods_name = ds.Tables[0].Rows[0]["Goods_name"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Market_price"] != null && ds.Tables[0].Rows[0]["Market_price"].ToString() != "")
         {
             model.Market_price = int.Parse(ds.Tables[0].Rows[0]["Market_price"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Group_Buying_Price"] != null && ds.Tables[0].Rows[0]["Group_Buying_Price"].ToString() != "")
         {
             model.Group_Buying_Price = int.Parse(ds.Tables[0].Rows[0]["Group_Buying_Price"].ToString());
         }
         if (ds.Tables[0].Rows[0]["In_store_price"] != null && ds.Tables[0].Rows[0]["In_store_price"].ToString() != "")
         {
             model.In_store_price = int.Parse(ds.Tables[0].Rows[0]["In_store_price"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Stock"] != null && ds.Tables[0].Rows[0]["Stock"].ToString() != "")
         {
             model.Stock = int.Parse(ds.Tables[0].Rows[0]["Stock"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Uptime"] != null && ds.Tables[0].Rows[0]["Uptime"].ToString() != "")
         {
             model.Uptime = DateTime.Parse(ds.Tables[0].Rows[0]["Uptime"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Goods_pic"] != null && ds.Tables[0].Rows[0]["Goods_pic"].ToString() != "")
         {
             model.Goods_pic = ds.Tables[0].Rows[0]["Goods_pic"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Goods_info"] != null && ds.Tables[0].Rows[0]["Goods_info"].ToString() != "")
         {
             model.Goods_info = ds.Tables[0].Rows[0]["Goods_info"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Good_Brand"] != null && ds.Tables[0].Rows[0]["Good_Brand"].ToString() != "")
         {
             model.Good_Brand = ds.Tables[0].Rows[0]["Good_Brand"].ToString();
         }
         if (ds.Tables[0].Rows[0]["IN_group_buying"] != null && ds.Tables[0].Rows[0]["IN_group_buying"].ToString() != "")
         {
             model.IN_group_buying = int.Parse(ds.Tables[0].Rows[0]["IN_group_buying"].ToString());
         }
         if (ds.Tables[0].Rows[0]["GroupPerNum"] != null && ds.Tables[0].Rows[0]["GroupPerNum"].ToString() != "")
         {
             model.GroupPerNum = int.Parse(ds.Tables[0].Rows[0]["GroupPerNum"].ToString());
         }
         if (ds.Tables[0].Rows[0]["NowPerNum"] != null && ds.Tables[0].Rows[0]["NowPerNum"].ToString() != "")
         {
             model.NowPerNum = int.Parse(ds.Tables[0].Rows[0]["NowPerNum"].ToString());
         }
         if (ds.Tables[0].Rows[0]["StartTime"] != null && ds.Tables[0].Rows[0]["StartTime"].ToString() != "")
         {
             model.StartTime = DateTime.Parse(ds.Tables[0].Rows[0]["StartTime"].ToString());
         }
         if (ds.Tables[0].Rows[0]["FinishTime"] != null && ds.Tables[0].Rows[0]["FinishTime"].ToString() != "")
         {
             model.FinishTime = DateTime.Parse(ds.Tables[0].Rows[0]["FinishTime"].ToString());
         }
         if (ds.Tables[0].Rows[0]["GB_Status"] != null && ds.Tables[0].Rows[0]["GB_Status"].ToString() != "")
         {
             model.GB_Status = ds.Tables[0].Rows[0]["GB_Status"].ToString();
         }
         if (ds.Tables[0].Rows[0]["GS2"] != null && ds.Tables[0].Rows[0]["GS2"].ToString() != "")
         {
             model.GS2 = ds.Tables[0].Rows[0]["GS2"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Sales_volume"] != null && ds.Tables[0].Rows[0]["Sales_volume"].ToString() != "")
         {
             model.Sales_volume = int.Parse(ds.Tables[0].Rows[0]["Sales_volume"].ToString());
         }
         if (ds.Tables[0].Rows[0]["GS_id"] != null && ds.Tables[0].Rows[0]["GS_id"].ToString() != "")
         {
             model.GS_id = int.Parse(ds.Tables[0].Rows[0]["GS_id"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Message_ID"] != null && ds.Tables[0].Rows[0]["Message_ID"].ToString() != "")
         {
             model.Message_ID = int.Parse(ds.Tables[0].Rows[0]["Message_ID"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Color"] != null && ds.Tables[0].Rows[0]["Color"].ToString() != "")
         {
             model.Color = ds.Tables[0].Rows[0]["Color"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Size"] != null && ds.Tables[0].Rows[0]["Size"].ToString() != "")
         {
             model.Size = ds.Tables[0].Rows[0]["Size"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Qqp"] != null && ds.Tables[0].Rows[0]["Qqp"].ToString() != "")
         {
             model.Qqp = ds.Tables[0].Rows[0]["Qqp"].ToString();
         }
         return model;
     }
     else
     {
         return null;
     }
 }
Example #10
0
        public TtNum1.Model.GoodsInfo DataRowToModel_2(DataRow row)
        {
            TtNum1.Model.GoodsInfo model = new TtNum1.Model.GoodsInfo();
            if (row != null)
            {
                if (row["Sort_ID"] != null && row["Sort_ID"].ToString() != "")
                {
                    model.Sort_ID2 = int.Parse(row["Sort_ID"].ToString());
                }

            }
            return model;
        }
Example #11
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public TtNum1.Model.GoodsInfo GetModel(int Goods_ID)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("select  top 1  ");
     strSql.Append(" Goods_ID,Goods_name,Market_price,In_store_price,Stock,Uptime,Goods_pic,Goods_info,Good_Brand,IN_group_buying,GS2,Sales_volume,GS_id,Group_Buying_Price,Message_ID ");
     strSql.Append(" from GoodsInfo ");
     strSql.Append(" where Goods_ID="+Goods_ID+"" );
     TtNum1.Model.GoodsInfo model=new TtNum1.Model.GoodsInfo();
     DataSet ds=DbHelperSQL.Query(strSql.ToString());
     if(ds.Tables[0].Rows.Count>0)
     {
         return DataRowToModel(ds.Tables[0].Rows[0]);
     }
     else
     {
         return null;
     }
 }
Example #12
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public TtNum1.Model.GoodsInfo DataRowToModel(DataRow row)
 {
     TtNum1.Model.GoodsInfo model=new TtNum1.Model.GoodsInfo();
     if (row != null)
     {
         if(row["Goods_ID"]!=null && row["Goods_ID"].ToString()!="")
         {
             model.Goods_ID=int.Parse(row["Goods_ID"].ToString());
         }
         if(row["Goods_name"]!=null)
         {
             model.Goods_name=row["Goods_name"].ToString();
         }
         if(row["Market_price"]!=null && row["Market_price"].ToString()!="")
         {
             model.Market_price=decimal.Parse(row["Market_price"].ToString());
         }
         if(row["In_store_price"]!=null && row["In_store_price"].ToString()!="")
         {
             model.In_store_price=decimal.Parse(row["In_store_price"].ToString());
         }
         if(row["Stock"]!=null && row["Stock"].ToString()!="")
         {
             model.Stock=int.Parse(row["Stock"].ToString());
         }
         if(row["Uptime"]!=null && row["Uptime"].ToString()!="")
         {
             model.Uptime=DateTime.Parse(row["Uptime"].ToString());
         }
         if(row["Goods_pic"]!=null)
         {
             model.Goods_pic=row["Goods_pic"].ToString();
         }
         if(row["Goods_info"]!=null)
         {
             model.Goods_info=row["Goods_info"].ToString();
         }
         if(row["Good_Brand"]!=null)
         {
             model.Good_Brand=row["Good_Brand"].ToString();
         }
         if(row["IN_group_buying"]!=null && row["IN_group_buying"].ToString()!="")
         {
             model.IN_group_buying=int.Parse(row["IN_group_buying"].ToString());
         }
         if(row["GS2"]!=null)
         {
             model.GS2=row["GS2"].ToString();
         }
         if(row["Sales_volume"]!=null && row["Sales_volume"].ToString()!="")
         {
             model.Sales_volume=int.Parse(row["Sales_volume"].ToString());
         }
         if(row["GS_id"]!=null && row["GS_id"].ToString()!="")
         {
             model.GS_id=int.Parse(row["GS_id"].ToString());
         }
         if(row["Group_Buying_Price"]!=null && row["Group_Buying_Price"].ToString()!="")
         {
             model.Group_Buying_Price=decimal.Parse(row["Group_Buying_Price"].ToString());
         }
         if(row["Message_ID"]!=null && row["Message_ID"].ToString()!="")
         {
             model.Message_ID=int.Parse(row["Message_ID"].ToString());
         }
     }
     return model;
 }
Example #13
0
        //TtNum1.BLL.GroupBuying bllGroupBuying = new TtNum1.BLL.GroupBuying();
        //TtNum1.Model.GroupBuying modGroupBuying = new TtNum1.Model.GroupBuying();
        //TtNum1.BLL.Order_GB bllOrder_GB = new TtNum1.BLL.Order_GB();
        //TtNum1.Model.Order_GB modOrder_GB = new TtNum1.Model.Order_GB();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["GB_ID"] == null)
                {
                    Response.Write("<script>window.alert('您没有选择团购活动,无法传值');");
                    Response.Redirect("index.aspx");
                }
                else
                {
                    RadButton2.Visible = false;
                    RadButton3.Visible = false;
                    ViewState["BackUrl"] = Request.UrlReferrer.ToString();
                    string a = Request.QueryString["GB_ID"].ToString();
                    modGoodsInfo = bllGoodsInfo.GetModel(Convert.ToInt16(a));
                    Goods_ID.Text = modGoodsInfo.Goods_ID.ToString();
                    DataTable dt = bllGoodsInfo.GetList("Goods_ID="+a+"").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        Goods_name.Text = dt.Rows[0]["Goods_name"].ToString();

                        string date = dt.Rows[0]["StartTime"].ToString();
                        date = date.Replace(" 0:00:00", "");

                        string date1 = dt.Rows[0]["FinishTime"].ToString();
                        date1 = date1.Replace(" 0:00:00", "");

                        Image1.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Image2.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();

                        Market_price.Text = dt.Rows[0]["Market_price"].ToString();
                        Label1.Text = dt.Rows[0]["Goods_ID"].ToString();
                        Label2.Text = dt.Rows[0]["Goods_ID"].ToString();

                        In_store_price.Text = dt.Rows[0]["In_store_price"].ToString();
                        TextBox2.Text = dt.Rows[0]["In_store_price"].ToString();

                        StartTime.Text = date.ToString().Trim();
                        RadDatePicker1.SelectedDate = Convert.ToDateTime(dt.Rows[0]["StartTime"].ToString());

                        FinishTime.Text = date1.ToString().Trim();
                        RadDatePicker2.SelectedDate = Convert.ToDateTime(dt.Rows[0]["FinishTime"].ToString());

                        GroupPerNum.Text = dt.Rows[0]["GroupPerNum"].ToString();
                        TextBox5.Text = dt.Rows[0]["GroupPerNum"].ToString();

                    //    GB_participantsNumber.Text = dt.Rows[0]["GB_participantsNumber"].ToString();
                        string b = dt.Rows[0]["Goods_ID"].ToString();

                        NowPerNum.Text = "当前参与人数为:" + dt.Rows[0]["NowPerNum"].ToString() + "人";
                        Label3.Text = dt.Rows[0]["NowPerNum"].ToString();
                        if (Convert.ToInt32(dt.Rows[0]["NowPerNum"].ToString()) == 0)
                        {
                            LinkButton2.Visible = false;
                        }

                        GB_Status.Text = dt.Rows[0]["GB_Status"].ToString();

                        if (Convert.ToInt32(dt.Rows[0]["NowPerNum"].ToString()) == Convert.ToInt32(dt.Rows[0]["GroupPerNum"].ToString()))
                        {
                            GB_Status.Text = "团购已完成";
                            modGoodsInfo.Goods_ID = Convert.ToInt32(Goods_ID.Text);
                            modGoodsInfo.GB_Status = GB_Status.Text;
                            bllGoodsInfo.Update(modGoodsInfo);
                            RadButton1.Visible = false;
                        }
                        else
                        {
                            modGoodsInfo.Goods_ID = Convert.ToInt32(Goods_ID.Text);
                            modGoodsInfo.GB_Status = GB_Status.Text;
                            bllGoodsInfo.Update(modGoodsInfo);
                        }
                        //RadComboBox1.SelectedValue = dt.Rows[0]["GB_Status"].ToString();

                    }

                }
            }
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["Goods_ID"] == null)
                {
                    Response.Write("<script>window.alert('您没有选择商品,无法传值');window.location.href='index.aspx';</script>");

                }
                else
                {
                    string b = Request.QueryString["U_ID"].ToString();
                    DataTable aa = bllOrderinfo.GetList("[Orderinfo].U_ID="+b+"").Tables[0];
                    if (aa.Rows.Count > 0)
                    {
                        num.Text = aa.Rows[0]["Goods_Num"].ToString();
                    }

                    ViewState["BackUrl"] = Request.UrlReferrer.ToString();
                    string a = Request.QueryString["Goods_ID"].ToString();
                    modgoodsinfo = bllgoodsinfo.GetModel(Convert.ToInt16(a));
                    Goods_ID.Text = a;
                    DataTable dt = bllgoodsinfo.GetList1(a).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        Goods_ID.Text = dt.Rows[0]["Goods_ID"].ToString();
                        Goods_name.Text = dt.Rows[0]["Goods_name"].ToString();

                        Market_price.Text = dt.Rows[0]["Market_price"].ToString();

                        In_store_price.Text = dt.Rows[0]["In_store_price"].ToString();

                        Stock.Text = dt.Rows[0]["Stock"].ToString();

                        Image1.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Image2.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Goods_info.Text = dt.Rows[0]["Goods_info"].ToString();
                        Label5.Text = dt.Rows[0]["GB_Status"].ToString();
                        string tg = dt.Rows[0]["IN_group_buying"].ToString();
                        if (tg.Trim()!="0")
                        {

                            t1.Visible = true;
                            t2.Visible = true;
                            t3.Visible = true;
                            t4.Visible = true;
                            //Label1.Text = dt.Rows[0]["StartTime"].ToString();
                            string date3 = dt.Rows[0]["StartTime"].ToString();
                            date3 = date3.Replace(" 0:00:00", "");
                            Label1.Text = date3.ToString().Trim();

                            string date1 = dt.Rows[0]["FinishTime"].ToString();
                            date1 = date1.Replace(" 0:00:00", "");
                            Label2.Text = date1.ToString().Trim();

                            Label3.Text = dt.Rows[0]["NowPerNum"].ToString();
                            Label4.Text = dt.Rows[0]["GroupPerNum"].ToString();
                        }

                        Good_Brand.Text = dt.Rows[0]["Good_Brand"].ToString();

                        Qqp.Text = dt.Rows[0]["Qqp"].ToString();

                        if (dt.Rows[0]["IN_group_buying"].ToString() == "1")
                        {
                            IN_group_buying.Text = "是";

                        }
                        else
                        {
                            IN_group_buying.Text = "否";

                        }
                        Sales_volume.Text = dt.Rows[0]["Sales_volume"].ToString();
                        if (dt.Rows[0]["Group_Buying_Price"].ToString() == "" || dt.Rows[0]["Group_Buying_Price"].ToString() == null)
                        {
                            Group_Buying_Price.Text = "该商品未设置团购信息";
                        }
                        else
                        {
                            Group_Buying_Price.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        }
                        // TextBox10.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        GS1.Text = dt.Rows[0]["Sort_name"].ToString();

                        GS2.Text = dt.Rows[0]["GS_name1"].ToString();

                        Image3.ImageUrl = dt.Rows[0]["Img_1"].ToString();
                        Image4.ImageUrl = dt.Rows[0]["Img_1"].ToString();
                        Image5.ImageUrl = dt.Rows[0]["Img_2"].ToString();
                        Image6.ImageUrl = dt.Rows[0]["Img_2"].ToString();
                        string date = dt.Rows[0]["uptime"].ToString();
                        date = date.Replace(" 0:00:00", "");
                        uptime.Text = date.ToString().Trim();
                    }
                }

            }
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["Goods_ID"] == null)
                {
                    Response.Write("<script>window.alert('您没有选择公告,无法传值');window.location=index.aspx;</script>");
                }
                else
                {

                    ViewState["BackUrl"] = Request.UrlReferrer.ToString();
                    string a = Request.QueryString["Goods_ID"].ToString();
                    modgoodsinfo = bllgoodsinfo.GetModel(Convert.ToInt16(a));
                    Goods_ID.Text = modgoodsinfo.Goods_ID.ToString();
                    DataTable dt = bllgoodsinfo.GetList1(a).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        Goods_ID.Text = dt.Rows[0]["Goods_ID"].ToString();
                        Goods_name.Text = dt.Rows[0]["Goods_name"].ToString();

                        Market_price.Text = dt.Rows[0]["Market_price"].ToString();

                        In_store_price.Text = dt.Rows[0]["In_store_price"].ToString();

                        Stock.Text = dt.Rows[0]["Stock"].ToString();

                        Image1.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Image2.ImageUrl = dt.Rows[0]["Goods_pic"].ToString();
                        Goods_info.Text = dt.Rows[0]["Goods_info"].ToString();

                        Good_Brand.Text = dt.Rows[0]["Good_Brand"].ToString();

                        Qqp.Text = dt.Rows[0]["Qqp"].ToString();
                        TextBox12.Text = dt.Rows[0]["Qqp"].ToString();
                        if (dt.Rows[0]["IN_group_buying"].ToString() == "1")
                        {
                            IN_group_buying.Text = "是";

                        }
                        else
                        {
                            IN_group_buying.Text = "否";

                        }
                        Sales_volume.Text = dt.Rows[0]["Sales_volume"].ToString();
                        TextBox9.Text = dt.Rows[0]["Sales_volume"].ToString();
                        if (dt.Rows[0]["Group_Buying_Price"].ToString() == "" || dt.Rows[0]["Group_Buying_Price"].ToString() == null)
                        {
                            Group_Buying_Price.Text = "该商品未设置团购信息";
                        }
                        else
                        {
                            Group_Buying_Price.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        }

                        TextBox10.Text = dt.Rows[0]["Group_Buying_Price"].ToString();
                        GS1.Text = dt.Rows[0]["Sort_name"].ToString();

                        GS2.Text = dt.Rows[0]["GS_name1"].ToString();

                        Image3.ImageUrl = dt.Rows[0]["Img_1"].ToString();
                        Image4.ImageUrl = dt.Rows[0]["Img_1"].ToString();
                        Image5.ImageUrl = dt.Rows[0]["Img_2"].ToString();
                        Image6.ImageUrl = dt.Rows[0]["Img_2"].ToString();

                        uptime.Text = dt.Rows[0]["uptime"].ToString();
                    }
                }

            }
        }