예제 #1
0
    private void BindfahuoInfo(string orderID)//管理员给用户购买的东西发货
    {
        if (orderID != "")
        {
            L_OrderLogInfo orderloginfo = new L_OrderLogInfo();
            orderloginfo.OrderID       = orderID;
            orderloginfo.OperateUserID = adminID;
            orderloginfo.ClientIP      = Stringhelp.GetClientUp();
            orderloginfo.UserType      = 20;
            orderloginfo.OperateType   = 30;
            orderloginfo.OperateTime   = DateTime.Now;

            string UpdateField = " orderState=30,shippedTime='" + DateTime.Now + "'";
            if (new longyuan_TableUpDateFieldsInfo().UpdateShoping("orderList", UpdateField, " and orderID='" + orderID + "'") == 2)
            {
                orderloginfo.OperateDepict = "管理员发货成功";
                new longyuan_orderloginfo().InsertOrderLog(orderloginfo);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("管理员发货成功"));
                return;
            }
            else
            {
                orderloginfo.OperateDepict = "管理员发货失败";
                new longyuan_orderloginfo().InsertOrderLog(orderloginfo);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("管理员发货失败,请您检查"));
                return;
            }
        }
        BindAdminManagerOrderList();
    }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ReSetPage();
     }
     if (Request.QueryString["id"] != null)
     {
         int CategoryId;
         if (Int32.TryParse(Request.QueryString["id"], out CategoryId))
         {
             if (category.GetSubCategoryByID(CategoryId).Count == 0 && !category.GetExistProduct(CategoryId))
             {
                 if (category.DeleteCategoryByID(CategoryId))
                 {
                     Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("分类删除成功!"));
                 }
                 else
                 {
                     Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("分类删除失败!"));
                 }
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("该分类下面存在子分类或者商品,你无法删除!"));
             }
         }
         ReSetPage();
     }
 }
예제 #3
0
 protected void lbtnUp_Click(object sender, EventArgs e)
 {
     if (fuProductPhoto.HasFile)
     {
         if (fuProductPhoto.PostedFile.ContentLength > 100 * 1024)
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("照片大小不能超过100K,请重新选择"));
         }
         else
         {
             if (fuProductPhoto.PostedFile.ContentType == "image/gif" || fuProductPhoto.PostedFile.ContentType == "image/x-png" || fuProductPhoto.PostedFile.ContentType == "image/pjpeg" || fuProductPhoto.PostedFile.ContentType == "image/bmp")
             {
                 string strNewName = WebUnitily.GetName() + System.IO.Path.GetExtension(fuProductPhoto.FileName);
                 string strPath    = Server.MapPath("~/photo/" + strNewName);
                 fuProductPhoto.PostedFile.SaveAs(strPath);
                 imgPhoto.ImageUrl  = "~/photo/" + strNewName;
                 ViewState["photo"] = strNewName;
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请上传常用格式的图片"));
             }
         }
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择照片后再上传?"));
     }
 }
예제 #4
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string strID = "";  //验证的ID

        if (Request["cbName"] != null)
        {
            strID = Request["cbName"];
        }
        if (strID.Trim().Length < 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请你选择你要删除数据"));
            return;
        }

        string conditions = " and userID=" + userID + " and orderID in(" + strID + ")";

        if (table.Deleteproject("OrderList", conditions) > 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您删除订单信息成功"));
            BindIndexOrderListInfo();
            return;
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您删除订单信息失败,请您检查"));
            BindIndexOrderListInfo();
            return;
        }
    }
예제 #5
0
    private void AdminUpdateOrderList(string orderID)
    {
        if (orderID != "")
        {
            L_OrderLogInfo logeinfo = new L_OrderLogInfo();
            logeinfo.OrderID       = orderID;
            logeinfo.OperateUserID = adminID;
            logeinfo.ClientIP      = Stringhelp.GetClientUp();
            logeinfo.UserType      = 20;
            logeinfo.OperateType   = 0;
            logeinfo.OperateTime   = DateTime.Now;

            string updateField = " orderState=0";
            if (new TableUpDateFieldsInfo().UpdateShoping("orderList", updateField, " and OrderID='" + orderID + "'") == 1)
            {
                logeinfo.OperateDepict = "管理员取消订单成功";
                new orderloginfo().InsertOrderLog(logeinfo);
                BindAdminManagerOrderList();
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("取消订单成功!"));
                return;
            }
            else
            {
                logeinfo.OperateDepict = "管理员取消订单失败";
                new orderloginfo().InsertOrderLog(logeinfo);
                BindAdminManagerOrderList();
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("取消订单失败,请您检查!"));
                return;
            }
        }
    }
예제 #6
0
    protected void gvmanagerAdmin_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string AdminID = gvmanagerAdmin.DataKeys[e.RowIndex].Value.ToString();

        if (((Label)(gvmanagerAdmin.Rows[e.RowIndex].FindControl("lblEnabled"))).Text == "起用")
        {
            if (new longyuan_TableUpDateFieldsInfo().UpdateShoping("Admin", "isEnabled=0", "and adminID in(" + AdminID + ")") > 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您禁用管理员成功!"));
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您设置管理员权限失败,请检查!"));
            }
        }
        if (((Label)(gvmanagerAdmin.Rows[e.RowIndex].FindControl("lblEnabled"))).Text == "禁用")
        {
            if (new longyuan_TableUpDateFieldsInfo().UpdateShoping("Admin", "isEnabled=1", "and adminID in(" + AdminID + ")") > 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您起用管理员成功!"));
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您设置管理员权限失败,请检查!"));
            }
        }
        BindAdmin();
    }
예제 #7
0
    private void BindDataListShoppingRar()
    {
        DataSet set = new CartInfo().GetShoppingCartList(userID);

        if (set.Tables.Count > 0)
        {
            if (set.Tables[0].Rows.Count > 0)
            {
                ddlBindIndexShoppingCartInfo.DataSource = set.Tables[0];
                ddlBindIndexShoppingCartInfo.DataBind();
            }
            else
            {
                Response.Write(WebUnitily.AlertUrl("您的购物车中还没有产品,不能进行结算", "UserCard.aspx"));
                Response.End();
            }

            decimal proMoneyTotal, freightTotal;

            proMoneyTotal = WebUnitily.CheckMoney(set.Tables[1].Rows[0]["MoneyTotle"].ToString());
            freightTotal  = WebUnitily.CheckMoney(set.Tables[1].Rows[0]["FreightTotal"].ToString());

            moneyTotal         = string.Format("{0:C2}", proMoneyTotal + freightTotal);
            txtMoneyTotal.Text = moneyTotal.ToString();
        }
    }
예제 #8
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        string strID = "";

        if (Request["cbName"] != null)
        {
            strID = Request["cbName"];
        }
        if (strID.Trim().Length < 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择你所要操作的数据"));
            return;
        }
        string conditionStr = " and userID=" + userID + " and id in(" + strID + ")";

        if (table.Deleteproject("AcceptAddr", conditionStr) > 0)
        {
            BindAcceptAddr();
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("删除收货地址成功"));
            return;
        }
        else
        {
            BindAcceptAddr();
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("删除收货地址失败"));
            return;
        }
    }
예제 #9
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        L_ProductInfo pInfo = new L_ProductInfo();

        pInfo.Pronumber   = txtProNumber.Text.Trim();
        pInfo.ProductName = txtProductName.Text.Trim();
        pInfo.Keyword     = "";

        string categoryDetail  = this.ddlLeavl.SelectedItem.Value;
        string categoryDetail1 = this.ddlLeavl.SelectedItem.Value;
        string categoryID      = categoryDetail.Split(',')[1];

        pInfo.ProductCategoryID = Convert.ToInt32(categoryID);
        pInfo.ParentNameRoute   = categoryDetail1.ToString();
        pInfo.CategoryName      = this.ddlLeavl.Items[ddlLeavl.SelectedIndex].Text;

        pInfo.ProductImage = ViewState["photo"].ToString();
        pInfo.Price        = Convert.ToDecimal(txtPrice.Text.Trim());
        pInfo.CurrentPrice = Convert.ToDecimal(txtCurrentPrince.Text.Trim());
        pInfo.MenberPrince = Convert.ToDecimal(txtMenberPrince.Text.Trim());

        pInfo.ProducStore = Convert.ToInt32(txtPoductStore.Text.Trim());
        pInfo.Danwei      = ddlDanWei.SelectedValue;
        pInfo.FreightType = ddlFreightType.SelectedValue;
        pInfo.Freight     = Convert.ToDecimal(txtFreight.Text.Trim());

        pInfo.LinkQQID   = ddlQQList.SelectedIndex.ToString();
        pInfo.LinkQQName = ddlQQList.Items[ddlQQList.SelectedIndex].Text;
        pInfo.Ispost     = 1;
        if (rbDesc.Checked)
        {
            isReviewEnable = 1;
        }
        else
        {
            isReviewEnable = 0;
        }
        pInfo.Isreviewenable = isReviewEnable;
        //出错误处
        pInfo.RemainDay   = Int32.Parse(ddlRemainDay.SelectedValue);
        pInfo.ProductDesc = this.txtContent.Text;
        pInfo.Addtime     = DateTime.Now;

        if (productinfo.InsertProduct(pInfo) == 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("产品发布成功!"));
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("产品发布失败,请您检查一下!!"));
        }
        txtContent.Text       = "";
        txtCurrentPrince.Text = "";
        txtFreight.Text       = "";
        txtMenberPrince.Text  = "";
        txtPoductStore.Text   = "";
        txtPrice.Text         = "";
        txtProductName.Text   = "";
        txtProNumber.Text     = "";
    }
예제 #10
0
    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        int addrID = WebUnitily.CheckInt(rbListAddr.SelectedValue);

        if (addrID == 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择收货地址!"));
            return;
        }
        L_AcceptAddrInfo addrinfo = new AcceptAddrInfo().GetBindUpdateAcceptAddr(addrID, userID);

        if (addrinfo == null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您所选择的收货地址不存在!"));
            return;
        }

        L_OrderListInfo olistinfo = new L_OrderListInfo();

        olistinfo.UserID     = userID;
        olistinfo.AcceptName = addrinfo.RealityName;
        olistinfo.AcceptAddr = addrinfo.Province + addrinfo.City + addrinfo.Country + addrinfo.RowAddr;
        olistinfo.HandSet    = addrinfo.HandSet;
        olistinfo.Tel        = addrinfo.Tel;
        olistinfo.ZipCode    = addrinfo.zipCode;

        olistinfo.OrderTime   = DateTime.Now;
        olistinfo.ShippedTime = DateTime.Now;
        olistinfo.OrderState  = 10; //0代表取消订单  10代表等待付款  20代表已付款 30代表已发货
        olistinfo.IsNew       = 0;  //0 新订单 1一查看
        olistinfo.AdminID     = 0;
        olistinfo.OrderID     = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");

        int exeResult = order.AddUserOrderItem(olistinfo);

        switch (exeResult)
        {
        case 10:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case -2:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的购物车中没有产品,请您选择产品", "UserCard.aspx"));
            break;

        case -3:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您还没有购物车呢,请您先选择产品", "UserCard.aspx"));
            break;

        default:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交失败"));
            break;
        }
        BindDataListShoppingRar();
    }
예제 #11
0
 private void BindHelpInfo(int InfoID)
 {
     hInfo = helpinfo.GetBindHelp(InfoID);
     if (hInfo == null)
     {
         Response.Write(WebUnitily.AlertUrl("您所所选择的帮助信息暂无,请您先看别的吧", "HelpList.aspx"));
     }
 }
예제 #12
0
 protected void btnOK_Click(object sender, EventArgs e)
 {
     if (user.ChangePwd(lblUserName.Text.Trim(), Stringhelp.MD5String(txtNewPwd.Text.Trim()), Stringhelp.MD5String(txtOldPwd.Text.Trim())) > 0)
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("用户修改密码成功,请您重新登录", "../../user/UserLogin.aspx"));
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("用户修改密码失败"));
     }
 }
예제 #13
0
    private void BindUpdateHelp()
    {
        L_ShowHelpInfo helpinfo = help.GetBindHelp(helpID);

        if (helpinfo == null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("帮助主题不存在,请您重新选择!"));
        }
        txtHelpTitle.Text = helpinfo.HelpTitle;
        txtContent.Text   = helpinfo.HelpCntent;
    }
 private void bindDataInfo(Int32 Id)
 {
     bInfo = new BulletionInfo().GetBulletinInfo(Id, 0);
     if (bInfo != null)
     {
     }
     else
     {
         Response.Write(WebUnitily.AlertUrl("请选择产品", "/"));
         Response.End();
     }
 }
예제 #15
0
    private void BindUpdateBulletin()
    {
        L_BulletionInfo bulletion = new BulletionInfo().GetBulletinInfo(bulletinID, 0);

        if (bulletion == null)
        {
            Response.Write(WebUnitily.AlertUrl("信息不存在,请您重新选择"));
            Response.End();
        }
        txtTitle.Text   = bulletion.BulletinTitle;
        txtContent.Text = bulletion.BulletinContent;
    }
