📄 goodsupdate.aspx.cs
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
namespace 金利来分销管理系统.Goods
{
public partial class GoodsUpdate : System.Web.UI.Page
{
#region 商品修改 BLL层构造函数
BLL.Goods.ProductUpdateBll ProUpdateShow;
BLL.Employee.EmployeeBll employeebllshow;
public GoodsUpdate()
{
ProUpdateShow = new BLL.Goods.ProductUpdateBll();
employeebllshow = new BLL.Employee.EmployeeBll();
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack )//第一次执行时时为false,以后为true
{
//用户权限
if (Session["employee_id"] == null)
{
Response.Write ("请您登陆系统");
}
else
{
if (employeebllshow.UserRole(Session["role_id"].ToString(), "18") == true)
{
List<Model.Goods.ProductModel> li = ProUpdateShow.Getupdateshow(Request.QueryString["Product_id"]);
foreach (Model.Goods.ProductModel item in li)
{
this.lalProid.Text = item.product_id;
this.lalbraID.Text = item.brand_id.ToString();
this.txtProSalePrice.Text = item.product_saleprice.ToString();
this.txtProCostPrice.Text = item.Product_costprice.ToString();
this.txtProTradePrice.Text = item.Product_tradeprice.ToString();
this.txtProName.Text = item.product_name;
}
}
else
{
Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
}
}
}
}
#region 商品修改按钮
protected void butupdate_Click(object sender, EventArgs e)
{
ProUpdateShow.proupdate(this.lalProid.Text,decimal.Parse(this.txtProSalePrice.Text), decimal.Parse(this.txtProCostPrice.Text), decimal.Parse(this.txtProTradePrice.Text), this.txtProName.Text);
Response.Write("<script>alert('修改商品成功!')</script>");
Response.Redirect("GoodsSelect.aspx");
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -