Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TtNum1.BLL.Order bllOrder = new TtNum1.BLL.Order();
                TtNum1.Model.Order molOrder = new TtNum1.Model.Order();

                bllGoodsInfo.Update_gx3(DateTime.Now.ToString());
                bllGoodsInfo.Update_gx(DateTime.Now.ToString());
                bllGoodsInfo.Update_gx1();
                bllGoodsInfo.Update_gx2(DateTime.Now.ToString());
                //bllGoodsInfo.Update_ywc();
                //DataSet getGBstylenum = bllOrderinfo.getGBStyle();
                //int GBstylenum = Int32.Parse(getGBstylenum.Tables[0].Rows[0][0].ToString());
                //DataSet getGBstylenum2 = bllOrderinfo.getGBStyle2();
                //int GBstylenum2 = Int32.Parse(getGBstylenum2.Tables[0].Rows[0][0].ToString());
                //if (GBstylenum == GBstylenum2)
                //{
                //    molOrder.Style = "已完成";
                //    bllOrder.updateGBOrderlist(molOrder);
                //}
                bllGoodsInfo.Update_ywc1();
                Dataload(0, 10,"");

            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /* if (Request.QueryString["User_id"] == null)
             {
                 Response.Write("<script>window.alert('您没有选择用户,无法传值');window.location=index.aspx;</script>");
             }
             else
             {*/
            RadButton2.Visible = false;
            RadButton3.Visible = false;
            ViewState["BackUrl"] = Request.UrlReferrer.ToString();
            string a = Request.QueryString["Order_ID"].ToString();

            modOrder = bllOrder.GetMode2(Convert.ToInt16(a));
            Label1.Text = modOrder.U_ID.ToString();
            DataTable dt = bllOrder.GetList_1(a).Tables[0];
            if (dt.Rows.Count > 0)
            {

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

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

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

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

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

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

                Label12.Text = dt.Rows[0]["Style"].ToString();
                if (dt.Rows[0]["Style"].ToString().Trim() == "待付款")
                {
                    RadButton1.Visible = false;
                }
                if (dt.Rows[0]["Style"].ToString().Trim() == "待人数满员")
                {
                    RadButton1.Visible = false;

                }
                if (dt.Rows[0]["IN_group_buying"].ToString().Trim() == "1")
                {

                    RadButton1.Visible = false;
                }

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

                // }
            }

            DataSet ds = bllOrder.sumo(Label1.Text);
            if (ds.Tables[0].Rows[0][0].ToString() != "0")
            {
                Label14.Text = ds.Tables[0].Rows[0][0].ToString();
            }
        }
Exemplo n.º 3
0
        public void dataload1()
        {
            molOrder = bllOrder.GetModel1(int.Parse(Request["ID"]));         //获取订单编号
            lblorderid_text.Text = molOrder.U_ID.ToString();                  //将订单编号给label
            lblordertime.Text = molOrder.Order_time.ToString();
            moladdress = blladdress.GetModel2(int.Parse(Request["ID"]));
            lblperson.Text = moladdress.Get_Name;
            orderway.Text = molOrder.Method;
            lbladderss.Text = moladdress.Address_info;
            lblmoney.Text = molOrder.Money_Sum.ToString();

            SqlDataSource1.SelectCommand = "select * from [Orderinfo] where IN_group_buying = 0 and U_ID='" + lblorderid_text.Text + "'";
        }