예제 #16
0
    protected void ibtnlogin_Click(object sender, ImageClickEventArgs e)
    {
        string LoginName, userPwd, userIP, loginResult;
        Int32  LoginType;
        string codeValue = txtCodeNum.Text.Trim().ToLower();

        if (Session["validateNum"].ToString().ToLower() != codeValue)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您的验证码有误,请重新输入!');</script>");
        }
        else
        {
            userPwd   = Stringhelp.MD5String(txtPassword.Text.Trim());
            LoginType = Int32.Parse(ddlLoginType.SelectedValue);
            userIP    = Stringhelp.GetClientUp();
            switch (LoginType)
            {
            case 1:
                LoginName = txtUserName.Text.Trim();
                break;

            case 2:
                LoginName = txtUserName.Text.Trim();
                break;

            default:
                LoginName = txtUserName.Text.Trim();
                break;
            }


            loginResult = Loginhelp.GetUserLogin(LoginName, userPwd, LoginType, userIP);
            if (string.IsNullOrEmpty(loginResult))
            {
                string gotoUrl = txtbackUrl.Text.Trim();
                if (gotoUrl == "")
                {
                    Response.Redirect("~/proscenium/Index.aspx", true);
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("登录成功!", gotoUrl));
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("登录失败,原因是:" + loginResult + "!"));
            }
        }
        this.txtCodeNum.Text  = "";
        this.txtUserName.Text = "";
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         Int32 Id = WebUnitily.CheckInt(Request["Id"]);
         if (Id == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请选择产品", "/"));
             Response.End();
         }
         bindDataInfo(Id);
     }
 }
예제 #18
0
    protected void btnAddCategory_Click(object sender, EventArgs e)
    {
        L_CategoryInfo info = new L_CategoryInfo();

        info.ProductCategoryName = txtCategoryName.Text;
        info.CategoryDepth       = Convert.ToInt32(ddlLevel.SelectedValue.Split(',')[0]) + 1;
        info.ParentID            = Convert.ToInt32(ddlLevel.SelectedValue.Split(',')[1]);
        if (category.InsertCategory(info))
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("添加类别成功"));
            ReSetPage();
        }
        txtCategoryName.Text = "";
    }
예제 #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int infoID = WebUnitily.CheckInt(Request["helpID"]);
         if (infoID == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请您选择帮助主题", "HelpList.aspx"));
             Response.End();
         }
         BindIndexHelpTitle();
         BindHelpInfo(infoID);
     }
 }
예제 #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int PId = WebUnitily.CheckInt(Request["PId"]);
         ViewState["PID"] = PId;
         if (PId == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请选择产品", "ProductList.aspx"));
             Response.End();
         }
         txtId.Text = PId.ToString();
         GetBindTuiJian();
         BindProductInfoByProductID(PId);
     }
 }
예제 #21
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        L_AcceptAddrInfo acceptinfo = new L_AcceptAddrInfo();

        acceptinfo.ProvinceID = WebUnitily.CheckInt(Request.Form["ProvinceId"]);
        acceptinfo.Province   = WebUnitily.CheckStr(txtProvince.Text.Trim());
        acceptinfo.CityID     = WebUnitily.CheckInt(Request.Form["CityId"]);
        acceptinfo.City       = WebUnitily.CheckStr(txtcity.Text.Trim());
        acceptinfo.CountryID  = WebUnitily.CheckInt(Request.Form["CountyId"]);
        acceptinfo.Country    = WebUnitily.CheckStr(txtCountry.Text.Trim());

        acceptinfo.RowAddr     = WebUnitily.CheckStr(txtRowAddr.Text.Trim());
        acceptinfo.RealityName = WebUnitily.CheckStr(txtRealityName.Text.Trim());
        acceptinfo.HandSet     = WebUnitily.CheckStr(txtHandset.Text.Trim());
        acceptinfo.Tel         = WebUnitily.CheckStr(txtDel.Text.Trim());
        acceptinfo.zipCode     = WebUnitily.CheckStr(txtZipCode.Text.Trim());
        acceptinfo.QQNum       = WebUnitily.CheckStr(txtQQMath.Text.Trim());

        acceptinfo.UserID   = userID;
        acceptinfo.PostTime = DateTime.Now;

        int exeResult = accept.InsertAcceptAddr(acceptinfo);

        switch (exeResult)
        {
        case 1:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址添加成功!"));
            break;

        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址最多只能添加10个,请您检查!"));
            break;

        default:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址添加失败,请您检查!"));
            break;
        }
        txtcity.Text        = "";
        txtCountry.Text     = "";
        txtDel.Text         = "";
        txtHandset.Text     = "";
        txtProvince.Text    = "";
        txtQQMath.Text      = "";
        txtRealityName.Text = "";
        txtRowAddr.Text     = "";
        txtZipCode.Text     = "";
    }
