示例#1
0
 /// <summary>
 /// 添加商品咨询
 /// </summary>
 /// <param name="userid">用户ID</param>
 /// <param name="proid">商品ID</param>
 /// <param name="name">标题</param>
 /// <param name="content">内容</param>
 public void addProquest(int userid, int proid, string name, string content)
 {
     CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
     builder.TblName = "Bs_Proquest";
     builder.AddData("Bs_UserID", userid);
     builder.AddData("Bs_ProductsID", proid);
     builder.AddData("title", name);
     builder.AddData("content", content);
     builder.AddData("Addtime", DateTime.Now.ToString("s"));
     builder.AutoInsert();
 }
示例#2
0
 /// <summary>
 /// 注册用户
 /// </summary>
 /// <param name="user">用户实体</param>
 public void reg(Bs_User user)
 {
     CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
     builder.TblName = "Bs_User";
     builder.AddData("name", user.Name);
     builder.AddData("realname", user.Name);
     builder.AddData("password", user.Password);
     builder.AddData("email", user.EMail);
     builder.AddData("addtime", DateTime.Now.ToString("s"));
     builder.AddData("Code", "01");
     builder.AutoInsert();
 }
示例#3
0
 /// <summary>
 /// 保存订单商品详细
 /// </summary>
 /// <param name="orderDtl"></param>
 public void addOrderDtl(Bs_OrdersDtl orderDtl)
 {
     CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
     builder.TblName = "bs_ordersdtl";
     builder.AddData("Bs_OrdersCode", orderDtl.Bs_OrdersCode);
     builder.AddData("Bs_ProductsCode", orderDtl.Bs_ProductsCode);
     builder.AddData("Quantity", orderDtl.Quantity);
     builder.AddData("Price", orderDtl.Price);
     //builder.AddData("Amount", orderDtl.Amount);
     builder.AddData("Dimension", orderDtl.Dimension);
     builder.AutoInsert();
 }
示例#4
0
 /// <summary>
 /// 添加商品评论
 /// </summary>
 /// <param name="userid"></param>
 /// <param name="proid"></param>
 /// <param name="name"></param>
 /// <param name="content"></param>
 public void addProComment(int userid, int proid, int grade, string name, string content)
 {
     CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
     builder.TblName = "Bs_ProComments";
     builder.AddData("Bs_UserID", userid);
     builder.AddData("Bs_ProductsID", proid);
     builder.AddData("score", grade);
     builder.AddData("title", name);
     builder.AddData("Content", content);
     builder.AddData("ip", CSA.HC.Common.getIP());
     builder.AddData("AddTime", DateTime.Now.ToString("s"));
     builder.AutoInsert();
 }
示例#5
0
 /// <summary>
 /// 新增订单
 /// </summary>
 /// <param name="order"></param>
 public void addOrder(Bs_Orders order)
 {
     CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
     builder.TblName = "bs_orders";
     builder.AddData("Code", order.Code);
     builder.AddData("Bs_UserID", order.Bs_UserID);
     builder.AddData("Quantity", order.Quantity);
     builder.AddData("Amount", order.Amount);
     builder.AddData("DeliverFee", order.DeliverFee);
     builder.AddData("ProductFee", order.ProductFee);
     builder.AddData("AdditionalFee", order.AdditionalFee);
     builder.AddData("Discount", order.Discount);
     builder.AddData("UserAccount", order.UserAccount);
     builder.AddData("csgName", order.csgName);
     builder.AddData("csgCountry", order.csgCountry);
     builder.AddData("csgProvince", order.csgProvince);
     builder.AddData("csgCity", order.csgCity);
     builder.AddData("csgCounty", order.csgCounty);
     builder.AddData("csgAddress", order.csgAddress);
     builder.AddData("csgPostCode", order.csgPostCode);
     builder.AddData("csgMobile", order.csgMobile);
     builder.AddData("csgPhone", order.csgPhone);
     builder.AddData("csgEmail", order.csgEmail);
     builder.AddData("csgFax", order.csgFax);
     builder.AddData("billName", order.billName);
     builder.AddData("billCountry", order.billCountry);
     builder.AddData("billProvince", order.billProvince);
     builder.AddData("billCity", order.billCity);
     builder.AddData("billCounty", order.billCounty);
     builder.AddData("billAddress", order.billAddress);
     builder.AddData("billPostCode", order.billPostCode);
     builder.AddData("billPhone", order.billPhone);
     builder.AddData("billMobile", order.billMobile);
     builder.AddData("billEmail", order.billEmail);
     builder.AddData("billFax", order.billFax);
     builder.AddData("Sy_DeliverCode", order.Sy_DeliverCode);
     builder.AddData("DeliverNo", order.DeliverNo);
     builder.AddData("Sy_PayCode", order.Sy_PayCode);
     builder.AddData("PayNo", order.PayNo);
     builder.AddData("Message", order.Message);
     builder.AddData("Notes", order.Notes);
     builder.AddData("Status", order.Status);
     builder.AddData("AddTime", order.AddTime);
     builder.AddData("Baddress", order.Baddress);
     builder.AutoInsert();
 }