Exemplo n.º 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            molOrder = bllOrder.GetModel1(int.Parse(Request["ID"]));
                molOrderinfo = bllOrderinfo.GetModel1(Int32.Parse(molOrder.U_ID.ToString())); //在Orderinfo中获取U_ID
                DataTable num = bllOrderinfo.GetList("U_ID = '" + molOrder.U_ID + "'").Tables[0]; //根据order表获得orderinfo,创建一个数据表给num
                for (int i = 0; i < num.Rows.Count; i++)
                {

                    DataTable Goods = bllgoods.GetList("Goods_ID = '" + num.Rows[i]["Goods_ID"].ToString() + "'").Tables[0];    //根据获取到的Goods_ID创建一个数据表给Goods
                    molgoods.Goods_ID = Int32.Parse(num.Rows[i]["Goods_ID"].ToString());
                    molgoods.Stock = Int32.Parse(Goods.Rows[0]["Stock"].ToString()) - Int32.Parse(num.Rows[i]["Goods_Num"].ToString());  //遍历之后减库存
                    molgoods.Sales_volume = Int32.Parse(Goods.Rows[0]["Sales_volume"].ToString()) + Int32.Parse(num.Rows[i]["Goods_Num"].ToString());  //遍历之后加销量
                    bllgoods.Updatestock(molgoods);

                }
                molOrder.Style = "已付款";
                bllOrder.Update(molOrder);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('付款成功!');location.href='PersonalOrder.aspx';</script>");
        }
Exemplo n.º 5
0
        public void dataload1()
        {
            molOrder = bllOrder.GetModel1(int.Parse(Request["ID"]));         //获取订单编号
            lblorderid_text.Text = molOrder.U_ID.ToString();                  //将订单编号给label
            lblordertime.Text = molOrder.Order_time.ToString();
            moladdress = blladdress.GetModel2(int.Parse(Request["ID"]));
            lblperson.Text = moladdress.Get_Name;
            orderway.Text = molOrder.Method;
            lbladderss.Text = moladdress.Address_info;
            SqlDataSource1.SelectCommand = "select * from GoodsInfo left join Orderinfo  on GoodsInfo.Goods_ID = Orderinfo.Goods_ID where  Orderinfo.U_ID='" + lblorderid_text.Text + "'  and Orderinfo.IN_group_buying=1 or Orderinfo.IN_group_buying=3";
            DataTable gbstatus = bllgoods.getGBStatus(lblorderid_text.Text).Tables[0];
            int num;
            DataSet getGBgoodsNum = bllOrderinfo.getnum();
            num =Int32.Parse( getGBgoodsNum.Tables[0].Rows[0][0].ToString());
            for (int i = 0; i < num; i++)
            {
                //DataSet GBgoods = bllOrderinfo.GetGBlist(lblorderid_text.Text);
                if (gbstatus.Rows[i]["GB_Status"].ToString() == "火热进行中" || gbstatus.Rows[i]["Style"].ToString() == "已付款")
                // || gbstatus.Rows[0]["Style"].ToString() == "已完成")
                {
                    payboxcon.Visible = false;
                    allmoneycon.Visible = false;
                }
                else if (gbstatus.Rows[i]["GB_Status"].ToString() == "团购已完成" || gbstatus.Rows[i]["Style"].ToString() == "未付款")
                //)
                {
                    allmoneycon.Visible = true;
                    payboxcon.Visible = true;
                    DataSet a = bllgoods.getGBMoney(lblorderid_text.Text);
                    lblmoney.Text = a.Tables[0].Rows[0][0].ToString();
                    Button1.Visible = true;
                    break;
                }

            }

              //SqlDataSource1.SelectCommand = "select * from [Orderinfo] where IN_group_buying = 1 and U_ID='" + lblorderid_text.Text + "'";
        }