예제 #22
0
    protected void linkDelete_Click(object sender, EventArgs e)
    {
        L_CartInfo cart = new L_CartInfo();

        cart.UserID    = userID;
        cart.CartID    = WebUnitily.CheckStr(Request["CardID"]);
        cart.ProductID = WebUnitily.CheckInt(Request["PId"]);
        if (cartinfo.GetCartListDelete(cart) == 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("购物车中的商品删除成功!"));
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("商品删除失败!"));
        }
        BindIndexShoppingCartInfo();
    }
예제 #23
0
    protected void imgBuyProduct_Click(object sender, ImageClickEventArgs e)
    {
        if (subTool.CheckUserLogin("-1"))
        {
            int        userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
            L_CartInfo cInfo  = new L_CartInfo();
            cInfo.UserID    = userID;
            cInfo.CartID    = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");
            cInfo.ProductID = WebUnitily.CheckInt(ViewState["PID"]);
            cInfo.BugNum    = WebUnitily.CheckInt(txtBuyNum.Text);
            cInfo.bugTime   = DateTime.Now;

            if (cInfo.ProductID == 0)
            {
                Response.Write("你需要加入购物车的商品不存在,请您检查!!");
                Response.End();
            }
            if (cInfo.BugNum == 0)
            {
                Response.Write("请检查你要购买的商品数!");
                Response.End();
            }

            int exresult = cartinfo.addCart(cInfo);
            switch (exresult)
            {
            case 20:
                Response.Write("<script>alert('商品添加购物车成功');</script>");
                Server.Transfer("../orderinfo/UserCard.aspx");
                break;

            case 10:
                Response.Write("<script>alert('商品添加收藏夹成功');</script>");
                Server.Transfer("../orderinfo/UserCard.aspx");
                break;

            default:
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("加入购物车失败,请您检查"));
                break;
            }
        }
    }
예제 #24
0
    protected void btnedit_Click(object sender, EventArgs e)
    {
        L_CategoryInfo info = new L_CategoryInfo();

        info.ProductCategoryID   = Convert.ToInt32(Request.Form["lbdivid"].ToString());
        info.ProductCategoryName = Request.Form["tbname"].ToString();
        info.CategoryDepth       = Convert.ToInt32(ddldiv.SelectedValue.Split(',')[0]) + 1;
        info.ParentID            = Convert.ToInt32(ddldiv.SelectedValue.Split(',')[1]);
        int step = info.CategoryDepth - Convert.ToInt32(Request.Form["olddepth"].ToString()) - 1;

        if (category.UpdateCategoryByID(info, step))
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("修改类别成功"));
            ReSetPage();
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("修改类别成功"));
        }
    }
예제 #25
0
    protected void btnAddBulletion_Click(object sender, EventArgs e)
    {
        L_BulletionInfo bulletionInfo = new L_BulletionInfo();

        bulletionInfo.BulletinTitle   = txtTitle.Text.Trim();
        bulletionInfo.BulletinContent = txtContent.Text.Trim();
        bulletionInfo.IsPost          = 1;
        bulletionInfo.OrderNum        = 0;
        bulletionInfo.PostTime        = Convert.ToDateTime(DateTime.Now.ToString());
        if (new BulletionInfo().AddBulletion(bulletionInfo) == 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("网站公告添加成功"));
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("网站公告添加失败,请您检查!"));
        }
        txtTitle.Text   = "";
        txtContent.Text = "";
    }
예제 #26
0
    protected void imbtnLogin_Click(object sender, ImageClickEventArgs e)
    {
        if (txtAmdinName.Text == "admin" && txtPwd.Text == "admin")
        {
            Response.Redirect("AddAdminInfo.aspx", true);
        }
        string adminName, adminPwd, adminIP, loginResult;
        string codeName = txtCodeNum.Text.Trim().ToLower();

        if (Session["validateNum"].ToString().ToLower() != codeName)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('验证码输入错误,请检查!');</script>");
            return;
        }
        adminName = txtAmdinName.Text.Trim();
        adminPwd  = Stringhelp.MD5String(txtPwd.Text.Trim());
        adminIP   = Stringhelp.GetClientUp();

        //loginResult 在代码及存储过程中查找失败的原因
        loginResult = Loginhelp.GetAdminLogin(adminName, adminPwd, adminIP);

        if (loginResult == "")
        {
            //string gotoUrl = txtBackUrl.Text.Trim();
            //if (gotoUrl == "")
            //{
            //    Response.Redirect("AddAdminInfo.aspx", true);
            //}
            //else
            //{
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您登录成功!", "ManageAdmin.aspx"));
            //}
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您登录失败,失败的原因是:" + loginResult + "!"));
        }
        txtAmdinName.Text = "";
        txtPwd.Text       = "";
        txtCodeNum.Text   = "";
    }