示例#6
0
    /// <summary>
    /// 修改用户
    /// </summary>
    /// <param name="user"></param>
    public void updateUser(Bs_User user)
    {
        CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder();
        builder.TblName = "bs_user";
        builder.AddData("realname", user.RealName);
        builder.AddData("Sex", user.Sex);

        builder.AddData("QQ", user.QQ);
        builder.AddData("MSN", user.MSN);
        builder.AddData("WanWan", user.WanWan);
        builder.AddData("Pic", user.Pic);
        builder.AddData("Mobile", user.Mobile);
        builder.AddData("Phone", user.Phone);
        builder.AddData("Fax", user.Fax);
        builder.AddData("EMail", user.EMail);
        builder.AddData("Company", user.Company);
        builder.AddData("Address", user.Address);
        builder.AddData("PostCode", user.PostCode);
        builder.AddData("County", user.County);
        builder.AddData("Country", user.Country);
        builder.AddData("City", user.City);
        builder.AddData("Province", user.Province);

        builder.AddData("csgAddress", user.csgAddress);
        builder.AddData("csgCity", user.csgCity);
        builder.AddData("csgCountry", user.csgCountry);
        builder.AddData("csgCounty", user.csgCounty);
        builder.AddData("csgEmail", user.csgEmail);
        builder.AddData("csgMobile", user.csgMobile);
        builder.AddData("csgName", user.csgName);
        builder.AddData("csgPhone", user.csgPhone);
        builder.AddData("csgPostCode", user.csgPostCode);
        builder.AddData("csgProvince", user.csgProvince);

        builder.Where = " and id= " + user.ID;
        builder.AutoUpdate();
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Com.Util.getStringByObject(Request["action"]);

        if (CurInfo.CurUser == null)
        {
            Response.Redirect("login.aspx?from=address.aspx");
        }

        if (action == "del")
        {
            string id  = Request.Form["id"];
            string sql = "delete bs_useraddress where id=" + id + "";

            if (CSA.DAL.DBAccess.ExecuteNonQuery(sql) > 0)
            {
                Response.Write("{\"status\":\"success\",\"content\":\"删除成功!\"}");
            }

            else
            {
                Response.Write("{\"status\":\"error\",\"content\":\"提交失败!\"}");
            }
        }
        if (action == "edit")
        {
            CSA.DAL.SQLBuilder builder = new CSA.DAL.SQLBuilder("Bs_userAddress");

            string hid = Request.Form["hid"];



            string   city = Request.Form["city"];
            string[] s    = city.Split('/');

            builder.AddData("CsgProv", s[0]);
            builder.AddData("CsgCity", s[1]);
            builder.AddData("CsgCounty", s[2]);
            builder.AddData("CsgAddress", Request.Form["KK_CsgAddress"]);
            builder.AddData("CsgPostcode", Request.Form["KK_CsgPostcode"]);
            builder.AddData("CsgTel", Request.Form["KK_CsgTel"]);
            builder.AddData("CsgMobile", Request.Form["KK_CsgMobile"]);
            builder.AddData("CsgName", Request.Form["KK_CsgName"]);

            builder.AddData("IsCheck", Request.Form["KK_IsCheck"]);


            builder.AddData("uid", CurInfo.CurUser.ID);

            if (!string.IsNullOrEmpty(hid))
            {
                builder.Where = " and id=" + hid;
                if (builder.AutoUpdate())
                {
                    Response.Write("{\"status\":\"success\",\"content\":\"地址保存成功!\"}");
                }

                else
                {
                    Response.Write("{\"status\":\"error\",\"content\":\"提交失败!\"}");
                }
            }
            else
            {
                if (builder.AutoInsert())
                {
                    Response.Write("{\"status\":\"success\",\"content\":\"地址保存成功!\"}");
                }

                else
                {
                    Response.Write("{\"status\":\"error\",\"content\":\"提交失败!\"}");
                }
            }
        }
        if (action == "modify")
        {
            string id = Request.Form["id"];
            System.Data.DataTable dt;
            dt = CSA.DAL.DBAccess.getRS("select * from bs_useraddress where id=" + id);

            if (dt.Rows.Count > 0)
            {
                Response.Write("{\"status\":\"success\",\"CsgProv\":\"" + dt.Rows[0]["CsgProv"] + "\",\"CsgCity\":\"" + dt.Rows[0]["CsgCity"] + "\",\"CsgCounty\":\"" + dt.Rows[0]["CsgCounty"] + "\",\"CsgAddress\":\"" + dt.Rows[0]["CsgAddress"] + "\",\"CsgPostcode\":\"" + dt.Rows[0]["CsgPostcode"] + "\",\"CsgTel\":\"" + dt.Rows[0]["CsgTel"] + "\",\"CsgMobile\":\"" + dt.Rows[0]["CsgMobile"] + "\",\"IsCheck\":\"" + dt.Rows[0]["IsCheck"] + "\",\"CsgName\":\"" + dt.Rows[0]["CsgName"] + "\"}");
            }

            else
            {
                Response.Write("{\"status\":\"error\",\"content\":\"读取失败!\"}");
            }
        }
    }