Exemplo n.º 6
0
Arquivo: Order.cs Projeto: JJDJJ/TtNum
 /// <summary>
 /// 得到UID
 /// </summary>
 public TtNum1.Model.Order GetModel1(int U_ID)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select  top 1  ");
     strSql.Append(" Order_ID,U_ID,User_Name,Order_status,Method,Style,Goods_Name,Goods_ID,Goods_Num,Goods_Money,Money_Sum,Order_time,address_id,IN_group_buying ");
     strSql.Append(" from [Order] ");
     strSql.Append(" where U_ID= '" + U_ID + "'");
     TtNum1.Model.Order model = new TtNum1.Model.Order();
     DataSet ds = DbHelperSQL.Query(strSql.ToString());
     if (ds.Tables[0].Rows.Count > 0)
     {
         if (ds.Tables[0].Rows[0]["Order_ID"] != null && ds.Tables[0].Rows[0]["Order_ID"].ToString() != "")
         {
             model.Order_ID = int.Parse(ds.Tables[0].Rows[0]["Order_ID"].ToString());
         }
         if (ds.Tables[0].Rows[0]["U_ID"] != null && ds.Tables[0].Rows[0]["U_ID"].ToString() != "")
         {
             model.U_ID = int.Parse(ds.Tables[0].Rows[0]["U_ID"].ToString());
         }
         if (ds.Tables[0].Rows[0]["User_Name"] != null && ds.Tables[0].Rows[0]["User_Name"].ToString() != "")
         {
             model.User_Name = ds.Tables[0].Rows[0]["User_Name"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Order_status"] != null && ds.Tables[0].Rows[0]["Order_status"].ToString() != "")
         {
             model.Order_status = ds.Tables[0].Rows[0]["Order_status"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Method"] != null && ds.Tables[0].Rows[0]["Method"].ToString() != "")
         {
             model.Method = ds.Tables[0].Rows[0]["Method"].ToString();
         }
         if (ds.Tables[0].Rows[0]["Style"] != null && ds.Tables[0].Rows[0]["Style"].ToString() != "")
         {
             model.Style = ds.Tables[0].Rows[0]["Style"].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]["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_Num"] != null && ds.Tables[0].Rows[0]["Goods_Num"].ToString() != "")
         {
             model.Goods_Num = int.Parse(ds.Tables[0].Rows[0]["Goods_Num"].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]["Goods_Money"] != null && ds.Tables[0].Rows[0]["Goods_Money"].ToString() != "")
         {
             model.Goods_Money = int.Parse(ds.Tables[0].Rows[0]["Goods_Money"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Money_Sum"] != null && ds.Tables[0].Rows[0]["Money_Sum"].ToString() != "")
         {
             model.Money_Sum = int.Parse(ds.Tables[0].Rows[0]["Money_Sum"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Order_time"] != null && ds.Tables[0].Rows[0]["Order_time"].ToString() != "")
         {
             model.Order_time = DateTime.Parse(ds.Tables[0].Rows[0]["Order_time"].ToString());
         }
         if (ds.Tables[0].Rows[0]["address_id"] != null && ds.Tables[0].Rows[0]["address_id"].ToString() != "")
         {
             model.address_id = ds.Tables[0].Rows[0]["address_id"].ToString();
         }
         return model;
     }
     else
     {
         return null;
     }
 }
Exemplo n.º 7
0
Arquivo: Order.cs Projeto: JJDJJ/TtNum
        public TtNum1.Model.Order GetMode2(int Order_ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1  ");
            strSql.Append(" [Order].U_ID,[Order].User_Name,[Order].Order_time,[Address].Zipcode,[Address].Address_info,[Address].Phone,[Address].Method,[Order].Order_ID,[Order].Style,[Order].Order_status  from [Order],[Address] where [Address].U_ID=[Order].U_ID and Order_ID= " + Order_ID + "");

            TtNum1.Model.Order model = new TtNum1.Model.Order();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {  if (ds.Tables[0].Rows[0]["U_ID"] != null && ds.Tables[0].Rows[0]["U_ID"].ToString() != "")
                {
                    model.U_ID = int.Parse(ds.Tables[0].Rows[0]["U_ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["User_Name"] != null && ds.Tables[0].Rows[0]["User_Name"].ToString() != "")
                {
                    model.User_Name = ds.Tables[0].Rows[0]["User_Name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Order_time"] != null && ds.Tables[0].Rows[0]["Order_time"].ToString() != "")
                {
                    model.Order_time = DateTime.Parse(ds.Tables[0].Rows[0]["Order_time"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Zipcode"] != null && ds.Tables[0].Rows[0]["Zipcode"].ToString() != "")
                {
                    model.Zipcode = ds.Tables[0].Rows[0]["Zipcode"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Address_info"] != null && ds.Tables[0].Rows[0]["Address_info"].ToString() != "")
                {
                    model.Address_info = ds.Tables[0].Rows[0]["Address_info"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Phone"] != null && ds.Tables[0].Rows[0]["Phone"].ToString() != "")
                {
                    model.Phone = ds.Tables[0].Rows[0]["Phone"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Method"] != null && ds.Tables[0].Rows[0]["Method"].ToString() != "")
                {
                    model.Method = ds.Tables[0].Rows[0]["Method"].ToString();
                }

                if (ds.Tables[0].Rows[0]["Order_ID"] != null && ds.Tables[0].Rows[0]["Order_ID"].ToString() != "")
                {
                    model.Order_ID = int.Parse(ds.Tables[0].Rows[0]["Order_ID"].ToString());
                }

                if (ds.Tables[0].Rows[0]["Order_status"] != null && ds.Tables[0].Rows[0]["Order_status"].ToString() != "")
                {
                    model.Order_status = ds.Tables[0].Rows[0]["Order_status"].ToString();
                }

                if (ds.Tables[0].Rows[0]["Style"] != null && ds.Tables[0].Rows[0]["Style"].ToString() != "")
                {
                    model.Style = ds.Tables[0].Rows[0]["Style"].ToString();
                }

                return model;
            }
            else
            {
                return null;
            }
        }
Exemplo n.º 8
0
Arquivo: Order.cs Projeto: JJDJJ/TtNum
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public TtNum1.Model.Order GetModel(int Order_ID)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("select  top 1  ");
     strSql.Append(" Order_ID,U_ID,Order_time,Order_status,Order_name,Order_zipcode,Order_address,Order_phone,Order_way,Order_message,Num,Style,Good_ID ");
     strSql.Append(" from Order ");
     strSql.Append(" where Order_ID="+Order_ID+"" );
     TtNum1.Model.Order model=new TtNum1.Model.Order();
     DataSet ds=DbHelperSQL.Query(strSql.ToString());
     if(ds.Tables[0].Rows.Count>0)
     {
         return DataRowToModel(ds.Tables[0].Rows[0]);
     }
     else
     {
         return null;
     }
 }
Exemplo n.º 9
0
Arquivo: Order.cs Projeto: JJDJJ/TtNum
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public TtNum1.Model.Order DataRowToModel(DataRow row)
 {
     TtNum1.Model.Order model=new TtNum1.Model.Order();
     if (row != null)
     {
         if(row["Order_ID"]!=null && row["Order_ID"].ToString()!="")
         {
             model.Order_ID=int.Parse(row["Order_ID"].ToString());
         }
         if(row["U_ID"]!=null && row["U_ID"].ToString()!="")
         {
             model.U_ID=int.Parse(row["U_ID"].ToString());
         }
         if(row["Order_time"]!=null && row["Order_time"].ToString()!="")
         {
             model.Order_time=DateTime.Parse(row["Order_time"].ToString());
         }
         if(row["Order_status"]!=null)
         {
             model.Order_status=row["Order_status"].ToString();
         }
         if(row["Order_name"]!=null)
         {
             model.Order_name=row["Order_name"].ToString();
         }
         if(row["Order_zipcode"]!=null)
         {
             model.Order_zipcode=row["Order_zipcode"].ToString();
         }
         if(row["Order_address"]!=null)
         {
             model.Order_address=row["Order_address"].ToString();
         }
         if(row["Order_phone"]!=null)
         {
             model.Order_phone=row["Order_phone"].ToString();
         }
         if(row["Order_way"]!=null)
         {
             model.Order_way=row["Order_way"].ToString();
         }
         if(row["Order_message"]!=null)
         {
             model.Order_message=row["Order_message"].ToString();
         }
         if(row["Num"]!=null && row["Num"].ToString()!="")
         {
             model.Num=int.Parse(row["Num"].ToString());
         }
         if(row["Style"]!=null)
         {
             model.Style=row["Style"].ToString();
         }
         if(row["Good_ID"]!=null && row["Good_ID"].ToString()!="")
         {
             model.Good_ID=int.Parse(row["Good_ID"].ToString());
         }
     }
     return model;
 }