예제 #27
0
    private void BindUpdateAcceptAddr(int InfoID)
    {
        L_AcceptAddrInfo addrInfo = accept.GetBindUpdateAcceptAddr(InfoID, userID);

        if (addrInfo != null)
        {
            txtRowAddr.Text     = addrInfo.RowAddr;
            txtRealityName.Text = addrInfo.RealityName;
            txtDel.Text         = addrInfo.Tel;
            txtHandset.Text     = addrInfo.HandSet;
            txtZipCode.Text     = addrInfo.zipCode;
            txtQQMath.Text      = addrInfo.QQNum;
            txtProvince.Text    = addrInfo.Province;
            txtcity.Text        = addrInfo.City;
            txtCountry.Text     = addrInfo.Country;
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择你所要修改的记录"));
        }
    }
예제 #28
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        L_BulletionInfo bulletin = new L_BulletionInfo();

        bulletin.ID              = Int32.Parse(Request.QueryString["ID"]);
        bulletin.BulletinTitle   = txtTitle.Text.Trim();
        bulletin.BulletinContent = txtContent.Text.Trim();
        bulletin.IsPost          = 1;
        bulletin.OrderNum        = 0;
        bulletin.PostTime        = Convert.ToDateTime(DateTime.Now.ToString());
        if (new BulletionInfo().updateBulletion(bulletin) == 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("网站公告修改成功成功", "ManageBulletin.aspx"));
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("网站公告修改失败,请您检查!", "ManageBulletin.aspx"));
        }
        txtTitle.Text   = "";
        txtContent.Text = "";
    }
예제 #29
0
    public static bool CheckUserLogin(string usertype)
    {
        HttpCookie newcookie = HttpContext.Current.Request.Cookies["shop8517User"];

        if (HttpContext.Current.Session["shop8517User"] == null || newcookie == null)
        {
            if (newcookie != null)
            {
                newcookie.Expires = DateTime.Now.AddDays(-1);
            }
            string     backUrl   = HttpContext.Current.Server.UrlDecode(HttpContext.Current.Request.Url.AbsolutePath.ToString()); //登陆后返回的URL地址
            HttpCookie cookieUrl = new HttpCookie("Url");                                                                         //创建一个新的Cookie
            cookieUrl.Expires           = DateTime.Now.AddDays(1);
            cookieUrl.Values["BackUrl"] = backUrl;
            cookieUrl.Path = "/";

            HttpContext.Current.Response.AppendCookie(cookieUrl);
            HttpContext.Current.Response.Write(WebUnitily.AlertUrl("您还没有登录,请您先登录", "../../user/UserLogin.aspx"));
            HttpContext.Current.Response.End();  //清楚缓存
            return(false);
        }
        else
        {
            if (usertype == "-1")
            {
                return(true);
            }
            if (usertype == mycookie.getCookiesValue("shop8517User", "UserTye"))
            {
                return(true);
            }
            else
            {
                HttpContext.Current.Response.Write(WebUnitily.AlertUrl("您的权限不够!!", "../Index.aspx"));
                HttpContext.Current.Response.End();
                return(false);
            }
        }
    }
예제 #30
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        string str = "", sqlStr = "", delFileName = "";

        if (Request["cbName"] != null)
        {
            str = Request["cbName"];
        }
        if (str.Trim().Length < 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择要删除的商品"));
            return;
        }

        sqlStr = "select ProductID from Product where productID in(" + str + ")";
        DataSet set = new TableUpDateFieldsInfo().getDeleteShop(sqlStr);

        for (int i = 0; i < set.Tables[0].Rows.Count; i++)
        {
            if (delFileName.Length > 1)
            {
                delFileName = delFileName.Substring(1);
            }
            else
            {
                delFileName = "";
            }
        }
        if (new TableUpDateFieldsInfo().Deleteproject("product", " and ProductID in(" + str + ")") > 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("产品删除成功!!"));
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("产品删除失败!!"));
        }
        BindProduct();
    }